You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2012/03/26 17:26:04 UTC
svn commit: r1305396 - in /subversion/trunk: ./
subversion/libsvn_fs_fs/dag.c subversion/libsvn_fs_fs/dag.h
subversion/libsvn_fs_fs/fs_fs.c subversion/libsvn_fs_fs/tree.c
Author: danielsh
Date: Mon Mar 26 15:26:03 2012
New Revision: 1305396
URL: http://svn.apache.org/viewvc?rev=1305396&view=rev
Log:
Reintegrate the node_pool branch. This improves pool usage patterns in
libsvn_fs_fs/dag.c; see the branch for details.
This merge was performed in a trunk@1305381 wc as follows:
% ./subversion/svn/svn merge --symmetric --reintegrate ^/subversion/branches/node_pool
DBG: merge.c:11213: base on source: https://svn.apache.org/repos/asf/subversion/branches/node_pool@1
DBG: merge.c:11215: base on target: https://svn.apache.org/repos/asf/subversion/trunk@1304827
DBG: merge.c:11328: yca https://svn.apache.org/repos/asf/subversion/trunk@1304827
DBG: merge.c:11329: base https://svn.apache.org/repos/asf/subversion/trunk@1304827
DBG: merge.c:11331: mid https://svn.apache.org/repos/asf/subversion/branches/node_pool@1305387
DBG: merge.c:11332: right https://svn.apache.org/repos/asf/subversion/branches/node_pool@1305387
Modified:
subversion/trunk/ (props changed)
subversion/trunk/subversion/libsvn_fs_fs/dag.c
subversion/trunk/subversion/libsvn_fs_fs/dag.h
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
subversion/trunk/subversion/libsvn_fs_fs/tree.c
Propchange: subversion/trunk/
------------------------------------------------------------------------------
Merged /subversion/branches/node_pool:r1304828-1305388
Modified: subversion/trunk/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?rev=1305396&r1=1305395&r2=1305396&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.c Mon Mar 26 15:26:03 2012
@@ -70,6 +70,9 @@ struct dag_node_t
things for you. */
node_revision_t *node_revision;
+ /* The pool to allocate NODE_REVISION in. */
+ apr_pool_t *node_pool;
+
/* the path at which this node was created. */
const char *created_path;
};
@@ -139,7 +142,7 @@ copy_node_revision(node_revision_t *node
/* Set *NODEREV_P to the cached node-revision for NODE.
If the node-revision was not already cached in NODE, read it in,
- allocating the cache in POOL.
+ allocating the cache in NODE->NODE_POOL.
If you plan to change the contents of NODE, be careful! We're
handing you a pointer directly to our cached node-revision, not
@@ -150,8 +153,7 @@ copy_node_revision(node_revision_t *node
the structure at all. */
static svn_error_t *
get_node_revision(node_revision_t **noderev_p,
- dag_node_t *node,
- apr_pool_t *pool)
+ dag_node_t *node)
{
node_revision_t *noderev;
@@ -159,7 +161,7 @@ get_node_revision(node_revision_t **node
if (! node->node_revision)
{
SVN_ERR(svn_fs_fs__get_node_revision(&noderev, node->fs,
- node->id, pool));
+ node->id, node->node_pool));
node->node_revision = noderev;
}
@@ -190,7 +192,8 @@ svn_fs_fs__dag_get_node(dag_node_t **nod
new_node->id = svn_fs_fs__id_copy(id, pool);
/* Grab the contents so we can inspect the node's kind and created path. */
- SVN_ERR(get_node_revision(&noderev, new_node, pool));
+ new_node->node_pool = pool;
+ SVN_ERR(get_node_revision(&noderev, new_node));
/* Initialize the KIND and CREATED_PATH attributes */
new_node->kind = noderev->kind;
@@ -227,12 +230,11 @@ svn_fs_fs__dag_get_revision(svn_revnum_t
svn_error_t *
svn_fs_fs__dag_get_predecessor_id(const svn_fs_id_t **id_p,
- dag_node_t *node,
- apr_pool_t *pool)
+ dag_node_t *node)
{
node_revision_t *noderev;
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
*id_p = noderev->predecessor_id;
return SVN_NO_ERROR;
}
@@ -240,44 +242,40 @@ svn_fs_fs__dag_get_predecessor_id(const
svn_error_t *
svn_fs_fs__dag_get_predecessor_count(int *count,
- dag_node_t *node,
- apr_pool_t *pool)
+ dag_node_t *node)
{
node_revision_t *noderev;
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
*count = noderev->predecessor_count;
return SVN_NO_ERROR;
}
svn_error_t *
svn_fs_fs__dag_get_mergeinfo_count(apr_int64_t *count,
- dag_node_t *node,
- apr_pool_t *pool)
+ dag_node_t *node)
{
node_revision_t *noderev;
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
*count = noderev->mergeinfo_count;
return SVN_NO_ERROR;
}
svn_error_t *
svn_fs_fs__dag_has_mergeinfo(svn_boolean_t *has_mergeinfo,
- dag_node_t *node,
- apr_pool_t *pool)
+ dag_node_t *node)
{
node_revision_t *noderev;
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
*has_mergeinfo = noderev->has_mergeinfo;
return SVN_NO_ERROR;
}
svn_error_t *
svn_fs_fs__dag_has_descendants_with_mergeinfo(svn_boolean_t *do_they,
- dag_node_t *node,
- apr_pool_t *pool)
+ dag_node_t *node)
{
node_revision_t *noderev;
@@ -287,7 +285,7 @@ svn_fs_fs__dag_has_descendants_with_merg
return SVN_NO_ERROR;
}
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
if (noderev->mergeinfo_count > 1)
*do_they = TRUE;
else if (noderev->mergeinfo_count == 1 && !noderev->has_mergeinfo)
@@ -309,15 +307,13 @@ static svn_error_t *
dir_entry_id_from_node(const svn_fs_id_t **id_p,
dag_node_t *parent,
const char *name,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_fs_dirent_t *dirent;
- apr_pool_t *subpool = svn_pool_create(pool);
- SVN_ERR(svn_fs_fs__dag_dir_entry(&dirent, parent, name, subpool, pool));
- *id_p = dirent ? svn_fs_fs__id_copy(dirent->id, pool) : NULL;
-
- svn_pool_destroy(subpool);
+ SVN_ERR(svn_fs_fs__dag_dir_entry(&dirent, parent, name, scratch_pool));
+ *id_p = dirent ? svn_fs_fs__id_copy(dirent->id, result_pool) : NULL;
return SVN_NO_ERROR;
}
@@ -342,7 +338,7 @@ set_entry(dag_node_t *parent,
node_revision_t *parent_noderev;
/* Get the parent's node-revision. */
- SVN_ERR(get_node_revision(&parent_noderev, parent, pool));
+ SVN_ERR(get_node_revision(&parent_noderev, parent));
/* Set the new entry. */
return svn_fs_fs__set_entry(parent->fs, txn_id, parent_noderev, name, id,
@@ -355,7 +351,7 @@ set_entry(dag_node_t *parent,
will be a file. The new node will be allocated in POOL. PARENT
must be mutable, and must not have an entry named NAME.
- Use POOL for all allocations including caching the node_revision in PARENT.
+ Use POOL for all allocations, except caching the node_revision in PARENT.
*/
static svn_error_t *
make_entry(dag_node_t **child_p,
@@ -392,7 +388,7 @@ make_entry(dag_node_t **child_p,
new_noderev.kind = is_dir ? svn_node_dir : svn_node_file;
new_noderev.created_path = svn_fspath__join(parent_path, name, pool);
- SVN_ERR(get_node_revision(&parent_noderev, parent, pool));
+ SVN_ERR(get_node_revision(&parent_noderev, parent));
new_noderev.copyroot_path = apr_pstrdup(pool,
parent_noderev->copyroot_path);
new_noderev.copyroot_rev = parent_noderev->copyroot_rev;
@@ -419,12 +415,11 @@ make_entry(dag_node_t **child_p,
svn_error_t *
svn_fs_fs__dag_dir_entries(apr_hash_t **entries,
dag_node_t *node,
- apr_pool_t *pool,
- apr_pool_t *node_pool)
+ apr_pool_t *pool)
{
node_revision_t *noderev;
- SVN_ERR(get_node_revision(&noderev, node, node_pool));
+ SVN_ERR(get_node_revision(&noderev, node));
if (noderev->kind != svn_node_dir)
return svn_error_create(SVN_ERR_FS_NOT_DIRECTORY, NULL,
@@ -437,11 +432,10 @@ svn_error_t *
svn_fs_fs__dag_dir_entry(svn_fs_dirent_t **dirent,
dag_node_t *node,
const char* name,
- apr_pool_t *pool,
- apr_pool_t *node_pool)
+ apr_pool_t *pool)
{
node_revision_t *noderev;
- SVN_ERR(get_node_revision(&noderev, node, node_pool));
+ SVN_ERR(get_node_revision(&noderev, node));
if (noderev->kind != svn_node_dir)
return svn_error_create(SVN_ERR_FS_NOT_DIRECTORY, NULL,
@@ -488,7 +482,7 @@ svn_fs_fs__dag_get_proplist(apr_hash_t *
node_revision_t *noderev;
apr_hash_t *proplist = NULL;
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
SVN_ERR(svn_fs_fs__get_proplist(&proplist, node->fs,
noderev, pool));
@@ -517,7 +511,7 @@ svn_fs_fs__dag_set_proplist(dag_node_t *
}
/* Go get a fresh NODE-REVISION for this node. */
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
/* Set the new proplist. */
return svn_fs_fs__set_proplist(node->fs, noderev, proplist, pool);
@@ -545,7 +539,7 @@ svn_fs_fs__dag_increment_mergeinfo_count
return SVN_NO_ERROR;
/* Go get a fresh NODE-REVISION for this node. */
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
noderev->mergeinfo_count += increment;
if (noderev->mergeinfo_count < 0)
@@ -594,7 +588,7 @@ svn_fs_fs__dag_set_has_mergeinfo(dag_nod
}
/* Go get a fresh NODE-REVISION for this node. */
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
noderev->has_mergeinfo = has_mergeinfo;
@@ -658,6 +652,7 @@ svn_fs_fs__dag_clone_child(dag_node_t **
dag_node_t *cur_entry; /* parent's current entry named NAME */
const svn_fs_id_t *new_node_id; /* node id we'll put into NEW_NODE */
svn_fs_t *fs = svn_fs_fs__dag_get_fs(parent);
+ apr_pool_t *subpool = svn_pool_create(pool);
/* First check that the parent is mutable. */
if (! svn_fs_fs__dag_check_mutable(parent))
@@ -672,7 +667,7 @@ svn_fs_fs__dag_clone_child(dag_node_t **
"Attempted to make a child clone with an illegal name '%s'", name);
/* Find the node named NAME in PARENT's entries list if it exists. */
- SVN_ERR(svn_fs_fs__dag_open(&cur_entry, parent, name, pool));
+ SVN_ERR(svn_fs_fs__dag_open(&cur_entry, parent, name, pool, subpool));
/* Check for mutability in the node we found. If it's mutable, we
don't need to clone it. */
@@ -686,11 +681,11 @@ svn_fs_fs__dag_clone_child(dag_node_t **
node_revision_t *noderev, *parent_noderev;
/* Go get a fresh NODE-REVISION for current child node. */
- SVN_ERR(get_node_revision(&noderev, cur_entry, pool));
+ SVN_ERR(get_node_revision(&noderev, cur_entry));
if (is_parent_copyroot)
{
- SVN_ERR(get_node_revision(&parent_noderev, parent, pool));
+ SVN_ERR(get_node_revision(&parent_noderev, parent));
noderev->copyroot_rev = parent_noderev->copyroot_rev;
noderev->copyroot_path = apr_pstrdup(pool,
parent_noderev->copyroot_path);
@@ -714,6 +709,7 @@ svn_fs_fs__dag_clone_child(dag_node_t **
}
/* Initialize the youngster. */
+ svn_pool_destroy(subpool);
return svn_fs_fs__dag_get_node(child_p, fs, new_node_id, pool);
}
@@ -778,7 +774,7 @@ svn_fs_fs__dag_delete(dag_node_t *parent
"Attempted to delete a node with an illegal name '%s'", name);
/* Get a fresh NODE-REVISION for the parent node. */
- SVN_ERR(get_node_revision(&parent_noderev, parent, pool));
+ SVN_ERR(get_node_revision(&parent_noderev, parent));
subpool = svn_pool_create(pool);
@@ -851,7 +847,7 @@ svn_fs_fs__dag_delete_if_mutable(svn_fs_
apr_hash_index_t *hi;
/* Loop over hash entries */
- SVN_ERR(svn_fs_fs__dag_dir_entries(&entries, node, pool, pool));
+ SVN_ERR(svn_fs_fs__dag_dir_entries(&entries, node, pool));
if (entries)
{
for (hi = apr_hash_first(pool, entries);
@@ -912,7 +908,7 @@ svn_fs_fs__dag_get_contents(svn_stream_t
"Attempted to get textual contents of a *non*-file node");
/* Go get a fresh node-revision for FILE. */
- SVN_ERR(get_node_revision(&noderev, file, pool));
+ SVN_ERR(get_node_revision(&noderev, file));
/* Get a stream to the contents. */
SVN_ERR(svn_fs_fs__get_contents(&contents, file->fs,
@@ -942,10 +938,10 @@ svn_fs_fs__dag_get_file_delta_stream(svn
/* Go get fresh node-revisions for the nodes. */
if (source)
- SVN_ERR(get_node_revision(&src_noderev, source, pool));
+ SVN_ERR(get_node_revision(&src_noderev, source));
else
src_noderev = NULL;
- SVN_ERR(get_node_revision(&tgt_noderev, target, pool));
+ SVN_ERR(get_node_revision(&tgt_noderev, target));
/* Get the delta stream. */
return svn_fs_fs__get_file_delta_stream(stream_p, target->fs,
@@ -967,7 +963,7 @@ svn_fs_fs__dag_file_length(svn_filesize_
"Attempted to get length of a *non*-file node");
/* Go get a fresh node-revision for FILE, and . */
- SVN_ERR(get_node_revision(&noderev, file, pool));
+ SVN_ERR(get_node_revision(&noderev, file));
return svn_fs_fs__file_length(length, noderev, pool);
}
@@ -986,7 +982,7 @@ svn_fs_fs__dag_file_checksum(svn_checksu
(SVN_ERR_FS_NOT_FILE, NULL,
"Attempted to get checksum of a *non*-file node");
- SVN_ERR(get_node_revision(&noderev, file, pool));
+ SVN_ERR(get_node_revision(&noderev, file));
return svn_fs_fs__file_checksum(checksum, noderev, kind, pool);
}
@@ -1013,7 +1009,7 @@ svn_fs_fs__dag_get_edit_stream(svn_strea
"Attempted to set textual contents of an immutable node");
/* Get the node revision. */
- SVN_ERR(get_node_revision(&noderev, file, pool));
+ SVN_ERR(get_node_revision(&noderev, file));
SVN_ERR(svn_fs_fs__set_contents(&ws, file->fs, noderev, pool));
@@ -1066,6 +1062,8 @@ svn_fs_fs__dag_dup(const dag_node_t *nod
new_node->node_revision->is_fresh_txn_root =
node->node_revision->is_fresh_txn_root;
}
+ new_node->node_pool = pool;
+
return new_node;
}
@@ -1092,6 +1090,10 @@ svn_fs_fs__dag_serialize(char **data,
svn_temp_serializer__set_null(context,
(const void * const *)&node->node_revision);
+ /* The deserializer will use its own pool. */
+ svn_temp_serializer__set_null(context,
+ (const void * const *)&node->node_pool);
+
/* serialize other sub-structures */
svn_fs_fs__id_serialize(context, (const svn_fs_id_t **)&node->id);
svn_fs_fs__id_serialize(context, &node->fresh_root_predecessor_id);
@@ -1124,6 +1126,7 @@ svn_fs_fs__dag_deserialize(void **out,
svn_fs_fs__id_deserialize(node,
(svn_fs_id_t **)&node->fresh_root_predecessor_id);
svn_fs_fs__noderev_deserialize(node, &node->node_revision);
+ node->node_pool = pool;
svn_temp_deserializer__resolve(node, (void**)&node->created_path);
@@ -1137,12 +1140,14 @@ svn_error_t *
svn_fs_fs__dag_open(dag_node_t **child_p,
dag_node_t *parent,
const char *name,
- apr_pool_t *pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
const svn_fs_id_t *node_id;
/* Ensure that NAME exists in PARENT's entry list. */
- SVN_ERR(dir_entry_id_from_node(&node_id, parent, name, pool));
+ SVN_ERR(dir_entry_id_from_node(&node_id, parent, name,
+ scratch_pool, scratch_pool));
if (! node_id)
return svn_error_createf
(SVN_ERR_FS_NOT_FOUND, NULL,
@@ -1156,7 +1161,7 @@ svn_fs_fs__dag_open(dag_node_t **child_p
/* Now get the node that was requested. */
return svn_fs_fs__dag_get_node(child_p, svn_fs_fs__dag_get_fs(parent),
- node_id, pool);
+ node_id, result_pool);
}
@@ -1180,7 +1185,7 @@ svn_fs_fs__dag_copy(dag_node_t *to_node,
svn_fs_t *fs = svn_fs_fs__dag_get_fs(from_node);
/* Make a copy of the original node revision. */
- SVN_ERR(get_node_revision(&from_noderev, from_node, pool));
+ SVN_ERR(get_node_revision(&from_noderev, from_node));
to_noderev = copy_node_revision(from_noderev, pool);
/* Reserve a copy ID for this new copy. */
@@ -1222,8 +1227,7 @@ svn_error_t *
svn_fs_fs__dag_things_different(svn_boolean_t *props_changed,
svn_boolean_t *contents_changed,
dag_node_t *node1,
- dag_node_t *node2,
- apr_pool_t *pool)
+ dag_node_t *node2)
{
node_revision_t *noderev1, *noderev2;
@@ -1233,8 +1237,8 @@ svn_fs_fs__dag_things_different(svn_bool
return SVN_NO_ERROR;
/* The node revision skels for these two nodes. */
- SVN_ERR(get_node_revision(&noderev1, node1, pool));
- SVN_ERR(get_node_revision(&noderev2, node2, pool));
+ SVN_ERR(get_node_revision(&noderev1, node1));
+ SVN_ERR(get_node_revision(&noderev2, node2));
/* Compare property keys. */
if (props_changed != NULL)
@@ -1253,13 +1257,12 @@ svn_fs_fs__dag_things_different(svn_bool
svn_error_t *
svn_fs_fs__dag_get_copyroot(svn_revnum_t *rev,
const char **path,
- dag_node_t *node,
- apr_pool_t *pool)
+ dag_node_t *node)
{
node_revision_t *noderev;
/* Go get a fresh node-revision for NODE. */
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
*rev = noderev->copyroot_rev;
*path = noderev->copyroot_path;
@@ -1269,13 +1272,12 @@ svn_fs_fs__dag_get_copyroot(svn_revnum_t
svn_error_t *
svn_fs_fs__dag_get_copyfrom_rev(svn_revnum_t *rev,
- dag_node_t *node,
- apr_pool_t *pool)
+ dag_node_t *node)
{
node_revision_t *noderev;
/* Go get a fresh node-revision for NODE. */
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
*rev = noderev->copyfrom_rev;
@@ -1284,13 +1286,12 @@ svn_fs_fs__dag_get_copyfrom_rev(svn_revn
svn_error_t *
svn_fs_fs__dag_get_copyfrom_path(const char **path,
- dag_node_t *node,
- apr_pool_t *pool)
+ dag_node_t *node)
{
node_revision_t *noderev;
/* Go get a fresh node-revision for NODE. */
- SVN_ERR(get_node_revision(&noderev, node, pool));
+ SVN_ERR(get_node_revision(&noderev, node));
*path = noderev->copyfrom_path;
@@ -1309,8 +1310,8 @@ svn_fs_fs__dag_update_ancestry(dag_node_
(SVN_ERR_FS_NOT_MUTABLE, NULL,
_("Attempted to update ancestry of non-mutable node"));
- SVN_ERR(get_node_revision(&source_noderev, source, pool));
- SVN_ERR(get_node_revision(&target_noderev, target, pool));
+ SVN_ERR(get_node_revision(&source_noderev, source));
+ SVN_ERR(get_node_revision(&target_noderev, target));
target_noderev->predecessor_id = source->id;
target_noderev->predecessor_count = source_noderev->predecessor_count;
Modified: subversion/trunk/subversion/libsvn_fs_fs/dag.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.h?rev=1305396&r1=1305395&r2=1305396&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.h Mon Mar 26 15:26:03 2012
@@ -121,58 +121,39 @@ const char *svn_fs_fs__dag_get_created_p
/* Set *ID_P to the node revision ID of NODE's immediate predecessor,
- or NULL if NODE has no predecessor, allocating from POOL.
-
- Use POOL for all allocations, including to cache the node_revision in
- NODE.
+ or NULL if NODE has no predecessor.
*/
svn_error_t *svn_fs_fs__dag_get_predecessor_id(const svn_fs_id_t **id_p,
- dag_node_t *node,
- apr_pool_t *pool);
+ dag_node_t *node);
/* Set *COUNT to the number of predecessors NODE has (recursively), or
- -1 if not known, allocating from POOL.
-
- Use POOL for all allocations, including to cache the node_revision in
- NODE.
+ -1 if not known.
*/
+/* ### This function is currently only used by 'verify'. */
svn_error_t *svn_fs_fs__dag_get_predecessor_count(int *count,
- dag_node_t *node,
- apr_pool_t *pool);
+ dag_node_t *node);
/* Set *COUNT to the number of node under NODE (inclusive) with
- svn:mergeinfo properties, allocating from POOL.
-
- Use POOL for all allocations, including to cache the node_revision in
- NODE.
+ svn:mergeinfo properties.
*/
svn_error_t *svn_fs_fs__dag_get_mergeinfo_count(apr_int64_t *count,
- dag_node_t *node,
- apr_pool_t *pool);
+ dag_node_t *node);
/* Set *DO_THEY to a flag indicating whether or not NODE is a
directory with at least one descendant (not including itself) with
svn:mergeinfo.
-
- Use POOL for all allocations, including to cache the node_revision in
- NODE.
*/
svn_error_t *
svn_fs_fs__dag_has_descendants_with_mergeinfo(svn_boolean_t *do_they,
- dag_node_t *node,
- apr_pool_t *pool);
+ dag_node_t *node);
/* Set *HAS_MERGEINFO to a flag indicating whether or not NODE itself
has svn:mergeinfo set on it.
-
- Use POOL for all allocations, including to cache the node_revision in
- NODE.
*/
svn_error_t *
svn_fs_fs__dag_has_mergeinfo(svn_boolean_t *has_mergeinfo,
- dag_node_t *node,
- apr_pool_t *pool);
+ dag_node_t *node);
/* Return non-zero IFF NODE is currently mutable. */
svn_boolean_t svn_fs_fs__dag_check_mutable(const dag_node_t *node);
@@ -188,8 +169,7 @@ svn_node_kind_t svn_fs_fs__dag_node_kind
If properties do not exist on NODE, *PROPLIST_P will be set to
NULL.
- Use POOL for all allocations, including to cache the node_revision in
- NODE.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_get_proplist(apr_hash_t **proplist_p,
dag_node_t *node,
@@ -198,8 +178,7 @@ svn_error_t *svn_fs_fs__dag_get_proplist
/* Set the property list of NODE to PROPLIST, allocating from POOL.
The node being changed must be mutable.
- Use POOL for all allocations, including to cache the node_revision in
- NODE.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_set_proplist(dag_node_t *node,
apr_hash_t *proplist,
@@ -208,8 +187,7 @@ svn_error_t *svn_fs_fs__dag_set_proplist
/* Increment the mergeinfo_count field on NODE by INCREMENT. The node
being changed must be mutable.
- Use POOL for all allocations, including to cache the node_revision in
- NODE.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_increment_mergeinfo_count(dag_node_t *node,
apr_int64_t increment,
@@ -218,8 +196,7 @@ svn_error_t *svn_fs_fs__dag_increment_me
/* Set the has-mergeinfo flag on NODE to HAS_MERGEINFO. The node
being changed must be mutable.
- Use POOL for all allocations, including to cache the node_revision in
- NODE.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_set_has_mergeinfo(dag_node_t *node,
svn_boolean_t has_mergeinfo,
@@ -274,40 +251,35 @@ svn_error_t *svn_fs_fs__dag_clone_root(d
/* Open the node named NAME in the directory PARENT. Set *CHILD_P to
- the new node, allocated in POOL. NAME must be a single path
+ the new node, allocated in RESULT_POOL. NAME must be a single path
component; it cannot be a slash-separated directory path.
-
- Use POOL for all allocations, including to cache the node_revision in
- PARENT.
*/
-svn_error_t *svn_fs_fs__dag_open(dag_node_t **child_p,
- dag_node_t *parent,
- const char *name,
- apr_pool_t *pool);
+svn_error_t *
+svn_fs_fs__dag_open(dag_node_t **child_p,
+ dag_node_t *parent,
+ const char *name,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/* Set *ENTRIES_P to a hash table of NODE's entries. The keys of the
table are entry names, and the values are svn_fs_dirent_t's. The
returned table (and its keys and values) is allocated in POOL,
- which is also used for temporary allocations. NODE_POOL is used
- for any allocation of memory that needs to live as long as NODE
- lives. */
+ which is also used for temporary allocations. */
svn_error_t *svn_fs_fs__dag_dir_entries(apr_hash_t **entries_p,
dag_node_t *node,
- apr_pool_t *pool,
- apr_pool_t *node_pool);
+ apr_pool_t *pool);
/* Fetches the NODE's entries and returns a copy of the entry selected
by the key value given in NAME and set *DIRENT to a copy of that
entry. If such entry was found, the copy will be allocated in POOL.
- Otherwise, the *DIRENT will be set to NULL. NODE_POOL is used for
- any allocation of memory that needs to live as long as NODE lives.
+ Otherwise, the *DIRENT will be set to NULL.
*/
+/* ### This function is currently only called from dag.c. */
svn_error_t * svn_fs_fs__dag_dir_entry(svn_fs_dirent_t **dirent,
dag_node_t *node,
const char* name,
- apr_pool_t *pool,
- apr_pool_t *node_pool);
+ apr_pool_t *pool);
/* Set ENTRY_NAME in NODE to point to ID (with kind KIND), allocating
from POOL. NODE must be a mutable directory. ID can refer to a
@@ -343,8 +315,7 @@ svn_error_t *svn_fs_fs__dag_set_entry(da
TXN_ID is the Subversion transaction under which this occurs.
- Use POOL for all allocations, including to cache the node_revision in
- FILE.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_clone_child(dag_node_t **child_p,
dag_node_t *parent,
@@ -366,8 +337,7 @@ svn_error_t *svn_fs_fs__dag_clone_child(
If return SVN_ERR_FS_NO_SUCH_ENTRY, then there is no entry NAME in
PARENT.
- Use POOL for all allocations, including to cache the node_revision in
- FILE.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_delete(dag_node_t *parent,
const char *name,
@@ -408,8 +378,7 @@ svn_error_t *svn_fs_fs__dag_delete_if_mu
not currently have an entry named NAME. TXN_ID is the Subversion
transaction under which this occurs.
- Use POOL for all allocations, including to cache the node_revision in
- PARENT.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_make_dir(dag_node_t **child_p,
dag_node_t *parent,
@@ -428,8 +397,7 @@ svn_error_t *svn_fs_fs__dag_make_dir(dag
If FILE is not a file, return SVN_ERR_FS_NOT_FILE.
- Use POOL for all allocations, including to cache the node_revision in
- FILE.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_get_contents(svn_stream_t **contents,
dag_node_t *file,
@@ -440,8 +408,7 @@ svn_error_t *svn_fs_fs__dag_get_contents
the contents of TARGET, allocated in POOL. If SOURCE is null, the empty
string will be used.
- Use POOL for all allocations, including to cache the node_revision in
- SOURCE and TARGET.
+ Use POOL for all allocations.
*/
svn_error_t *
svn_fs_fs__dag_get_file_delta_stream(svn_txdelta_stream_t **stream_p,
@@ -455,8 +422,7 @@ svn_fs_fs__dag_get_file_delta_stream(svn
Any previous edits on the file will be deleted, and a new edit
stream will be constructed.
- Use POOL for all allocations, including to cache the node_revision in
- FILE.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_get_edit_stream(svn_stream_t **contents,
dag_node_t *file,
@@ -482,8 +448,7 @@ svn_error_t *svn_fs_fs__dag_finalize_edi
/* Set *LENGTH to the length of the contents of FILE.
- Use POOL for all allocations, including to cache the node_revision in
- FILE.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_file_length(svn_filesize_t *length,
dag_node_t *file,
@@ -495,8 +460,7 @@ svn_error_t *svn_fs_fs__dag_file_length(
If no stored checksum is available, do not calculate the checksum,
just put NULL into CHECKSUM.
- Use POOL for all allocations, including to cache the node_revision in
- FILE.
+ Use POOL for all allocations.
*/
svn_error_t *
svn_fs_fs__dag_file_checksum(svn_checksum_t **checksum,
@@ -512,8 +476,7 @@ svn_fs_fs__dag_file_checksum(svn_checksu
canonicalized absolute path of the parent directory. TXN_ID is the
Subversion transaction under which this occurs.
- Use POOL for all allocations, including to cache the node_revision in
- PARENT.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_make_file(dag_node_t **child_p,
dag_node_t *parent,
@@ -538,8 +501,7 @@ svn_error_t *svn_fs_fs__dag_make_file(da
If PRESERVE_HISTORY is false, FROM_PATH and FROM_REV are ignored.
- Use POOL for all allocations, including to cache the node_revision in
- FROM_NODE.
+ Use POOL for all allocations.
*/
svn_error_t *svn_fs_fs__dag_copy(dag_node_t *to_node,
const char *entry,
@@ -569,39 +531,29 @@ svn_error_t *svn_fs_fs__dag_copy(dag_nod
may leave us with a slight chance of a false positive, though I
don't really see how that would happen in practice. Nevertheless,
it should probably be fixed.
-
- Use POOL for all allocations, including to cache the node_revision in NODE1
- and NODE2.
*/
svn_error_t *svn_fs_fs__dag_things_different(svn_boolean_t *props_changed,
svn_boolean_t *contents_changed,
dag_node_t *node1,
- dag_node_t *node2,
- apr_pool_t *pool);
+ dag_node_t *node2);
/* Set *REV and *PATH to the copyroot revision and path of node NODE, or
to SVN_INVALID_REVNUM and NULL if no copyroot exists.
- Use POOL for all allocations, including to cache the node_revision in NODE.
*/
svn_error_t *svn_fs_fs__dag_get_copyroot(svn_revnum_t *rev,
const char **path,
- dag_node_t *node,
- apr_pool_t *pool);
+ dag_node_t *node);
/* Set *REV to the copyfrom revision associated with NODE.
- Use POOL for all allocations, including to cache the node_revision in NODE.
*/
svn_error_t *svn_fs_fs__dag_get_copyfrom_rev(svn_revnum_t *rev,
- dag_node_t *node,
- apr_pool_t *pool);
+ dag_node_t *node);
/* Set *PATH to the copyfrom path associated with NODE.
- Use POOL for all allocations, including to cache the node_revision in NODE.
*/
svn_error_t *svn_fs_fs__dag_get_copyfrom_path(const char **path,
- dag_node_t *node,
- apr_pool_t *pool);
+ dag_node_t *node);
/* Update *TARGET so that SOURCE is it's predecessor.
*/
Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1305396&r1=1305395&r2=1305396&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Mon Mar 26 15:26:03 2012
@@ -5002,6 +5002,7 @@ svn_fs_fs__set_entry(svn_fs_t *fs,
apr_file_t *file;
svn_stream_t *out;
fs_fs_data_t *ffd = fs->fsap_data;
+ apr_pool_t *subpool = svn_pool_create(pool);
if (!rep || !rep->txn_id)
{
@@ -5009,7 +5010,8 @@ svn_fs_fs__set_entry(svn_fs_t *fs,
{
apr_hash_t *entries;
- apr_pool_t *subpool = svn_pool_create(pool);
+
+ svn_pool_clear(subpool);
/* Before we can modify the directory, we need to dump its old
contents into a mutable representation file. */
@@ -5022,7 +5024,7 @@ svn_fs_fs__set_entry(svn_fs_t *fs,
out = svn_stream_from_aprfile2(file, TRUE, pool);
SVN_ERR(svn_hash_write2(entries, out, SVN_HASH_TERMINATOR, subpool));
- svn_pool_destroy(subpool);
+ svn_pool_clear(subpool);
}
/* Mark the node-rev's data rep as mutable. */
@@ -5044,10 +5046,9 @@ svn_fs_fs__set_entry(svn_fs_t *fs,
}
/* if we have a directory cache for this transaction, update it */
+ svn_pool_clear(subpool);
if (ffd->txn_dir_cache)
{
- apr_pool_t *subpool = svn_pool_create(pool);
-
/* build parameters: (name, new entry) pair */
const char *key =
svn_fs_fs__id_unparse(parent_noderev->id, subpool)->data;
@@ -5065,27 +5066,28 @@ svn_fs_fs__set_entry(svn_fs_t *fs,
SVN_ERR(svn_cache__set_partial(ffd->txn_dir_cache, key,
svn_fs_fs__replace_dir_entry, &baton,
subpool));
-
- svn_pool_destroy(subpool);
}
+ svn_pool_clear(subpool);
/* Append an incremental hash entry for the entry change. */
if (id)
{
- const char *val = unparse_dir_entry(kind, id, pool);
+ const char *val = unparse_dir_entry(kind, id, subpool);
- SVN_ERR(svn_stream_printf(out, pool, "K %" APR_SIZE_T_FMT "\n%s\n"
+ SVN_ERR(svn_stream_printf(out, subpool, "K %" APR_SIZE_T_FMT "\n%s\n"
"V %" APR_SIZE_T_FMT "\n%s\n",
strlen(name), name,
strlen(val), val));
}
else
{
- SVN_ERR(svn_stream_printf(out, pool, "D %" APR_SIZE_T_FMT "\n%s\n",
+ SVN_ERR(svn_stream_printf(out, subpool, "D %" APR_SIZE_T_FMT "\n%s\n",
strlen(name), name));
}
- return svn_io_file_close(file, pool);
+ SVN_ERR(svn_io_file_close(file, subpool));
+ svn_pool_destroy(subpool);
+ return SVN_NO_ERROR;
}
/* Write a single change entry, path PATH, change CHANGE, and copyfrom
Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1305396&r1=1305395&r2=1305396&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Mon Mar 26 15:26:03 2012
@@ -502,7 +502,7 @@ get_copy_inheritance(copy_id_inherit_t *
or if it is a branch point that we are accessing via its original
copy destination path. */
SVN_ERR(svn_fs_fs__dag_get_copyroot(©root_rev, ©root_path,
- child->node,pool));
+ child->node));
SVN_ERR(svn_fs_fs__revision_root(©root_root, fs, copyroot_rev, pool));
SVN_ERR(get_dag(©root_node, copyroot_root, copyroot_path, pool));
copyroot_id = svn_fs_fs__dag_get_id(copyroot_node);
@@ -594,6 +594,7 @@ open_path(parent_path_t **parent_path_p,
const char *rest; /* The portion of PATH we haven't traversed yet. */
const char *canon_path = svn_fs__canonicalize_abspath(path, pool);
const char *path_so_far = "/";
+ apr_pool_t *iterpool = svn_pool_create(pool);
/* Make a parent_path item for the root node, using its own current
copy id. */
@@ -614,6 +615,8 @@ open_path(parent_path_t **parent_path_p,
char *entry;
dag_node_t *child;
+ svn_pool_clear(iterpool);
+
/* Parse out the next entry from the path. */
entry = svn_fs__next_entry_name(&next, rest, pool);
@@ -642,7 +645,7 @@ open_path(parent_path_t **parent_path_p,
if (cached_node)
child = cached_node;
else
- err = svn_fs_fs__dag_open(&child, here, entry, pool);
+ err = svn_fs_fs__dag_open(&child, here, entry, pool, iterpool);
/* "file not found" requires special handling. */
if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
@@ -676,14 +679,14 @@ open_path(parent_path_t **parent_path_p,
if (txn_id)
{
SVN_ERR(get_copy_inheritance(&inherit, ©_path,
- fs, parent_path, txn_id, pool));
+ fs, parent_path, txn_id, iterpool));
parent_path->copy_inherit = inherit;
parent_path->copy_src_path = apr_pstrdup(pool, copy_path);
}
/* Cache the node we found (if it wasn't already cached). */
if (! cached_node)
- SVN_ERR(dag_node_cache_set(root, path_so_far, child, pool));
+ SVN_ERR(dag_node_cache_set(root, path_so_far, child, iterpool));
}
/* Are we finished traversing the path? */
@@ -692,13 +695,14 @@ open_path(parent_path_t **parent_path_p,
/* The path isn't finished yet; we'd better be in a directory. */
if (svn_fs_fs__dag_node_kind(child) != svn_node_dir)
- SVN_ERR_W(SVN_FS__ERR_NOT_DIRECTORY(fs, path_so_far, pool),
- apr_psprintf(pool, _("Failure opening '%s'"), path));
+ SVN_ERR_W(SVN_FS__ERR_NOT_DIRECTORY(fs, path_so_far, iterpool),
+ apr_psprintf(iterpool, _("Failure opening '%s'"), path));
rest = next;
here = child;
}
+ svn_pool_destroy(iterpool);
*parent_path_p = parent_path;
return SVN_NO_ERROR;
}
@@ -763,7 +767,7 @@ make_path_mutable(svn_fs_root_t *root,
/* Determine what copyroot our new child node should use. */
SVN_ERR(svn_fs_fs__dag_get_copyroot(©root_rev, ©root_path,
- parent_path->node, pool));
+ parent_path->node));
SVN_ERR(svn_fs_fs__revision_root(©root_root, root->fs,
copyroot_rev, pool));
SVN_ERR(get_dag(©root_node, copyroot_root, copyroot_path, pool));
@@ -1072,8 +1076,7 @@ fs_change_node_prop(svn_fs_root_t *root,
{
apr_int64_t increment = 0;
svn_boolean_t had_mergeinfo;
- SVN_ERR(svn_fs_fs__dag_has_mergeinfo(&had_mergeinfo, parent_path->node,
- pool));
+ SVN_ERR(svn_fs_fs__dag_has_mergeinfo(&had_mergeinfo, parent_path->node));
if (value && !had_mergeinfo)
increment = 1;
@@ -1127,7 +1130,7 @@ fs_props_changed(svn_boolean_t *changed_
SVN_ERR(get_dag(&node1, root1, path1, pool));
SVN_ERR(get_dag(&node2, root2, path2, pool));
return svn_fs_fs__dag_things_different(changed_p, NULL,
- node1, node2, pool);
+ node1, node2);
}
@@ -1337,9 +1340,9 @@ merge(svn_stringbuf_t *conflict_p,
/* ### todo: it would be more efficient to simply check for a NULL
entries hash where necessary below than to allocate an empty hash
here, but another day, another day... */
- SVN_ERR(svn_fs_fs__dag_dir_entries(&s_entries, source, pool, pool));
- SVN_ERR(svn_fs_fs__dag_dir_entries(&t_entries, target, pool, pool));
- SVN_ERR(svn_fs_fs__dag_dir_entries(&a_entries, ancestor, pool, pool));
+ SVN_ERR(svn_fs_fs__dag_dir_entries(&s_entries, source, pool));
+ SVN_ERR(svn_fs_fs__dag_dir_entries(&t_entries, target, pool));
+ SVN_ERR(svn_fs_fs__dag_dir_entries(&a_entries, ancestor, pool));
/* for each entry E in a_entries... */
iterpool = svn_pool_create(pool);
@@ -1376,8 +1379,7 @@ merge(svn_stringbuf_t *conflict_p,
{
apr_int64_t mergeinfo_start;
SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&mergeinfo_start,
- t_ent_node,
- iterpool));
+ t_ent_node));
mergeinfo_increment -= mergeinfo_start;
}
@@ -1391,8 +1393,7 @@ merge(svn_stringbuf_t *conflict_p,
{
apr_int64_t mergeinfo_end;
SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&mergeinfo_end,
- s_ent_node,
- iterpool));
+ s_ent_node));
mergeinfo_increment += mergeinfo_end;
}
@@ -1505,8 +1506,7 @@ merge(svn_stringbuf_t *conflict_p,
{
apr_int64_t mergeinfo_s;
SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&mergeinfo_s,
- s_ent_node,
- iterpool));
+ s_ent_node));
mergeinfo_increment += mergeinfo_s;
}
@@ -1803,7 +1803,7 @@ fs_dir_entries(apr_hash_t **table_p,
/* Get the entries for this path in the caller's pool. */
SVN_ERR(get_dag(&node, root, path, pool));
- return svn_fs_fs__dag_dir_entries(table_p, node, pool, pool);
+ return svn_fs_fs__dag_dir_entries(table_p, node, pool);
}
@@ -1889,8 +1889,7 @@ fs_delete_node(svn_fs_root_t *root,
SVN_ERR(make_path_mutable(root, parent_path->parent, path, pool));
if (svn_fs_fs__fs_supports_mergeinfo(root->fs))
SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&mergeinfo_count,
- parent_path->node,
- pool));
+ parent_path->node));
SVN_ERR(svn_fs_fs__dag_delete(parent_path->parent->node,
parent_path->entry,
txn_id, pool));
@@ -2005,8 +2004,7 @@ copy_helper(svn_fs_root_t *from_root,
kind = svn_fs_path_change_replace;
if (svn_fs_fs__fs_supports_mergeinfo(to_root->fs))
SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&mergeinfo_start,
- to_parent_path->node,
- pool));
+ to_parent_path->node));
}
else
{
@@ -2016,7 +2014,7 @@ copy_helper(svn_fs_root_t *from_root,
if (svn_fs_fs__fs_supports_mergeinfo(to_root->fs))
SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&mergeinfo_end,
- from_node, pool));
+ from_node));
/* Make sure the target node's parents are mutable. */
SVN_ERR(make_path_mutable(to_root, to_parent_path->parent,
@@ -2149,8 +2147,8 @@ fs_copied_from(svn_revnum_t *rev_p,
/* There is no cached entry, look it up the old-fashioned
way. */
SVN_ERR(get_dag(&node, root, path, pool));
- SVN_ERR(svn_fs_fs__dag_get_copyfrom_rev(©from_rev, node, pool));
- SVN_ERR(svn_fs_fs__dag_get_copyfrom_path(©from_path, node, pool));
+ SVN_ERR(svn_fs_fs__dag_get_copyfrom_rev(©from_rev, node));
+ SVN_ERR(svn_fs_fs__dag_get_copyfrom_path(©from_path, node));
}
*rev_p = copyfrom_rev;
@@ -2660,7 +2658,7 @@ fs_contents_changed(svn_boolean_t *chang
SVN_ERR(get_dag(&node1, root1, path1, pool));
SVN_ERR(get_dag(&node2, root2, path2, pool));
return svn_fs_fs__dag_things_different(NULL, changed_p,
- node1, node2, pool);
+ node1, node2);
}
@@ -2792,7 +2790,7 @@ find_youngest_copyroot(svn_revnum_t *rev
/* Find our copyroot. */
SVN_ERR(svn_fs_fs__dag_get_copyroot(&rev_mine, &path_mine,
- parent_path->node, pool));
+ parent_path->node));
/* If a parent and child were copied to in the same revision, prefer
the child copy target, since it is the copy relevant to the
@@ -2872,7 +2870,7 @@ static svn_error_t *fs_closest_copy(svn_
if (created_rev == copy_dst_rev)
{
const svn_fs_id_t *pred;
- SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred, copy_dst_node, pool));
+ SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred, copy_dst_node));
if (! pred)
return SVN_NO_ERROR;
}
@@ -3033,7 +3031,7 @@ fs_node_origin_rev(svn_revnum_t *revisio
value cached in the node (which is allocated in
SUBPOOL... maybe). */
svn_pool_clear(predidpool);
- SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred_id, node, subpool));
+ SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred_id, node));
pred_id = pred_id ? svn_fs_fs__id_copy(pred_id, predidpool) : NULL;
}
while (pred_id);
@@ -3135,7 +3133,7 @@ history_prev(void *baton, apr_pool_t *po
no predecessor, in which case we're all done!). */
const svn_fs_id_t *pred_id;
- SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred_id, node, pool));
+ SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred_id, node));
if (! pred_id)
return SVN_NO_ERROR;
@@ -3183,8 +3181,8 @@ history_prev(void *baton, apr_pool_t *po
/* If we get here, then our current path is the destination
of, or the child of the destination of, a copy. Fill
in the return values and get outta here. */
- SVN_ERR(svn_fs_fs__dag_get_copyfrom_rev(&src_rev, node, pool));
- SVN_ERR(svn_fs_fs__dag_get_copyfrom_path(©_src, node, pool));
+ SVN_ERR(svn_fs_fs__dag_get_copyfrom_rev(&src_rev, node));
+ SVN_ERR(svn_fs_fs__dag_get_copyfrom_path(©_src, node));
dst_rev = copyroot_rev;
src_path = svn_fspath__join(copy_src, remainder_path, pool);
@@ -3348,7 +3346,7 @@ crawl_directory_dag_for_mergeinfo(svn_fs
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
SVN_ERR(svn_fs_fs__dag_dir_entries(&entries, dir_dag,
- scratch_pool, scratch_pool));
+ scratch_pool));
for (hi = apr_hash_first(scratch_pool, entries);
hi;
@@ -3364,9 +3362,8 @@ crawl_directory_dag_for_mergeinfo(svn_fs
kid_path = svn_fspath__join(this_path, dirent->name, iterpool);
SVN_ERR(get_dag(&kid_dag, root, kid_path, iterpool));
- SVN_ERR(svn_fs_fs__dag_has_mergeinfo(&has_mergeinfo, kid_dag, iterpool));
- SVN_ERR(svn_fs_fs__dag_has_descendants_with_mergeinfo(&go_down, kid_dag,
- iterpool));
+ SVN_ERR(svn_fs_fs__dag_has_mergeinfo(&has_mergeinfo, kid_dag));
+ SVN_ERR(svn_fs_fs__dag_has_descendants_with_mergeinfo(&go_down, kid_dag));
if (has_mergeinfo)
{
@@ -3441,7 +3438,6 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
parent_path_t *parent_path, *nearest_ancestor;
apr_hash_t *proplist;
svn_string_t *mergeinfo_string;
- apr_pool_t *iterpool = svn_pool_create(scratch_pool);
*mergeinfo = NULL;
@@ -3461,17 +3457,14 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
{
svn_boolean_t has_mergeinfo;
- svn_pool_clear(iterpool);
-
SVN_ERR(svn_fs_fs__dag_has_mergeinfo(&has_mergeinfo,
- nearest_ancestor->node, iterpool));
+ nearest_ancestor->node));
if (has_mergeinfo)
break;
/* No need to loop if we're looking for explicit mergeinfo. */
if (inherit == svn_mergeinfo_explicit)
{
- svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -3480,13 +3473,10 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
/* Run out? There's no mergeinfo. */
if (!nearest_ancestor)
{
- svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
}
- svn_pool_destroy(iterpool);
-
SVN_ERR(svn_fs_fs__dag_get_proplist(&proplist, nearest_ancestor->node,
scratch_pool));
mergeinfo_string = apr_hash_get(proplist, SVN_PROP_MERGEINFO,
@@ -3554,8 +3544,7 @@ add_descendant_mergeinfo(svn_mergeinfo_c
SVN_ERR(get_dag(&this_dag, root, path, scratch_pool));
SVN_ERR(svn_fs_fs__dag_has_descendants_with_mergeinfo(&go_down,
- this_dag,
- scratch_pool));
+ this_dag));
if (go_down)
SVN_ERR(crawl_directory_dag_for_mergeinfo(root,
path,
@@ -3788,8 +3777,7 @@ stringify_node(dag_node_t *node,
static svn_error_t *
verify_node(dag_node_t *node,
svn_revnum_t rev,
- apr_pool_t *pool,
- apr_pool_t *node_pool)
+ apr_pool_t *pool)
{
svn_boolean_t has_mergeinfo;
apr_int64_t mergeinfo_count;
@@ -3800,10 +3788,10 @@ verify_node(dag_node_t *node,
apr_pool_t *iterpool = svn_pool_create(pool);
/* Fetch some data. */
- SVN_ERR(svn_fs_fs__dag_has_mergeinfo(&has_mergeinfo, node, node_pool));
- SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&mergeinfo_count, node, node_pool));
- SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred_id, node, node_pool));
- SVN_ERR(svn_fs_fs__dag_get_predecessor_count(&pred_count, node, node_pool));
+ SVN_ERR(svn_fs_fs__dag_has_mergeinfo(&has_mergeinfo, node));
+ SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&mergeinfo_count, node));
+ SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred_id, node));
+ SVN_ERR(svn_fs_fs__dag_get_predecessor_count(&pred_count, node));
kind = svn_fs_fs__dag_node_kind(node);
/* Sanity check. */
@@ -3819,8 +3807,7 @@ verify_node(dag_node_t *node,
dag_node_t *pred;
int pred_pred_count;
SVN_ERR(svn_fs_fs__dag_get_node(&pred, fs, pred_id, iterpool));
- SVN_ERR(svn_fs_fs__dag_get_predecessor_count(&pred_pred_count, pred,
- iterpool));
+ SVN_ERR(svn_fs_fs__dag_get_predecessor_count(&pred_pred_count, pred));
if (pred_pred_count+1 != pred_count)
return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
"Predecessor count mismatch: "
@@ -3852,7 +3839,7 @@ verify_node(dag_node_t *node,
apr_hash_index_t *hi;
apr_int64_t children_mergeinfo = 0;
- SVN_ERR(svn_fs_fs__dag_dir_entries(&entries, node, pool, node_pool));
+ SVN_ERR(svn_fs_fs__dag_dir_entries(&entries, node, pool));
/* Compute CHILDREN_MERGEINFO. */
for (hi = apr_hash_first(pool, entries);
@@ -3871,10 +3858,9 @@ verify_node(dag_node_t *node,
SVN_ERR(svn_fs_fs__dag_get_revision(&child_rev, child, iterpool));
if (child_rev == rev)
- SVN_ERR(verify_node(child, rev, iterpool, iterpool));
+ SVN_ERR(verify_node(child, rev, iterpool));
- SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&child_mergeinfo, child,
- iterpool));
+ SVN_ERR(svn_fs_fs__dag_get_mergeinfo_count(&child_mergeinfo, child));
children_mergeinfo += child_mergeinfo;
}
@@ -3905,7 +3891,7 @@ svn_fs_fs__verify_root(svn_fs_root_t *ro
frd = root->fsap_data;
/* Recursively verify ROOT_DIR. */
- SVN_ERR(verify_node(frd->root_dir, root->rev, pool, pool));
+ SVN_ERR(verify_node(frd->root_dir, root->rev, pool));
/* Verify explicitly the predecessor of the root. */
{
@@ -3914,7 +3900,7 @@ svn_fs_fs__verify_root(svn_fs_root_t *ro
svn_revnum_t pred_rev;
/* Only r0 should have no predecessor. */
- SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred_id, frd->root_dir, pool));
+ SVN_ERR(svn_fs_fs__dag_get_predecessor_id(&pred_id, frd->root_dir));
if (!!pred_id != !!root->rev)
return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
"r%ld's root node's predecessor is "