Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3D5504D4A for ; Sat, 21 May 2011 15:32:42 +0000 (UTC) Received: (qmail 29199 invoked by uid 500); 21 May 2011 15:32:41 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 29162 invoked by uid 500); 21 May 2011 15:32:41 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 29120 invoked by uid 99); 21 May 2011 15:32:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 May 2011 15:32:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 May 2011 15:32:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BE138238890A; Sat, 21 May 2011 15:32:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1125729 - in /subversion/trunk/subversion: include/svn_fs.h libsvn_fs_fs/caching.c Date: Sat, 21 May 2011 15:32:16 -0000 To: commits@subversion.apache.org From: stefan2@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110521153216.BE138238890A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: stefan2 Date: Sat May 21 15:32:16 2011 New Revision: 1125729 URL: http://svn.apache.org/viewvc?rev=1125729&view=rev Log: First step towards removing FSFS-specific options from the global cache configuration structure. In the future, these settings shall be configurable on a per-repository basis and be passed as part of the fs_config options hash. * subversion/include/svn_fs.h (SVN_FS_CONFIG_FSFS_CACHE_DELTAS, SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS): define * subversion/libsvn_fs_fs/caching.c (read_config): read additional options from config hash (svn_fs_fs__initialize_caches): apply these options Modified: subversion/trunk/subversion/include/svn_fs.h subversion/trunk/subversion/libsvn_fs_fs/caching.c Modified: subversion/trunk/subversion/include/svn_fs.h URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1125729&r1=1125728&r2=1125729&view=diff ============================================================================== --- subversion/trunk/subversion/include/svn_fs.h (original) +++ subversion/trunk/subversion/include/svn_fs.h Sat May 21 15:32:16 2011 @@ -73,6 +73,18 @@ typedef struct svn_fs_t svn_fs_t; #define SVN_FS_CONFIG_BDB_TXN_NOSYNC "bdb-txn-nosync" #define SVN_FS_CONFIG_BDB_LOG_AUTOREMOVE "bdb-log-autoremove" +/** Enable / disable text delta caching for a FSFS repository. + * + * @since New in 1.7. + */ +#define SVN_FS_CONFIG_FSFS_CACHE_DELTAS "fsfs-cache-deltas" + +/** Enable / disable full-text caching for a FSFS repository. + * + * @since New in 1.7. + */ +#define SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS "fsfs-cache-fulltexts" + /* See also svn_fs_type(). */ /** @since New in 1.1. */ #define SVN_FS_CONFIG_FS_TYPE "fs-type" @@ -214,7 +226,7 @@ svn_fs_create(svn_fs_t **fs_p, * they open separate filesystem objects. * * @note You probably don't want to use this directly. Take a look at - * svn_repos_open() instead. + * svn_repos_open2() instead. * * @since New in 1.1. */ Modified: subversion/trunk/subversion/libsvn_fs_fs/caching.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/caching.c?rev=1125729&r1=1125728&r2=1125729&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_fs_fs/caching.c (original) +++ subversion/trunk/subversion/libsvn_fs_fs/caching.c Sat May 21 15:32:16 2011 @@ -32,6 +32,7 @@ #include "svn_cache_config.h" #include "svn_private_config.h" +#include "svn_hash.h" #include "private/svn_debug.h" /* Return a memcache in *MEMCACHE_P for FS if it's configured to use @@ -42,6 +43,8 @@ static svn_error_t * read_config(svn_memcache_t **memcache_p, svn_boolean_t *fail_stop, + svn_boolean_t *cache_txdeltas, + svn_boolean_t *cache_fulltexts, svn_fs_t *fs, apr_pool_t *pool) { @@ -49,6 +52,16 @@ read_config(svn_memcache_t **memcache_p, SVN_ERR(svn_cache__make_memcache_from_config(memcache_p, ffd->config, fs->pool)); + + *cache_txdeltas + = svn_hash_get_bool(fs->config, + SVN_FS_CONFIG_FSFS_CACHE_DELTAS, + svn_get_cache_config()->cache_txdeltas); + *cache_fulltexts + = svn_hash_get_bool(fs->config, + SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS, + svn_get_cache_config()->cache_fulltexts); + return svn_config_get_bool(ffd->config, fail_stop, CONFIG_SECTION_CACHES, CONFIG_OPTION_FAIL_STOP, FALSE); @@ -181,8 +194,16 @@ svn_fs_fs__initialize_caches(svn_fs_t *f (char *)NULL); svn_memcache_t *memcache; svn_boolean_t no_handler; - - SVN_ERR(read_config(&memcache, &no_handler, fs, pool)); + svn_boolean_t cache_txdeltas; + svn_boolean_t cache_fulltexts; + + /* Evaluating the cache configuration. */ + SVN_ERR(read_config(&memcache, + &no_handler, + &cache_txdeltas, + &cache_fulltexts, + fs, + pool)); /* Make the cache for revision roots. For the vast majority of * commands, this is only going to contain a few entries (svnadmin @@ -282,39 +303,35 @@ svn_fs_fs__initialize_caches(svn_fs_t *f SVN_ERR(init_callbacks(ffd->packed_offset_cache, fs, no_handler, pool)); /* initialize fulltext cache as configured */ - if (memcache) - { - SVN_ERR(svn_cache__create_memcache(&(ffd->fulltext_cache), - memcache, - /* Values are svn_string_t */ - NULL, NULL, - APR_HASH_KEY_STRING, - apr_pstrcat(pool, prefix, "TEXT", - (char *)NULL), - fs->pool)); - } - else if (svn_cache__get_global_membuffer_cache() && - svn_get_cache_config()->cache_fulltexts) - { - SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->fulltext_cache), - svn_cache__get_global_membuffer_cache(), - /* Values are svn_string_t */ - NULL, NULL, - APR_HASH_KEY_STRING, - apr_pstrcat(pool, prefix, "TEXT", - (char *)NULL), - fs->pool)); - } - else - { - ffd->fulltext_cache = NULL; - } + ffd->fulltext_cache = NULL; + if (cache_txdeltas) + if (memcache) + { + SVN_ERR(svn_cache__create_memcache(&(ffd->fulltext_cache), + memcache, + /* Values are svn_string_t */ + NULL, NULL, + APR_HASH_KEY_STRING, + apr_pstrcat(pool, prefix, "TEXT", + (char *)NULL), + fs->pool)); + } + else if (svn_cache__get_global_membuffer_cache()) + { + SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->fulltext_cache), + svn_cache__get_global_membuffer_cache(), + /* Values are svn_string_t */ + NULL, NULL, + APR_HASH_KEY_STRING, + apr_pstrcat(pool, prefix, "TEXT", + (char *)NULL), + fs->pool)); + } SVN_ERR(init_callbacks(ffd->fulltext_cache, fs, no_handler, pool)); /* initialize txdelta window cache, if that has been enabled */ - if (svn_cache__get_global_membuffer_cache() && - svn_get_cache_config()->cache_txdeltas) + if (svn_cache__get_global_membuffer_cache() && cache_txdeltas) { SVN_ERR(svn_cache__create_membuffer_cache (&(ffd->txdelta_window_cache),