Author: stefan2
Date: Sun Jan 11 02:00:40 2015
New Revision: 1650855

URL: http://svn.apache.org/r1650855
Log:
Continue migrating FSX to the two-pool paradigm.  Many single-pool functions
don't allocate a return value, i.e. their pools can immediately be renamed
to SCRATCH_POOL.  Do this for recovery.* .

* subversion/libsvn_fs_x/recovery.h
  (svn_fs_x__recover): POOL is actually a SCRATCH_POOL.

* subversion/libsvn_fs_x/recovery.c
  (recover_get_largest_revision,
   recover_body,
   svn_fs_x__recover): Same.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/recovery.c
    subversion/trunk/subversion/libsvn_fs_x/recovery.h

Modified: subversion/trunk/subversion/libsvn_fs_x/recovery.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/recovery.c?rev=1650855&r1=1650854&r2=1650855&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/recovery.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/recovery.c Sun Jan 11 02:00:40 2015
@@ -39,9 +39,11 @@
 #include "svn_private_config.h"
 
 /* Part of the recovery procedure.  Return the largest revision *REV in
-   filesystem FS.  Use POOL for temporary allocation. */
+   filesystem FS.  Use SCRATCH_POOL for temporary allocation. */
 static svn_error_t *
-recover_get_largest_revision(svn_fs_t *fs, svn_revnum_t *rev, apr_pool_t *pool)
+recover_get_largest_revision(svn_fs_t *fs,
+                             svn_revnum_t *rev,
+                             apr_pool_t *scratch_pool)
 {
   /* Discovering the largest revision in the filesystem would be an
      expensive operation if we did a readdir() or searched linearly,
@@ -50,7 +52,7 @@ recover_get_largest_revision(svn_fs_t *f
   apr_pool_t *iterpool;
   svn_revnum_t left, right = 1;
 
-  iterpool = svn_pool_create(pool);
+  iterpool = svn_pool_create(scratch_pool);
   /* Keep doubling right, until we find a revision that doesn't exist. */
   while (1)
     {
@@ -114,7 +116,8 @@ struct recover_baton {
    write lock.  This implements the svn_fs_x__with_write_lock()
    'body' callback type.  BATON is a 'struct recover_baton *'. */
 static svn_error_t *
-recover_body(void *baton, apr_pool_t *pool)
+recover_body(void *baton,
+             apr_pool_t *scratch_pool)
 {
   struct recover_baton *b = baton;
   svn_fs_t *fs = b->fs;
@@ -124,18 +127,18 @@ recover_body(void *baton, apr_pool_t *po
   svn_node_kind_t youngest_revprops_kind;
 
   /* Lose potentially corrupted data in temp files */
-  SVN_ERR(svn_fs_x__reset_revprop_generation_file(fs, pool));
+  SVN_ERR(svn_fs_x__reset_revprop_generation_file(fs, scratch_pool));
 
   /* The admin may have created a plain copy of this repo before attempting
      to recover it (hotcopy may or may not work with corrupted repos).
      Bump the instance ID. */
-  SVN_ERR(svn_fs_x__set_uuid(fs, fs->uuid, NULL, pool));
+  SVN_ERR(svn_fs_x__set_uuid(fs, fs->uuid, NULL, scratch_pool));
 
   /* We need to know the largest revision in the filesystem. */
-  SVN_ERR(recover_get_largest_revision(fs, &max_rev, pool));
+  SVN_ERR(recover_get_largest_revision(fs, &max_rev, scratch_pool));
 
   /* Get the expected youngest revision */
-  SVN_ERR(svn_fs_x__youngest_rev(&youngest_rev, fs, pool));
+  SVN_ERR(svn_fs_x__youngest_rev(&youngest_rev, fs, scratch_pool));
 
   /* Policy note:
 
@@ -176,12 +179,12 @@ recover_body(void *baton, apr_pool_t *po
 
   /* Before setting current, verify that there is a revprops file
      for the youngest revision.  (Issue #2992) */
-  SVN_ERR(svn_io_check_path(svn_fs_x__path_revprops(fs, max_rev, pool),
-                            &youngest_revprops_kind, pool));
+  SVN_ERR(svn_io_check_path(svn_fs_x__path_revprops(fs, max_rev, scratch_pool),
+                            &youngest_revprops_kind, scratch_pool));
   if (youngest_revprops_kind == svn_node_none)
     {
       svn_boolean_t missing = TRUE;
-      if (!svn_fs_x__packed_revprop_available(&missing, fs, max_rev, pool))
+      if (!svn_fs_x__packed_revprop_available(&missing, fs, max_rev, 
scratch_pool))
         {
           if (missing)
             {
@@ -214,21 +217,21 @@ recover_body(void *baton, apr_pool_t *po
     {
       svn_boolean_t rep_cache_exists;
 
-      SVN_ERR(svn_fs_x__exists_rep_cache(&rep_cache_exists, fs, pool));
+      SVN_ERR(svn_fs_x__exists_rep_cache(&rep_cache_exists, fs, scratch_pool));
       if (rep_cache_exists)
-        SVN_ERR(svn_fs_x__del_rep_reference(fs, max_rev, pool));
+        SVN_ERR(svn_fs_x__del_rep_reference(fs, max_rev, scratch_pool));
     }
 
   /* Now store the discovered youngest revision, and the next IDs if
      relevant, in a new 'current' file. */
-  return svn_fs_x__write_current(fs, max_rev, pool);
+  return svn_fs_x__write_current(fs, max_rev, scratch_pool);
 }
 
 /* This implements the fs_library_vtable_t.recover() API. */
 svn_error_t *
 svn_fs_x__recover(svn_fs_t *fs,
                   svn_cancel_func_t cancel_func, void *cancel_baton,
-                  apr_pool_t *pool)
+                  apr_pool_t *scratch_pool)
 {
   struct recover_baton b;
 
@@ -239,5 +242,5 @@ svn_fs_x__recover(svn_fs_t *fs,
   b.fs = fs;
   b.cancel_func = cancel_func;
   b.cancel_baton = cancel_baton;
-  return svn_fs_x__with_all_locks(fs, recover_body, &b, pool);
+  return svn_fs_x__with_all_locks(fs, recover_body, &b, scratch_pool);
 }

Modified: subversion/trunk/subversion/libsvn_fs_x/recovery.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/recovery.h?rev=1650855&r1=1650854&r2=1650855&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/recovery.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/recovery.h Sun Jan 11 02:00:40 2015
@@ -27,11 +27,11 @@
 
 /* Recover the fsx associated with filesystem FS.
    Use optional CANCEL_FUNC/CANCEL_BATON for cancellation support.
-   Use POOL for temporary allocations. */
+   Use SCRATCH_POOL for temporary allocations. */
 svn_error_t *
 svn_fs_x__recover(svn_fs_t *fs,
                   svn_cancel_func_t cancel_func,
                   void *cancel_baton,
-                  apr_pool_t *pool);
+                  apr_pool_t *scratch_pool);
 
 #endif


Reply via email to