You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/06/24 13:58:39 UTC

svn commit: r1605060 - in /subversion/trunk/subversion/libsvn_fs_fs: low_level.c low_level.h

Author: stefan2
Date: Tue Jun 24 11:58:39 2014
New Revision: 1605060

URL: http://svn.apache.org/r1605060
Log:
In FSFS, low-level internal API layer, rename pool arguments of single
pool functions in accordance to the two-pool paradigm.

No functional change.

* subversion/libsvn_fs_fs/low_level.h
  (svn_fs_fs__unparse_revision_trailer,
   svn_fs_fs__unparse_footer): These use a single RESULT_POOL.
  (svn_fs_fs__write_changes,
   svn_fs_fs__write_noderev,
   svn_fs_fs__write_rep_header): These use a single SCRATCH_POOL.

* subversion/libsvn_fs_fs/low_level.c
  (svn_fs_fs__unparse_revision_trailer,
   svn_fs_fs__unparse_footer): These use a single RESULT_POOL.
  (svn_fs_fs__write_changes,
   svn_fs_fs__write_noderev,
   svn_fs_fs__write_rep_header): These use a single SCRATCH_POOL.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/low_level.c
    subversion/trunk/subversion/libsvn_fs_fs/low_level.h

Modified: subversion/trunk/subversion/libsvn_fs_fs/low_level.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/low_level.c?rev=1605060&r1=1605059&r2=1605060&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/low_level.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/low_level.c Tue Jun 24 11:58:39 2014
@@ -150,9 +150,9 @@ svn_fs_fs__parse_revision_trailer(apr_of
 svn_stringbuf_t *
 svn_fs_fs__unparse_revision_trailer(apr_off_t root_offset,
                                     apr_off_t changes_offset,
-                                    apr_pool_t *pool)
+                                    apr_pool_t *result_pool)
 {
-  return svn_stringbuf_createf(pool,
+  return svn_stringbuf_createf(result_pool,
                                "%" APR_OFF_T_FMT " %" APR_OFF_T_FMT "\n",
                                root_offset,
                                changes_offset);
@@ -186,9 +186,9 @@ svn_fs_fs__parse_footer(apr_off_t *l2p_o
 svn_stringbuf_t *
 svn_fs_fs__unparse_footer(apr_off_t l2p_offset,
                           apr_off_t p2l_offset,
-                          apr_pool_t *pool)
+                          apr_pool_t *result_pool)
 {
-  return svn_stringbuf_createf(pool,
+  return svn_stringbuf_createf(result_pool,
                                "%" APR_OFF_T_FMT " %" APR_OFF_T_FMT,
                                l2p_offset,
                                p2l_offset);
@@ -521,9 +521,9 @@ svn_fs_fs__write_changes(svn_stream_t *s
                          svn_fs_t *fs,
                          apr_hash_t *changes,
                          svn_boolean_t terminate_list,
-                         apr_pool_t *pool)
+                         apr_pool_t *scratch_pool)
 {
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   fs_fs_data_t *ffd = fs->fsap_data;
   svn_boolean_t include_node_kinds =
       ffd->format >= SVN_FS_FS__MIN_KIND_IN_CHANGED_FORMAT;
@@ -536,7 +536,8 @@ svn_fs_fs__write_changes(svn_stream_t *s
      that the final file is deterministic and repeatable, however the
      rest of the FSFS code doesn't require any particular order here. */
   sorted_changed_paths = svn_sort__hash(changes,
-                                        svn_sort_compare_items_lexically, pool);
+                                        svn_sort_compare_items_lexically,
+                                        scratch_pool);
 
   /* Write all items to disk in the new order. */
   for (i = 0; i < sorted_changed_paths->nelts; ++i)
@@ -968,50 +969,50 @@ svn_fs_fs__write_noderev(svn_stream_t *o
                          node_revision_t *noderev,
                          int format,
                          svn_boolean_t include_mergeinfo,
-                         apr_pool_t *pool)
+                         apr_pool_t *scratch_pool)
 {
-  SVN_ERR(svn_stream_printf(outfile, pool, HEADER_ID ": %s\n",
+  SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_ID ": %s\n",
                             svn_fs_fs__id_unparse(noderev->id,
-                                                  pool)->data));
+                                                  scratch_pool)->data));
 
-  SVN_ERR(svn_stream_printf(outfile, pool, HEADER_TYPE ": %s\n",
+  SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_TYPE ": %s\n",
                             (noderev->kind == svn_node_file) ?
                             SVN_FS_FS__KIND_FILE : SVN_FS_FS__KIND_DIR));
 
   if (noderev->predecessor_id)
-    SVN_ERR(svn_stream_printf(outfile, pool, HEADER_PRED ": %s\n",
+    SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_PRED ": %s\n",
                               svn_fs_fs__id_unparse(noderev->predecessor_id,
-                                                    pool)->data));
+                                                    scratch_pool)->data));
 
-  SVN_ERR(svn_stream_printf(outfile, pool, HEADER_COUNT ": %d\n",
+  SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_COUNT ": %d\n",
                             noderev->predecessor_count));
 
   if (noderev->data_rep)
-    SVN_ERR(svn_stream_printf(outfile, pool, HEADER_TEXT ": %s\n",
+    SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_TEXT ": %s\n",
                               svn_fs_fs__unparse_representation
                                 (noderev->data_rep,
                                  format,
                                  noderev->kind == svn_node_dir,
-                                 pool)->data));
+                                 scratch_pool)->data));
 
   if (noderev->prop_rep)
-    SVN_ERR(svn_stream_printf(outfile, pool, HEADER_PROPS ": %s\n",
+    SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_PROPS ": %s\n",
                               svn_fs_fs__unparse_representation
                                 (noderev->prop_rep, format,
-                                 TRUE, pool)->data));
+                                 TRUE, scratch_pool)->data));
 
-  SVN_ERR(svn_stream_printf(outfile, pool, HEADER_CPATH ": %s\n",
+  SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_CPATH ": %s\n",
                             noderev->created_path));
 
   if (noderev->copyfrom_path)
-    SVN_ERR(svn_stream_printf(outfile, pool, HEADER_COPYFROM ": %ld"
+    SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_COPYFROM ": %ld"
                               " %s\n",
                               noderev->copyfrom_rev,
                               noderev->copyfrom_path));
 
   if ((noderev->copyroot_rev != svn_fs_fs__id_rev(noderev->id)) ||
       (strcmp(noderev->copyroot_path, noderev->created_path) != 0))
-    SVN_ERR(svn_stream_printf(outfile, pool, HEADER_COPYROOT ": %ld"
+    SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_COPYROOT ": %ld"
                               " %s\n",
                               noderev->copyroot_rev,
                               noderev->copyroot_path));
@@ -1022,8 +1023,8 @@ svn_fs_fs__write_noderev(svn_stream_t *o
   if (include_mergeinfo)
     {
       if (noderev->mergeinfo_count > 0)
-        SVN_ERR(svn_stream_printf(outfile, pool, HEADER_MINFO_CNT ": %"
-                                  APR_INT64_T_FMT "\n",
+        SVN_ERR(svn_stream_printf(outfile, scratch_pool, HEADER_MINFO_CNT
+                                  ": %" APR_INT64_T_FMT "\n",
                                   noderev->mergeinfo_count));
 
       if (noderev->has_mergeinfo)
@@ -1096,7 +1097,7 @@ svn_fs_fs__read_rep_header(svn_fs_fs__re
 svn_error_t *
 svn_fs_fs__write_rep_header(svn_fs_fs__rep_header_t *header,
                             svn_stream_t *stream,
-                            apr_pool_t *pool)
+                            apr_pool_t *scratch_pool)
 {
   const char *text;
   
@@ -1111,8 +1112,8 @@ svn_fs_fs__write_rep_header(svn_fs_fs__r
         break;
 
       default:
-        text = apr_psprintf(pool, REP_DELTA " %ld %" APR_OFF_T_FMT " %"
-                            SVN_FILESIZE_T_FMT "\n",
+        text = apr_psprintf(scratch_pool, REP_DELTA " %ld %" APR_OFF_T_FMT
+                                          " %" SVN_FILESIZE_T_FMT "\n",
                             header->base_revision, header->base_item_index,
                             header->base_length);
     }

Modified: subversion/trunk/subversion/libsvn_fs_fs/low_level.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/low_level.h?rev=1605060&r1=1605059&r2=1605060&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/low_level.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/low_level.h Tue Jun 24 11:58:39 2014
@@ -55,12 +55,12 @@ svn_fs_fs__parse_revision_trailer(apr_of
 
 /* Given the offset of the root noderev in ROOT_OFFSET and the offset of
  * the changed paths list in CHANGES_OFFSET,  return the corresponding
- * revision's trailer.  Allocate it in POOL.
+ * revision's trailer.  Allocate it in RESULT_POOL.
  */
 svn_stringbuf_t *
 svn_fs_fs__unparse_revision_trailer(apr_off_t root_offset,
                                     apr_off_t changes_offset,
-                                    apr_pool_t *pool);
+                                    apr_pool_t *result_pool);
 
 /* Given the format 7+ revision / pack FOOTER, parse it destructively
  * and return the start offsets of the index data in *L2P_OFFSET and
@@ -77,12 +77,12 @@ svn_fs_fs__parse_footer(apr_off_t *l2p_o
 
 /* Given the offset of the L2P index data in L2P_OFFSET and the offset of
  * the P2L index data in P2L_OFFSET,  return the corresponding format 7+
- * revision / pack file footer.  Allocate it in POOL.
+ * revision / pack file footer.  Allocate it in RESULT_POOL.
  */
 svn_stringbuf_t *
 svn_fs_fs__unparse_footer(apr_off_t l2p_offset,
                           apr_off_t p2l_offset,
-                          apr_pool_t *pool);
+                          apr_pool_t *result_pool);
 
 /* Read all the changes from STREAM and store them in *CHANGES,
    allocated in RESULT_POOL. Do temporary allocations in SCRATCH_POOL. */
@@ -114,14 +114,14 @@ svn_fs_fs__read_changes_incrementally(sv
    output stream STREAM.  You may call this function multiple time on
    the same stream but the last call should set TERMINATE_LIST to write
    an extra empty line that marks the end of the changed paths list.
-   Perform temporary allocations in POOL.
+   Perform temporary allocations in SCRATCH_POOL.
  */
 svn_error_t *
 svn_fs_fs__write_changes(svn_stream_t *stream,
                          svn_fs_t *fs,
                          apr_hash_t *changes,
                          svn_boolean_t terminate_list,
-                         apr_pool_t *pool);
+                         apr_pool_t *scratch_pool);
 
 /* Read a node-revision from STREAM. Set *NODEREV to the new structure,
    allocated in RESULT_POOL. */
@@ -133,13 +133,13 @@ svn_fs_fs__read_noderev(node_revision_t 
 
 /* Write the node-revision NODEREV into the stream OUTFILE, compatible with
    filesystem format FORMAT.  Only write mergeinfo-related metadata if
-   INCLUDE_MERGEINFO is true.  Temporary allocations are from POOL. */
+   INCLUDE_MERGEINFO is true.  Temporary allocations are from SCRATCH_POOL. */
 svn_error_t *
 svn_fs_fs__write_noderev(svn_stream_t *outfile,
                          node_revision_t *noderev,
                          int format,
                          svn_boolean_t include_mergeinfo,
-                         apr_pool_t *pool);
+                         apr_pool_t *scratch_pool);
 
 /* Parse the description of a representation from TEXT and store it
    into *REP_P.  Allocate *REP_P in POOL. */
@@ -208,8 +208,9 @@ svn_fs_fs__read_rep_header(svn_fs_fs__re
                            apr_pool_t *result_pool,
                            apr_pool_t *scratch_pool);
 
-/* Write the representation HEADER to STREAM.  Use POOL for allocations. */
+/* Write the representation HEADER to STREAM.
+ * Use SCRATCH_POOL for temporary allocations. */
 svn_error_t *
 svn_fs_fs__write_rep_header(svn_fs_fs__rep_header_t *header,
                             svn_stream_t *stream,
-                            apr_pool_t *pool);
+                            apr_pool_t *scratch_pool);