subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1589406 - /subversion/trunk/subversion/libsvn_repos/repos.c
Date Wed, 23 Apr 2014 13:27:42 GMT
Author: ivan
Date: Wed Apr 23 13:27:41 2014
New Revision: 1589406

URL: http://svn.apache.org/r1589406
Log:
Follow-up to r1589048: Use svn_fs_open2() and scratch pool for svnadmin 
freeze.

* subversion/libsvn_repos/repos.c
  (freeze_baton_t): Add SCRATCH_POOL.
  (multi_freeze): Clear FB->SCRATCH_POOL on entry and use it for temporary 
   allocations.
  (svn_repos_freeze): Initialize FB.SCRATCH_POOL.

Modified:
    subversion/trunk/subversion/libsvn_repos/repos.c

Modified: subversion/trunk/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/repos.c?rev=1589406&r1=1589405&r2=1589406&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/repos.c (original)
+++ subversion/trunk/subversion/libsvn_repos/repos.c Wed Apr 23 13:27:41 2014
@@ -1882,6 +1882,9 @@ struct freeze_baton_t {
   int counter;
   svn_repos_freeze_func_t freeze_func;
   void *freeze_baton;
+
+  /* Scratch pool used for every freeze callback invocation. */
+  apr_pool_t *scratch_pool;
 };
 
 static svn_error_t *
@@ -1890,6 +1893,7 @@ multi_freeze(void *baton,
 {
   struct freeze_baton_t *fb = baton;
 
+  svn_pool_clear(fb->scratch_pool);
   if (fb->counter == fb->paths->nelts)
     {
       SVN_ERR(fb->freeze_func(fb->freeze_baton, pool));
@@ -1909,7 +1913,7 @@ multi_freeze(void *baton,
                         TRUE  /* exclusive (only applies to BDB) */,
                         FALSE /* non-blocking */,
                         FALSE /* open-fs */,
-                        NULL, subpool, subpool));
+                        NULL, subpool, fb->scratch_pool));
 
 
       if (strcmp(repos->fs_type, SVN_FS_TYPE_BDB) == 0)
@@ -1922,7 +1926,8 @@ multi_freeze(void *baton,
         }
       else
         {
-          SVN_ERR(svn_fs_open(&repos->fs, repos->db_path, NULL, subpool));
+          SVN_ERR(svn_fs_open2(&repos->fs, repos->db_path, NULL, subpool,
+                               fb->scratch_pool));
           SVN_ERR(svn_fs_freeze(svn_repos_fs(repos), multi_freeze, fb,
                                 subpool));
         }
@@ -1951,9 +1956,11 @@ svn_repos_freeze(apr_array_header_t *pat
   fb.counter = 0;
   fb.freeze_func = freeze_func;
   fb.freeze_baton = freeze_baton;
+  fb.scratch_pool = svn_pool_create(pool);
 
   SVN_ERR(multi_freeze(&fb, pool));
 
+  svn_pool_destroy(fb.scratch_pool);
   return SVN_NO_ERROR;
 }
 



Mime
View raw message