Author: stefan2
Date: Sat Feb 21 15:19:23 2015
New Revision: 1661380
URL: http://svn.apache.org/r1661380
Log:
On the fsx-1.10 branch: Move a the somewhat generic root_change_set
out of the FSX DAG caching module.
* subversion/libsvn_fs_x/tree.c
(svn_fs_x__root_change_set): Move code here from dag_cache.c, rename
and make it non-static.
* subversion/libsvn_fs_x/tree.h
(svn_fs_x__root_change_set): Declare the new function.
* subversion/libsvn_fs_x/dag_cache.c
(root_change_set): Remove here.
(dag_node_cache_get,
set_dag_node,
svn_fs_x__invalidate_dag_cache,
walk_dag_path,
svn_fs_x__get_dag_path): Update callers.
Modified:
subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.c
subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c
subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.h
Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.c
URL:
http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.c?rev=1661380&r1=1661379&r2=1661380&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.c Sat Feb 21
15:19:23 2015
@@ -70,20 +70,6 @@
#include "private/svn_fspath.h"
#include "../libsvn_fs/fs-loader.h"
-
-
-
-/* Return the change set to a given ROOT. */
-static svn_fs_x__change_set_t
-root_change_set(svn_fs_root_t *root)
-{
- if (root->is_txn_root)
- return svn_fs_x__change_set_by_txn(svn_fs_x__root_txn_id(root));
-
- return svn_fs_x__change_set_by_rev(root->rev);
-}
-
-
/*** Path handling ***/
@@ -431,7 +417,7 @@ dag_node_cache_get(svn_fs_root_t *root,
const svn_string_t *path)
{
svn_fs_x__data_t *ffd = root->fs->fsap_data;
- svn_fs_x__change_set_t change_set = root_change_set(root);
+ svn_fs_x__change_set_t change_set = svn_fs_x__root_change_set(root);
auto_clear_dag_cache(ffd->dag_node_cache);
return cache_lookup(ffd->dag_node_cache, change_set, path)->node;
@@ -452,7 +438,7 @@ set_dag_node(svn_fs_root_t *root,
svn_string_t normalized;
auto_clear_dag_cache(cache);
- bucket = cache_lookup(cache, root_change_set(root),
+ bucket = cache_lookup(cache, svn_fs_x__root_change_set(root),
normalize_path(&normalized, path));
bucket->node = svn_fs_x__dag_copy_into_pool(node, cache->pool);
}
@@ -479,7 +465,7 @@ svn_fs_x__invalidate_dag_cache(svn_fs_ro
{
svn_fs_x__data_t *ffd = root->fs->fsap_data;
svn_fs_x__dag_cache_t *cache = ffd->dag_node_cache;
- svn_fs_x__change_set_t change_set = root_change_set(root);
+ svn_fs_x__change_set_t change_set = svn_fs_x__root_change_set(root);
apr_size_t i;
for (i = 0; i < BUCKET_COUNT; ++i)
@@ -701,7 +687,7 @@ walk_dag_path(dag_node_t **node_p,
{
dag_node_t *here = NULL; /* The directory we're currently looking at. */
apr_pool_t *iterpool;
- svn_fs_x__change_set_t change_set = root_change_set(root);
+ svn_fs_x__change_set_t change_set = svn_fs_x__root_change_set(root);
const char *entry;
svn_string_t directory;
svn_stringbuf_t *entry_buffer;
@@ -910,7 +896,7 @@ svn_fs_x__get_dag_path(svn_fs_x__dag_pat
svn_fs_x__dag_path_t *dag_path; /* The path from HERE up to the root. */
apr_pool_t *iterpool = svn_pool_create(pool);
- svn_fs_x__change_set_t change_set = root_change_set(root);
+ svn_fs_x__change_set_t change_set = svn_fs_x__root_change_set(root);
const char *entry;
svn_string_t path;
svn_stringbuf_t *entry_buffer = svn_stringbuf_create_ensure(64, pool);
Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c
URL:
http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c?rev=1661380&r1=1661379&r2=1661380&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c Sat Feb 21
15:19:23 2015
@@ -168,6 +168,16 @@ svn_fs_x__root_txn_id(svn_fs_root_t *roo
return frd->txn_id;
}
+/* Return the change set to a given ROOT. */
+svn_fs_x__change_set_t
+svn_fs_x__root_change_set(svn_fs_root_t *root)
+{
+ if (root->is_txn_root)
+ return svn_fs_x__change_set_by_txn(svn_fs_x__root_txn_id(root));
+
+ return svn_fs_x__change_set_by_rev(root->rev);
+}
+
/* Set *NODE_P to a freshly opened dag node referring to the root
directory of ROOT, allocating from RESULT_POOL. Use SCRATCH_POOL
for temporary allocations. */
Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.h
URL:
http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.h?rev=1661380&r1=1661379&r2=1661380&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.h (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.h Sat Feb 21
15:19:23 2015
@@ -36,6 +36,10 @@ extern "C" {
svn_fs_x__txn_id_t
svn_fs_x__root_txn_id(svn_fs_root_t *root);
+/* Return the change set to a given ROOT. */
+svn_fs_x__change_set_t
+svn_fs_x__root_change_set(svn_fs_root_t *root);
+
/* Set *NODE_P to a freshly opened dag node referring to the root
directory of ROOT, allocating from RESULT_POOL. Use SCRATCH_POOL
for temporary allocations. */