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),