You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/11/04 15:56:50 UTC
svn commit: r1405553 - in /subversion/trunk/subversion: include/svn_fs.h
libsvn_fs_fs/caching.c svnadmin/main.c
Author: stefan2
Date: Sun Nov 4 14:56:50 2012
New Revision: 1405553
URL: http://svn.apache.org/viewvc?rev=1405553&view=rev
Log:
Remove layering violation introduced in r1400498. We simply add a
special value ("2") to the "cache revprops" config setting. When
set to this value, it will cause FSFS to enable revprop caching iff
we the required infrastructure is also available.
* subversion/include/svn_fs.h
(SVN_FS_CONFIG_FSFS_CACHE_REVPROPS): document extended value range
* subversion/libsvn_fs_fs/caching.c
(read_config): add handling for option value "2"
* subversion/svnadmin/main.c
(open_repos): use extended option value
Modified:
subversion/trunk/subversion/include/svn_fs.h
subversion/trunk/subversion/libsvn_fs_fs/caching.c
subversion/trunk/subversion/svnadmin/main.c
Modified: subversion/trunk/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_fs.h?rev=1405553&r1=1405552&r2=1405553&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_fs.h (original)
+++ subversion/trunk/subversion/include/svn_fs.h Sun Nov 4 14:56:50 2012
@@ -88,6 +88,10 @@ typedef struct svn_fs_t svn_fs_t;
/** Enable / disable revprop caching for a FSFS repository.
*
+ * "2" is allowed, too and means "enable if efficient",
+ * i.e. this will not create warning at runtime if there
+ * if no efficient support for revprop caching.
+ *
* @since New in 1.8.
*/
#define SVN_FS_CONFIG_FSFS_CACHE_REVPROPS "fsfs-cache-revprops"
Modified: subversion/trunk/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/caching.c?rev=1405553&r1=1405552&r2=1405553&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/caching.c Sun Nov 4 14:56:50 2012
@@ -83,11 +83,19 @@ read_config(svn_memcache_t **memcache_p,
* Revprop caching significantly speeds up operations like
* svn ls -v. However, it requires synchronization that may
* not be available or efficient in the current server setup.
+ *
+ * If the caller chose option "2", enable revprop caching if
+ * the required API support is there to make it efficient.
*/
- *cache_revprops
- = svn_hash__get_bool(fs->config,
- SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
- FALSE);
+ if (strcmp(svn_hash__get_cstring(fs->config,
+ SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
+ ""), "2"))
+ *cache_revprops
+ = svn_hash__get_bool(fs->config,
+ SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
+ FALSE);
+ else
+ *cache_revprops = svn_named_atomic__is_efficient();
return svn_config_get_bool(ffd->config, fail_stop,
CONFIG_SECTION_CACHES, CONFIG_OPTION_FAIL_STOP,
Modified: subversion/trunk/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/main.c?rev=1405553&r1=1405552&r2=1405553&view=diff
==============================================================================
--- subversion/trunk/subversion/svnadmin/main.c (original)
+++ subversion/trunk/subversion/svnadmin/main.c Sun Nov 4 14:56:50 2012
@@ -43,7 +43,6 @@
#include "svn_xml.h"
#include "private/svn_opt_private.h"
-#include "private/svn_named_atomic.h"
#include "svn_private_config.h"
@@ -116,8 +115,7 @@ open_repos(svn_repos_t **repos,
apr_hash_set(fs_config, SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS,
APR_HASH_KEY_STRING, "1");
apr_hash_set(fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS,
- APR_HASH_KEY_STRING,
- svn_named_atomic__is_efficient() ? "1" : "0");
+ APR_HASH_KEY_STRING, "2");
/* now, open the requested repository */
SVN_ERR(svn_repos_open2(repos, path, fs_config, pool));