subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1554628 - in /subversion/trunk/subversion/libsvn_fs_fs: cached_data.c cached_data.h dag.c transaction.c
Date Wed, 01 Jan 2014 14:41:19 GMT
Author: stefan2
Date: Wed Jan  1 14:41:18 2014
New Revision: 1554628

URL: http://svn.apache.org/r1554628
Log:
Switch svn_fs_fs__rep_contents_dir to the two-pool paradigm.

* subversion/libsvn_fs_fs/cached_data.h
  (svn_fs_fs__rep_contents_dir): Replace POOL with RESULT_POOL plus
                                 SCRATCH_POOL and update the docstring.

* subversion/libsvn_fs_fs/cached_data.c
  (svn_fs_fs__rep_contents_dir): Update implementation signature and
                                 use the scratch pool wherever feasible.
  (svn_fs_fs__rep_contents_dir_entry): Update API caller.

* subversion/libsvn_fs_fs/dag.c
  (svn_fs_fs__dag_dir_entries): Ditto.

* subversion/libsvn_fs_fs/transaction.c
  (svn_fs_fs__set_entry,
   write_final_rev): Ditto.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
    subversion/trunk/subversion/libsvn_fs_fs/cached_data.h
    subversion/trunk/subversion/libsvn_fs_fs/dag.c
    subversion/trunk/subversion/libsvn_fs_fs/transaction.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/cached_data.c?rev=1554628&r1=1554627&r2=1554628&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/cached_data.c Wed Jan  1 14:41:18 2014
@@ -2022,32 +2022,35 @@ svn_error_t *
 svn_fs_fs__rep_contents_dir(apr_hash_t **entries_p,
                             svn_fs_t *fs,
                             node_revision_t *noderev,
-                            apr_pool_t *pool)
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool)
 {
   pair_cache_key_t pair_key = { 0 };
   const void *key;
   apr_hash_t *unparsed_entries, *parsed_entries;
 
   /* find the cache we may use */
-  svn_cache__t *cache = locate_dir_cache(fs, &key, &pair_key, noderev, pool);
+  svn_cache__t *cache = locate_dir_cache(fs, &key, &pair_key, noderev,
+                                         scratch_pool);
   if (cache)
     {
       svn_boolean_t found;
 
-      SVN_ERR(svn_cache__get((void **)entries_p, &found, cache, key, pool));
+      SVN_ERR(svn_cache__get((void **)entries_p, &found, cache, key,
+                             result_pool));
       if (found)
         return SVN_NO_ERROR;
     }
 
   /* Read in the directory hash. */
-  unparsed_entries = apr_hash_make(pool);
-  SVN_ERR(get_dir_contents(unparsed_entries, fs, noderev, pool));
+  unparsed_entries = apr_hash_make(scratch_pool);
+  SVN_ERR(get_dir_contents(unparsed_entries, fs, noderev, scratch_pool));
   SVN_ERR(parse_dir_entries(&parsed_entries, unparsed_entries,
-                            noderev->id, pool));
+                            noderev->id, result_pool));
 
   /* Update the cache, if we are to use one. */
   if (cache)
-    SVN_ERR(svn_cache__set(cache, key, parsed_entries, pool));
+    SVN_ERR(svn_cache__set(cache, key, parsed_entries, scratch_pool));
 
   *entries_p = parsed_entries;
   return SVN_NO_ERROR;
@@ -2090,7 +2093,7 @@ svn_fs_fs__rep_contents_dir_entry(svn_fs
       /* read the dir from the file system. It will probably be put it
          into the cache for faster lookup in future calls. */
       SVN_ERR(svn_fs_fs__rep_contents_dir(&entries, fs, noderev,
-                                          scratch_pool));
+                                          scratch_pool, scratch_pool));
 
       /* find desired entry and return a copy in POOL, if found */
       entry = svn_hash_gets(entries, name);

Modified: subversion/trunk/subversion/libsvn_fs_fs/cached_data.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/cached_data.h?rev=1554628&r1=1554627&r2=1554628&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/cached_data.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/cached_data.h Wed Jan  1 14:41:18 2014
@@ -100,13 +100,14 @@ svn_fs_fs__get_file_delta_stream(svn_txd
 
 /* Set *ENTRIES to an apr_hash_t of dirent structs that contain the
    directory entries of node-revision NODEREV in filesystem FS.  The
-   returned table (and its keys and values) is allocated in POOL,
-   which is also used for temporary allocations. */
+   returned table (and its keys and values) is allocated in RESULT_POOL;
+   SCRATCH_POOL used for temporary allocations. */
 svn_error_t *
 svn_fs_fs__rep_contents_dir(apr_hash_t **entries_p,
                             svn_fs_t *fs,
                             node_revision_t *noderev,
-                            apr_pool_t *pool);
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool);
 
 /* Set *DIRENT to the entry identified by NAME in the directory given
    by NODEREV in filesystem FS.  If no such entry exits, *DIRENT will

Modified: subversion/trunk/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?rev=1554628&r1=1554627&r2=1554628&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.c Wed Jan  1 14:41:18 2014
@@ -427,7 +427,7 @@ svn_fs_fs__dag_dir_entries(apr_hash_t **
     return svn_error_create(SVN_ERR_FS_NOT_DIRECTORY, NULL,
                             _("Can't get entries of non-directory"));
 
-  return svn_fs_fs__rep_contents_dir(entries, node->fs, noderev, pool);
+  return svn_fs_fs__rep_contents_dir(entries, node->fs, noderev, pool, pool);
 }
 
 svn_error_t *

Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1554628&r1=1554627&r2=1554628&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Wed Jan  1 14:41:18 2014
@@ -1492,7 +1492,7 @@ svn_fs_fs__set_entry(svn_fs_t *fs,
       /* Before we can modify the directory, we need to dump its old
          contents into a mutable representation file. */
       SVN_ERR(svn_fs_fs__rep_contents_dir(&entries, fs, parent_noderev,
-                                          subpool));
+                                          subpool, subpool));
       SVN_ERR(unparse_dir_entries(&entries, entries, subpool));
       SVN_ERR(svn_io_file_open(&file, filename,
                                APR_WRITE | APR_CREATE | APR_BUFFERED,
@@ -2833,7 +2833,8 @@ write_final_rev(const svn_fs_id_t **new_
       /* This is a directory.  Write out all the children first. */
       subpool = svn_pool_create(pool);
 
-      SVN_ERR(svn_fs_fs__rep_contents_dir(&entries, fs, noderev, pool));
+      SVN_ERR(svn_fs_fs__rep_contents_dir(&entries, fs, noderev, pool,
+                                          subpool));
       /* For the sake of the repository administrator sort the entries
          so that the final file is deterministic and repeatable,
          however the rest of the FSFS code doesn't require any



Mime
View raw message