Author: kotkov
Date: Fri Nov 21 22:35:07 2014
New Revision: 1641013

URL: http://svn.apache.org/r1641013
Log:
Following up on r1637184, simplify a couple of functions and their calling
sites.  As we now do not support mixed-mode addressing for FSFS7 revisions,
the svn_fs_fs__use_log_addressing() function no longer needs to know a
revision number.  That, however, is just a part of the story, because this
function had a certain number of callers.  Some of the callers only required
a revision number in order to pass in to the svn_fs_fs__use_log_addressing()
function, and these revision number arguments can be safely dropped.

So we walk up the stack, remove the unused arguments and update the function
callers.

* subversion/libsvn_fs_fs/cached_data.c
  (use_block_read): Drop the unused REVISION argument.
  (get_node_revision_body, create_rep_state_body, read_delta_window,
   svn_fs_fs__get_changes): Update the use_block_read() function callers.

* subversion/libsvn_fs_fs/pack.h
  (svn_fs_fs__order_dir_entries): Drop the unused REVISION argument.

* subversion/libsvn_fs_fs/pack.c
  (svn_fs_fs__order_dir_entries): Same here.

* subversion/libsvn_fs_fs/transaction.c
  (write_final_changed_path_info): Drop the unused NEW_REV argument.
  (commit_body): Update the call to write_final_changed_path_info().
  (allocate_item_index): Drop the unused FINAL_REVISION argument.
  (rep_write_contents_close): Update the call to allocate_item_index().
  (write_container_rep, write_container_delta_rep): Update the calls to the
   allocate_item_index() function.  Drop the FINAL_REVISION arguments
   as they are no longer being used anywhere within these functions.
  (write_final_rev): Update the calls to write_container_delta_rep(),
   write_container_rep() and allocate_item_index() functions.

* subversion/libsvn_fs_fs/tree.c
  (fs_dir_optimal_order): Update the svn_fs_fs__order_dir_entries() caller.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
    subversion/trunk/subversion/libsvn_fs_fs/pack.c
    subversion/trunk/subversion/libsvn_fs_fs/pack.h
    subversion/trunk/subversion/libsvn_fs_fs/transaction.c
    subversion/trunk/subversion/libsvn_fs_fs/tree.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=1641013&r1=1641012&r2=1641013&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/cached_data.c Fri Nov 21 22:35:07 
2014
@@ -277,11 +277,10 @@ err_dangling_id(svn_fs_t *fs, const svn_
      id_str->data, fs->path);
 }
 
-/* Return TRUE, if REVISION in FS is of a format that supports block-read
-   and the feature has been enabled. */
+/* Return TRUE, if FS is of a format that supports block-read and the
+   feature has been enabled. */
 static svn_boolean_t
-use_block_read(svn_fs_t *fs,
-               svn_revnum_t revision)
+use_block_read(svn_fs_t *fs)
 {
   fs_fs_data_t *ffd = fs->fsap_data;
   return svn_fs_fs__use_log_addressing(fs) && ffd->use_block_read;
@@ -359,7 +358,7 @@ get_node_revision_body(node_revision_t *
                                      rev_item->number,
                                      scratch_pool));
 
-      if (use_block_read(fs, rev_item->revision))
+      if (use_block_read(fs))
         {
           /* block-read will parse the whole block and will also return
              the one noderev that we need right now. */
@@ -839,7 +838,7 @@ create_rep_state_body(rep_state_t **rep_
       /* populate the cache if appropriate */
       if (! svn_fs_fs__id_txn_used(&rep->txn_id))
         {
-          if (use_block_read(fs, rep->revision))
+          if (use_block_read(fs))
             SVN_ERR(block_read(NULL, fs, rep->revision, rep->item_index,
                                rs->sfile->rfile, result_pool, scratch_pool));
           else
@@ -1484,7 +1483,7 @@ read_delta_window(svn_txdelta_window_t *
      because the block is unlikely to contain other data. */
   if (   rs->chunk_index == 0
       && SVN_IS_VALID_REVNUM(rs->revision)
-      && use_block_read(rs->sfile->fs, rs->revision)
+      && use_block_read(rs->sfile->fs)
       && rs->raw_window_cache)
     {
       SVN_ERR(block_read(NULL, rs->sfile->fs, rs->revision, rs->item_index,
@@ -2717,7 +2716,7 @@ svn_fs_fs__get_changes(apr_array_header_
       SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&revision_file, fs, rev,
                                                scratch_pool, scratch_pool));
 
-      if (use_block_read(fs, rev))
+      if (use_block_read(fs))
         {
           /* 'block-read' will also provide us with the desired data */
           SVN_ERR(block_read((void **)changes, fs,

Modified: subversion/trunk/subversion/libsvn_fs_fs/pack.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/pack.c?rev=1641013&r1=1641012&r2=1641013&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/pack.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/pack.c Fri Nov 21 22:35:07 2014
@@ -643,7 +643,6 @@ compare_dir_entries_format6(const svn_so
 apr_array_header_t *
 svn_fs_fs__order_dir_entries(svn_fs_t *fs,
                              apr_hash_t *directory,
-                             svn_revnum_t revision,
                              apr_pool_t *pool)
 {
   apr_array_header_t *ordered

Modified: subversion/trunk/subversion/libsvn_fs_fs/pack.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/pack.h?rev=1641013&r1=1641012&r2=1641013&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/pack.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/pack.h Fri Nov 21 22:35:07 2014
@@ -52,13 +52,11 @@ svn_fs_fs__get_packed_offset(apr_off_t *
 
 /* Return the svn_dir_entry_t* objects of DIRECTORY in an APR array
  * allocated in POOL with entries added in storage (on-disk) order.
- * FS format and the directory's REVISION number will be used to pick
- * the optimal ordering strategy.
+ * FS format will be used to pick the optimal ordering strategy.
  */
 apr_array_header_t *
 svn_fs_fs__order_dir_entries(svn_fs_t *fs,
                              apr_hash_t *directory,
-                             svn_revnum_t revision,
                              apr_pool_t *pool);
 
 

Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1641013&r1=1641012&r2=1641013&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Fri Nov 21 22:35:07 
2014
@@ -1660,15 +1660,12 @@ store_p2l_index_entry(svn_fs_t *fs,
  * of file system FS and return it in *ITEM_INDEX.  For old formats, it
  * will simply return the offset as item index; in new formats, it will
  * increment the txn's item index counter file and store the mapping in
- * the proto index file.  If FINAL_REVISION is not SVN_INVALID_REVNUM, use
- * it to determine whether to actually write to the proto-index.
- * Use POOL for allocations.
+ * the proto index file.  Use POOL for allocations.
  */
 static svn_error_t *
 allocate_item_index(apr_uint64_t *item_index,
                     svn_fs_t *fs,
                     const svn_fs_fs__id_part_t *txn_id,
-                    svn_revnum_t final_revision,
                     apr_off_t my_offset,
                     apr_pool_t *pool)
 {
@@ -2295,8 +2292,7 @@ rep_write_contents_close(void *baton)
       /* Write out our cosmetic end marker. */
       SVN_ERR(svn_stream_puts(b->rep_stream, "ENDREP\n"));
       SVN_ERR(allocate_item_index(&rep->item_index, b->fs, &rep->txn_id,
-                                  SVN_INVALID_REVNUM, b->rep_offset,
-                                  b->scratch_pool));
+                                  b->rep_offset, b->scratch_pool));
 
       b->noderev->data_rep = rep;
     }
@@ -2505,9 +2501,7 @@ write_directory_to_stream(svn_stream_t *
    is not NULL, it will be used in addition to the on-disk cache to find
    earlier reps with the same content.  When such existing reps can be
    found, we will truncate the one just written from the file and return
-   the existing rep.  If FINAL_REVISION is not SVN_INVALID_REVNUM, use it
-   to determine whether to write to the proto-index files.
-   Perform temporary allocations in SCRATCH_POOL. */
+   the existing rep.  Perform temporary allocations in SCRATCH_POOL. */
 static svn_error_t *
 write_container_rep(representation_t *rep,
                     apr_file_t *file,
@@ -2516,7 +2510,6 @@ write_container_rep(representation_t *re
                     svn_fs_t *fs,
                     apr_hash_t *reps_hash,
                     apr_uint32_t item_type,
-                    svn_revnum_t final_revision,
                     apr_pool_t *scratch_pool)
 {
   svn_stream_t *stream;
@@ -2568,7 +2561,7 @@ write_container_rep(representation_t *re
       SVN_ERR(svn_stream_puts(whb->stream, "ENDREP\n"));
 
       SVN_ERR(allocate_item_index(&rep->item_index, fs, &rep->txn_id,
-                                  final_revision, offset, scratch_pool));
+                                  offset, scratch_pool));
 
       entry.offset = offset;
       SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
@@ -2601,8 +2594,6 @@ write_container_rep(representation_t *re
 
    If ITEM_TYPE is IS_PROPS equals SVN_FS_FS__ITEM_TYPE_*_PROPS, assume
    that we want to a props representation as the base for our delta.
-   If FINAL_REVISION is not SVN_INVALID_REVNUM, use it to determine whether
-   to write to the proto-index files.
    Perform temporary allocations in SCRATCH_POOL.
  */
 static svn_error_t *
@@ -2614,7 +2605,6 @@ write_container_delta_rep(representation
                           node_revision_t *noderev,
                           apr_hash_t *reps_hash,
                           apr_uint32_t item_type,
-                          svn_revnum_t final_revision,
                           apr_pool_t *scratch_pool)
 {
   svn_txdelta_window_handler_t diff_wh;
@@ -2711,7 +2701,7 @@ write_container_delta_rep(representation
       SVN_ERR(svn_stream_puts(file_stream, "ENDREP\n"));
 
       SVN_ERR(allocate_item_index(&rep->item_index, fs, &rep->txn_id,
-                                  final_revision, offset, scratch_pool));
+                                  offset, scratch_pool));
 
       entry.offset = offset;
       SVN_ERR(svn_fs_fs__get_file_offset(&offset, file, scratch_pool));
@@ -2910,12 +2900,11 @@ write_final_rev(const svn_fs_id_t **new_
                                               write_directory_to_stream,
                                               fs, noderev, NULL,
                                               SVN_FS_FS__ITEM_TYPE_DIR_REP,
-                                              rev, pool));
+                                              pool));
           else
             SVN_ERR(write_container_rep(noderev->data_rep, file, entries,
                                         write_directory_to_stream, fs, NULL,
-                                        SVN_FS_FS__ITEM_TYPE_DIR_REP, rev,
-                                        pool));
+                                        SVN_FS_FS__ITEM_TYPE_DIR_REP, pool));
 
           reset_txn_in_rep(noderev->data_rep);
         }
@@ -2960,11 +2949,11 @@ write_final_rev(const svn_fs_id_t **new_
       if (ffd->deltify_properties)
         SVN_ERR(write_container_delta_rep(noderev->prop_rep, file, proplist,
                                           write_hash_to_stream, fs, noderev,
-                                          reps_hash, item_type, rev, pool));
+                                          reps_hash, item_type, pool));
       else
         SVN_ERR(write_container_rep(noderev->prop_rep, file, proplist,
                                     write_hash_to_stream, fs, reps_hash,
-                                    item_type, rev, pool));
+                                    item_type, pool));
 
       reset_txn_in_rep(noderev->prop_rep);
     }
@@ -2988,7 +2977,7 @@ write_final_rev(const svn_fs_id_t **new_
                                     rev_item.number, pool));
     }
   else
-    SVN_ERR(allocate_item_index(&rev_item.number, fs, txn_id, rev,
+    SVN_ERR(allocate_item_index(&rev_item.number, fs, txn_id,
                                 my_offset, pool));
 
   rev_item.revision = rev;
@@ -3070,17 +3059,15 @@ write_final_rev(const svn_fs_id_t **new_
 }
 
 /* Write the changed path info CHANGED_PATHS from transaction TXN_ID to the
-   permanent rev-file FILE representing NEW_REV in filesystem FS.  *OFFSET_P
-   is set the to offset in the file of the beginning of this information.
-   NEW_REV is the revision currently being committed.
-   Perform temporary allocations in POOL. */
+   permanent rev-file FILE in filesystem FS.  *OFFSET_P is set the to offset
+   in the file of the beginning of this information.  Perform temporary
+   allocations in POOL. */
 static svn_error_t *
 write_final_changed_path_info(apr_off_t *offset_p,
                               apr_file_t *file,
                               svn_fs_t *fs,
                               const svn_fs_fs__id_part_t *txn_id,
                               apr_hash_t *changed_paths,
-                              svn_revnum_t new_rev,
                               apr_pool_t *pool)
 {
   apr_off_t offset;
@@ -3459,7 +3446,7 @@ commit_body(void *baton, apr_pool_t *poo
   /* Write the changed-path information. */
   SVN_ERR(write_final_changed_path_info(&changed_path_offset, proto_file,
                                         cb->fs, txn_id, changed_paths,
-                                        new_rev, pool));
+                                        pool));
 
   if (svn_fs_fs__use_log_addressing(cb->fs))
     {

Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1641013&r1=1641012&r2=1641013&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Fri Nov 21 22:35:07 2014
@@ -2387,10 +2387,7 @@ fs_dir_optimal_order(apr_array_header_t 
                      apr_hash_t *entries,
                      apr_pool_t *pool)
 {
-  *ordered_p
-    = svn_fs_fs__order_dir_entries(root->fs, entries,
-                                   root->rev,
-                                   pool);
+  *ordered_p = svn_fs_fs__order_dir_entries(root->fs, entries, pool);
 
   return SVN_NO_ERROR;
 }


Reply via email to