Author: stefan2
Date: Thu Feb 26 22:51:19 2015
New Revision: 1662592

URL: http://svn.apache.org/r1662592
Log:
On the fsx-1.10 branch:
Complete moving the FSX DAG cache to the two-pool paradigm.

* subversion/libsvn_fs_x/dag_cache.h
  (svn_fs_x__get_dag_node): Switch declaration to the two-pool paradigm.

* subversion/libsvn_fs_x/dag_cache.c
  (svn_fs_x__get_dag_node): Update implementation.

* subversion/libsvn_fs_x/tree.c
  (x_props_changed): Update caller.
  (get_root): Same. Switch this pass-through to using 2 pools as well.
  (svn_fs_x__commit_txn,
   x_merge,
   copy_helper,
   x_contents_changed,
   x_get_file_delta_stream): 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=1662592&r1=1662591&r2=1662592&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:51:19 2015
@@ -1079,13 +1079,14 @@ svn_error_t *
 svn_fs_x__get_dag_node(dag_node_t **dag_node_p,
                        svn_fs_root_t *root,
                        const char *path,
-                       apr_pool_t *pool)
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool)
 {
   dag_node_t *node = NULL;
-  SVN_ERR(svn_fs_x__get_temp_dag_node(&node, root, path, pool));
+  SVN_ERR(svn_fs_x__get_temp_dag_node(&node, root, path, scratch_pool));
 
   /* We want the returned node to live in POOL. */
-  *dag_node_p = svn_fs_x__dag_dup(node, pool);
+  *dag_node_p = svn_fs_x__dag_dup(node, result_pool);
 
   return SVN_NO_ERROR;
 }

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=1662592&r1=1662591&r2=1662592&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:51:19 2015
@@ -152,14 +152,16 @@ svn_fs_x__get_temp_dag_node(dag_node_t *
                             apr_pool_t *scratch_pool);
 
 /* Open the node identified by PATH in ROOT.  Set *DAG_NODE_P to the
-   node we find, allocated in POOL.  Return the error
-   SVN_ERR_FS_NOT_FOUND if this node doesn't exist.
+   node we find, allocated in RESULT_POOL.  Return the error
+   SVN_ERR_FS_NOT_FOUND if this node doesn't exist.  Use SCRATCH_POOL
+   for temporary allocations.
  */
 svn_error_t *
 svn_fs_x__get_dag_node(dag_node_t **dag_node_p,
                        svn_fs_root_t *root,
                        const char *path,
-                       apr_pool_t *pool);
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool);
 
 /* Add / update the NODE in the node cache. */
 void

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=1662592&r1=1662591&r2=1662592&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:51:19 2015
@@ -601,7 +601,7 @@ x_props_changed(svn_boolean_t *changed_p
       (SVN_ERR_FS_GENERAL, NULL,
        _("Cannot compare property value between two different filesystems"));
 
-  SVN_ERR(svn_fs_x__get_dag_node(&node1, root1, path1, subpool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node1, root1, path1, subpool, subpool));
   SVN_ERR(svn_fs_x__get_temp_dag_node(&node2, root2, path2, subpool));
   SVN_ERR(svn_fs_x__dag_things_different(changed_p, NULL, node1, node2,
                                          strict, subpool));
@@ -616,9 +616,12 @@ x_props_changed(svn_boolean_t *changed_p
 
 /* Set *NODE to the root node of ROOT.  */
 static svn_error_t *
-get_root(dag_node_t **node, svn_fs_root_t *root, apr_pool_t *pool)
+get_root(dag_node_t **node,
+         svn_fs_root_t *root,
+         apr_pool_t *result_pool,
+         apr_pool_t *scratch_pool)
 {
-  return svn_fs_x__get_dag_node(node, root, "/", pool);
+  return svn_fs_x__get_dag_node(node, root, "/", result_pool, scratch_pool);
 }
 
 
@@ -1186,7 +1189,8 @@ svn_fs_x__commit_txn(const char **confli
          note that the youngest rev may have changed by then -- that's
          why we're careful to get this root in its own bdb txn
          here). */
-      SVN_ERR(get_root(&youngish_root_node, youngish_root, iterpool));
+      SVN_ERR(get_root(&youngish_root_node, youngish_root, iterpool,
+                       iterpool));
 
       /* Try to merge.  If the merge succeeds, the base root node of
          TARGET's txn will become the same as youngish_root_node, so
@@ -1287,10 +1291,10 @@ x_merge(const char **conflict_p,
   */
 
   /* Get the ancestor node. */
-  SVN_ERR(get_root(&ancestor, ancestor_root, pool));
+  SVN_ERR(get_root(&ancestor, ancestor_root, pool, pool));
 
   /* Get the source node. */
-  SVN_ERR(get_root(&source, source_root, pool));
+  SVN_ERR(get_root(&source, source_root, pool, pool));
 
   /* Open a txn for the txn root into which we're merging. */
   SVN_ERR(svn_fs_x__open_txn(&txn, ancestor_root->fs, target_root->txn,
@@ -1545,7 +1549,7 @@ copy_helper(svn_fs_root_t *from_root,
 
   /* Get the NODE for FROM_PATH in FROM_ROOT.*/
   SVN_ERR(svn_fs_x__get_dag_node(&from_node, from_root, from_path,
-                                 scratch_pool));
+                                 scratch_pool, scratch_pool));
 
   /* Build up the parent path from TO_PATH in TO_ROOT.  If the last
      component does not exist, it's not that big a deal.  We'll just
@@ -1621,7 +1625,7 @@ copy_helper(svn_fs_root_t *from_root,
 
       /* Make a record of this modification in the changes table. */
       SVN_ERR(svn_fs_x__get_dag_node(&new_node, to_root, to_path,
-                                     scratch_pool));
+                                     scratch_pool, scratch_pool));
       SVN_ERR(add_change(to_root->fs, txn_id, to_path,
                          svn_fs_x__dag_get_id(new_node), kind, FALSE,
                          FALSE, FALSE, svn_fs_x__dag_node_kind(from_node),
@@ -2183,7 +2187,7 @@ x_contents_changed(svn_boolean_t *change
         (SVN_ERR_FS_GENERAL, NULL, _("'%s' is not a file"), path2);
   }
 
-  SVN_ERR(svn_fs_x__get_dag_node(&node1, root1, path1, subpool));
+  SVN_ERR(svn_fs_x__get_dag_node(&node1, root1, path1, subpool, subpool));
   SVN_ERR(svn_fs_x__get_temp_dag_node(&node2, root2, path2, subpool));
   SVN_ERR(svn_fs_x__dag_things_different(NULL, changed_p, node1, node2,
                                          strict, subpool));
@@ -2209,7 +2213,7 @@ x_get_file_delta_stream(svn_txdelta_stre
 
   if (source_root && source_path)
     SVN_ERR(svn_fs_x__get_dag_node(&source_node, source_root, source_path,
-                                   scratch_pool));
+                                   scratch_pool, scratch_pool));
   else
     source_node = NULL;
   SVN_ERR(svn_fs_x__get_temp_dag_node(&target_node, target_root, target_path,


Reply via email to