Author: stefan2
Date: Thu Feb 26 22:39:05 2015
New Revision: 1662591
URL: http://svn.apache.org/r1662591
Log:
On the fsx-1.10 branch:
* subversion/libsvn_fs_x/dag_cache.h
(svn_fs_x__get_dag_path): Switch declaration to two-pool paradigm.
* subversion/libsvn_fs_x/dag_cache.c
(svn_fs_x__get_dag_path): Use two pool parameters now. Change the call
to get_copy_inheritance such that no further
copying of data is required.
* subversion/libsvn_fs_x/tree.c
(x_change_node_prop,
x_make_dir,
x_delete_node,
copy_helper,
x_make_file,
apply_textdelta,
apply_text ,
x_closest_copy,
history_prev,
get_mergeinfo_for_path_internal): Update callers.
Modified:
subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.c
subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.h
subversion/branches/fsx-1.10/subversion/libsvn_fs_x/tree.c
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=1662591&r1=1662590&r2=1662591&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 Thu Feb 26
22:39:05 2015
@@ -856,17 +856,19 @@ svn_fs_x__get_dag_path(svn_fs_x__dag_pat
const char *fs_path,
int flags,
svn_boolean_t is_txn_path,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_fs_t *fs = root->fs;
dag_node_t *here = NULL; /* The directory we're currently looking at. */
svn_fs_x__dag_path_t *dag_path; /* The path from HERE up to the root. */
- apr_pool_t *iterpool = svn_pool_create(pool);
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
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);
+ svn_stringbuf_t *entry_buffer = svn_stringbuf_create_ensure(64,
+ scratch_pool);
apr_size_t path_len;
/* Normalize the FS_PATH to be compatible with our DAG walk utils. */
@@ -874,7 +876,7 @@ svn_fs_x__get_dag_path(svn_fs_x__dag_pat
/* Make a DAG_PATH for the root node, using its own current copy id. */
SVN_ERR(get_root_node(&here, root, change_set, iterpool));
- dag_path = make_parent_path(here, entry_buffer, NULL, pool);
+ dag_path = make_parent_path(here, entry_buffer, NULL, result_pool);
dag_path->copy_inherit = svn_fs_x__copy_id_inherit_self;
path_len = path.len;
@@ -901,7 +903,8 @@ svn_fs_x__get_dag_path(svn_fs_x__dag_pat
if ((flags & svn_fs_x__dag_path_last_optional)
&& (path_len == path.len))
{
- dag_path = make_parent_path(NULL, entry_buffer, dag_path, pool);
+ dag_path = make_parent_path(NULL, entry_buffer, dag_path,
+ result_pool);
break;
}
else if (flags & svn_fs_x__dag_path_allow_null)
@@ -918,16 +921,12 @@ svn_fs_x__get_dag_path(svn_fs_x__dag_pat
}
/* Now, make a parent_path item for CHILD. */
- dag_path = make_parent_path(here, entry_buffer, dag_path, pool);
+ dag_path = make_parent_path(here, entry_buffer, dag_path, result_pool);
if (is_txn_path)
{
- svn_fs_x__copy_id_inherit_t inherit;
- const char *copy_path = NULL;
- SVN_ERR(get_copy_inheritance(&inherit, ©_path, fs,
- dag_path, iterpool));
-
- dag_path->copy_inherit = inherit;
- dag_path->copy_src_path = apr_pstrdup(pool, copy_path);
+ SVN_ERR(get_copy_inheritance(&dag_path->copy_inherit,
+ &dag_path->copy_src_path,
+ fs, dag_path, iterpool));
}
}
Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.h
URL:
http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.h?rev=1662591&r1=1662590&r2=1662591&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.h (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/dag_cache.h Thu Feb 26
22:39:05 2015
@@ -92,10 +92,11 @@ typedef struct svn_fs_x__dag_path_t
} svn_fs_x__dag_path_t;
-/* Open the node identified by PATH in ROOT, allocating in POOL. Set
- *DAG_PATH_P to a path from the node up to ROOT. The resulting
+/* Open the node identified by PATH in ROOT, allocating in RESULT_POOL.
+ Set *DAG_PATH_P to a path from the node up to ROOT. The resulting
**DAG_PATH_P value is guaranteed to contain at least one element,
- for the root directory. PATH must be in canonical form.
+ for the root directory. PATH must be in canonical form. Allocate
+ temporaries from SCRATCH_POOL.
If resulting *PARENT_PATH_P will eventually be made mutable and
modified, or if copy ID inheritance information is otherwise needed,
@@ -123,7 +124,8 @@ svn_fs_x__get_dag_path(svn_fs_x__dag_pat
const char *path,
int flags,
svn_boolean_t is_txn_path,
- apr_pool_t *pool);
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Make the node referred to by PARENT_PATH mutable, if it isn't already,
allocating from RESULT_POOL. ROOT must be the root from which
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=1662591&r1=1662590&r2=1662591&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 Thu Feb 26
22:39:05 2015
@@ -517,7 +517,8 @@ x_change_node_prop(svn_fs_root_t *root,
return SVN_FS__NOT_TXN(root);
txn_id = svn_fs_x__root_txn_id(root);
- SVN_ERR(svn_fs_x__get_dag_path(&dag_path, root, path, 0, TRUE, subpool));
+ SVN_ERR(svn_fs_x__get_dag_path(&dag_path, root, path, 0, TRUE, subpool,
+ subpool));
/* Check (non-recursively) to see if path is locked; if so, check
that we can use it. */
@@ -1395,7 +1396,7 @@ x_make_dir(svn_fs_root_t *root,
SVN_ERR(svn_fs_x__get_dag_path(&dag_path, root, path,
svn_fs_x__dag_path_last_optional,
- TRUE, subpool));
+ TRUE, subpool, subpool));
/* Check (recursively) to see if some lock is 'reserving' a path at
that location, or even some child-path; if so, check that we can
@@ -1450,7 +1451,8 @@ x_delete_node(svn_fs_root_t *root,
return SVN_FS__NOT_TXN(root);
txn_id = svn_fs_x__root_txn_id(root);
- SVN_ERR(svn_fs_x__get_dag_path(&dag_path, root, path, 0, TRUE, subpool));
+ SVN_ERR(svn_fs_x__get_dag_path(&dag_path, root, path, 0, TRUE, subpool,
+ subpool));
kind = svn_fs_x__dag_node_kind(dag_path->node);
/* We can't remove the root of the filesystem. */
@@ -1550,7 +1552,7 @@ copy_helper(svn_fs_root_t *from_root,
make one there. */
SVN_ERR(svn_fs_x__get_dag_path(&to_dag_path, to_root, to_path,
svn_fs_x__dag_path_last_optional, TRUE,
- scratch_pool));
+ scratch_pool, scratch_pool));
/* Check to see if path (or any child thereof) is locked; if so,
check that we can use the existing lock(s). */
@@ -1733,7 +1735,7 @@ x_make_file(svn_fs_root_t *root,
SVN_ERR(svn_fs_x__get_dag_path(&dag_path, root, path,
svn_fs_x__dag_path_last_optional,
- TRUE, subpool));
+ TRUE, subpool, subpool));
/* If there's already a file by that name, complain.
This also catches the case of trying to make a file named `/'. */
@@ -1919,7 +1921,7 @@ apply_textdelta(void *baton,
/* Call open_path with no flags, as we want this to return an error
if the node for which we are searching doesn't exist. */
SVN_ERR(svn_fs_x__get_dag_path(&dag_path, tb->root, tb->path, 0, TRUE,
- scratch_pool));
+ scratch_pool, scratch_pool));
/* Check (non-recursively) to see if path is locked; if so, check
that we can use it. */
@@ -2086,7 +2088,7 @@ apply_text(void *baton,
/* Call open_path with no flags, as we want this to return an error
if the node for which we are searching doesn't exist. */
SVN_ERR(svn_fs_x__get_dag_path(&dag_path, tb->root, tb->path, 0, TRUE,
- scratch_pool));
+ scratch_pool, scratch_pool));
/* Check (non-recursively) to see if path is locked; if so, check
that we can use it. */
@@ -2427,7 +2429,7 @@ x_closest_copy(svn_fs_root_t **root_p,
*path_p = NULL;
SVN_ERR(svn_fs_x__get_dag_path(&dag_path, root, path, 0, FALSE,
- scratch_pool));
+ scratch_pool, scratch_pool));
/* Find the youngest copyroot in the path of this node-rev, which
will indicate the target of the innermost copy affecting the
@@ -2446,7 +2448,7 @@ x_closest_copy(svn_fs_root_t **root_p,
SVN_ERR(svn_fs_x__revision_root(©_dst_root, fs, copy_dst_rev, pool));
SVN_ERR(svn_fs_x__get_dag_path(©_dst_dag_path, copy_dst_root, path,
svn_fs_x__dag_path_allow_null, FALSE,
- scratch_pool));
+ scratch_pool, scratch_pool));
if (copy_dst_dag_path == NULL)
{
svn_pool_destroy(scratch_pool);
@@ -2550,7 +2552,7 @@ history_prev(svn_fs_history_t **prev_his
/* Open PATH/REVISION, and get its node and a bunch of other
goodies. */
SVN_ERR(svn_fs_x__get_dag_path(&dag_path, root, path, 0, FALSE,
- scratch_pool));
+ scratch_pool, scratch_pool));
node = dag_path->node;
commit_path = svn_fs_x__dag_get_created_path(node);
commit_rev = svn_fs_x__dag_get_revision(node);
@@ -2903,7 +2905,7 @@ get_mergeinfo_for_path_internal(svn_merg
svn_string_t *mergeinfo_string;
SVN_ERR(svn_fs_x__get_dag_path(&dag_path, rev_root, path, 0, FALSE,
- scratch_pool));
+ scratch_pool, scratch_pool));
if (inherit == svn_mergeinfo_nearest_ancestor && ! dag_path->parent)
return SVN_NO_ERROR;