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 2013/07/01 13:59:38 UTC

svn commit: r1498393 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_x: cached_data.c caching.c fs.h fs_x.c index.c pack.c transaction.c verify.c

Author: stefan2
Date: Mon Jul  1 11:59:37 2013
New Revision: 1498393

URL: http://svn.apache.org/r1498393
Log:
On the fsfs-format7 branch:  remove the SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT
flag from FSX because it always uses logical addressing.  Get rid of the old
phys. addressing code

* subversion/libsvn_fs_x/fs.h
  (SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT): be gone

* subversion/libsvn_fs_x/cached_data.c
  (get_node_revision_body,
   create_rep_state_body,
   read_delta_window,
   svn_fs_x__get_changes): remove check & pre-f7 code 
  (get_fs_id_at_offset,
   get_root_changes_offset): drop

* subversion/libsvn_fs_x/caching.c
  (svn_fs_x__initialize_caches): remove check & pre-f7 code

* subversion/libsvn_fs_x/fs_x.c
  (read_config,
   write_revision_zero): ditto

* subversion/libsvn_fs_x/index.c
  (svn_fs_x__item_offset): same here

* subversion/libsvn_fs_x/pack.c
  (initialize_pack_context): remove obsolete assertion
  (compare_dir_entries_format7): rename to ...
  (compare_dir_entries): ... this
  (svn_fs_x__order_dir_entries,
   pack_rev_shard): remove check & pre-f7 code
  (compare_dir_entries_format6,
   pack_phys_addressed): drop

* subversion/libsvn_fs_x/transaction.c
  (store_l2p_index_entry,
   store_p2l_index_entry, 
   allocate_item_index,
   write_final_rev,
   write_final_changed_path_info,
   commit_body): remove check & pre-f7 code

* subversion/libsvn_fs_x/verify.c
  (svn_fs_x__verify): remove check

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/cached_data.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/caching.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs.h
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs_x.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/index.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/pack.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/transaction.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/verify.c

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/cached_data.c?rev=1498393&r1=1498392&r2=1498393&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/cached_data.c Mon Jul  1 11:59:37 2013
@@ -372,36 +372,15 @@ get_node_revision_body(node_revision_t *
                                    rev_item->number,
                                    pool);
 
-      if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-        {
-          /* block-read will parse the whole block and will also return
-             the one noderev that we need right now. */
-          SVN_ERR(block_read((void **)noderev_p, fs,
-                             rev_item->revision,
-                             rev_item->number,
-                             revision_file,
-                             pool,
-                             pool));
-          SVN_ERR(svn_io_file_close(revision_file, pool));
-        }
-      else
-        {
-          /* pre-format7 reading, parsing and caching */
-          SVN_ERR(svn_fs_x__read_noderev(noderev_p,
-                                         svn_stream_from_aprfile2(revision_file,
-                                                                  FALSE,
-                                                                  pool),
-                                         pool));
-          /* Workaround issue #4031: is-fresh-txn-root in revision files. */
-          (*noderev_p)->is_fresh_txn_root = FALSE;
-
-          /* The noderev is not in cache, yet. Add it, if caching has been enabled. */
-          if (ffd->node_revision_cache)
-            SVN_ERR(svn_cache__set(ffd->node_revision_cache,
-                                   &key,
-                                   *noderev_p,
-                                   pool));
-        }
+      /* block-read will parse the whole block and will also return
+          the one noderev that we need right now. */
+      SVN_ERR(block_read((void **)noderev_p, fs,
+                         rev_item->revision,
+                         rev_item->number,
+                         revision_file,
+                         pool,
+                         pool));
+      SVN_ERR(svn_io_file_close(revision_file, pool));
     }
 
   return SVN_NO_ERROR;
@@ -435,159 +414,14 @@ svn_fs_x__get_node_revision(node_revisio
 }
 
 
-
-/* Given a revision file REV_FILE, opened to REV in FS, find the Node-ID
-   of the header located at OFFSET and store it in *ID_P.  Allocate
-   temporary variables from POOL. */
-static svn_error_t *
-get_fs_id_at_offset(svn_fs_id_t **id_p,
-                    apr_file_t *rev_file,
-                    svn_fs_t *fs,
-                    svn_revnum_t rev,
-                    apr_off_t offset,
-                    apr_pool_t *pool)
-{
-  node_revision_t *noderev;
-
-  SVN_ERR(aligned_seek(fs, rev_file, NULL, offset, pool));
-  SVN_ERR(svn_fs_x__read_noderev(&noderev,
-                                 svn_stream_from_aprfile2(rev_file, TRUE,
-                                                          pool),
-                                 pool));
-
-  /* noderev->id is const, get rid of that */
-  *id_p = svn_fs_x__id_copy(noderev->id, pool);
-
-  /* assert that the txn_id is REV
-   * (asserting on offset would be harder because we the rev_offset is not
-   * known here) */
-  assert(svn_fs_x__id_rev(*id_p) == rev);
-
-  return SVN_NO_ERROR;
-}
-
-/* Given an open revision file REV_FILE in FS for REV, locate the trailer that
-   specifies the offset to the root node-id and to the changed path
-   information.  Store the root node offset in *ROOT_OFFSET and the
-   changed path offset in *CHANGES_OFFSET.  If either of these
-   pointers is NULL, do nothing with it.
-
-   If PACKED is true, REV_FILE should be a packed shard file.
-   ### There is currently no such parameter.  This function assumes that
-       is_packed_rev(FS, REV) will indicate whether REV_FILE is a packed
-       file.  Therefore FS->fsap_data->min_unpacked_rev must not have been
-       refreshed since REV_FILE was opened if there is a possibility that
-       revision REV may have become packed since then.
-       TODO: Take an IS_PACKED parameter instead, in order to remove this
-       requirement.
-
-   Allocate temporary variables from POOL. */
-static svn_error_t *
-get_root_changes_offset(apr_off_t *root_offset,
-                        apr_off_t *changes_offset,
-                        apr_file_t *rev_file,
-                        svn_fs_t *fs,
-                        svn_revnum_t rev,
-                        apr_pool_t *pool)
-{
-  fs_x_data_t *ffd = fs->fsap_data;
-  apr_off_t offset;
-  apr_off_t rev_offset;
-  apr_seek_where_t seek_relative;
-  svn_stringbuf_t *trailer = svn_stringbuf_create_ensure(64, pool);
-
-  /* Determine where to seek to in the file.
-
-     If we've got a pack file, we want to seek to the end of the desired
-     revision.  But we don't track that, so we seek to the beginning of the
-     next revision.
-
-     Unless the next revision is in a different file, in which case, we can
-     just seek to the end of the pack file -- just like we do in the
-     non-packed case. */
-  if (svn_fs_x__is_packed_rev(fs, rev)
-      && ((rev + 1) % ffd->max_files_per_dir != 0))
-    {
-      SVN_ERR(svn_fs_x__get_packed_offset(&offset, fs, rev + 1, pool));
-      seek_relative = APR_SET;
-    }
-  else
-    {
-      seek_relative = APR_END;
-      offset = 0;
-    }
-
-  /* Offset of the revision from the start of the pack file, if applicable. */
-  if (svn_fs_x__is_packed_rev(fs, rev))
-    SVN_ERR(svn_fs_x__get_packed_offset(&rev_offset, fs, rev, pool));
-  else
-    rev_offset = 0;
-
-  /* We will assume that the last line containing the two offsets
-     will never be longer than 64 characters. */
-  SVN_ERR(svn_io_file_seek(rev_file, seek_relative, &offset, pool));
-
-  trailer->len = trailer->blocksize-1;
-  offset -= trailer->len;
-  SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &offset, pool));
-
-  /* Read in this last block, from which we will identify the last line. */
-  SVN_ERR(svn_io_file_read(rev_file, trailer->data, &trailer->len, pool));
-  trailer->data[trailer->len] = 0;
-
-  /* Parse the last line. */
-  SVN_ERR(svn_fs_x__parse_revision_trailer(root_offset,
-                                           changes_offset,
-                                           trailer,
-                                           rev));
-
-  /* return absolute offsets */
-  if (root_offset)
-    *root_offset += rev_offset;
-  if (changes_offset)
-    *changes_offset += rev_offset;
-
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_fs_x__rev_get_root(svn_fs_id_t **root_id_p,
                        svn_fs_t *fs,
                        svn_revnum_t rev,
                        apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
   SVN_ERR(svn_fs_x__ensure_revision_exists(rev, fs, pool));
-
-  if (ffd->format < SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      apr_file_t *revision_file;
-      apr_off_t root_offset;
-      svn_fs_id_t *root_id = NULL;
-      svn_boolean_t is_cached;
-
-      SVN_ERR(svn_cache__get((void **) root_id_p, &is_cached,
-                            ffd->rev_root_id_cache, &rev, pool));
-      if (is_cached)
-        return SVN_NO_ERROR;
-
-      SVN_ERR(svn_fs_x__open_pack_or_rev_file(&revision_file, fs, rev, pool));
-
-      SVN_ERR(get_root_changes_offset(&root_offset, NULL, revision_file,
-                                      fs, rev, pool));
-      SVN_ERR(get_fs_id_at_offset(&root_id, revision_file, fs, rev,
-                                  root_offset, pool));
-
-      SVN_ERR(svn_io_file_close(revision_file, pool));
-
-      SVN_ERR(svn_cache__set(ffd->rev_root_id_cache, &rev, root_id, pool));
-
-      *root_id_p = root_id;
-    }
-  else
-    {
-      *root_id_p = svn_fs_x__id_create_root(rev, pool);
-    }
+  *root_id_p = svn_fs_x__id_create_root(rev, pool);
 
   return SVN_NO_ERROR;
 }
@@ -722,8 +556,7 @@ create_rep_state_body(rep_state_t **rep_
                                       rep->item_index, pool));
 
       /* is rep stored in some star-deltified container? */
-      if (! svn_fs_x__id_txn_used(&rep->txn_id)
-          && ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
+      if (! svn_fs_x__id_txn_used(&rep->txn_id))
         {
           svn_boolean_t in_container = TRUE;
           if (sub_item == 0)
@@ -785,9 +618,8 @@ create_rep_state_body(rep_state_t **rep_
 
       if (! svn_fs_x__id_txn_used(&rep->txn_id))
         {
-          if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-            SVN_ERR(block_read(NULL, fs, rep->revision, rep->item_index,
-                               rs->file->file, pool, pool));
+          SVN_ERR(block_read(NULL, fs, rep->revision, rep->item_index,
+                              rs->file->file, pool, pool));
           if (ffd->rep_header_cache)
             SVN_ERR(svn_cache__set(ffd->rep_header_cache, &key, rh, pool));
         }
@@ -1417,11 +1249,8 @@ 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))
     {
-      fs_x_data_t *ffd = rs->file->fs->fsap_data;
-      
-      if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-        SVN_ERR(block_read(NULL, rs->file->fs, rs->revision, rs->item_index,
-                           rs->file->file, pool, pool));
+      SVN_ERR(block_read(NULL, rs->file->fs, rs->revision, rs->item_index,
+                         rs->file->file, pool, pool));
 
       /* reading the whole block probably also provided us with the
          desired txdelta window */
@@ -2510,7 +2339,6 @@ svn_fs_x__get_changes(apr_array_header_t
                       svn_revnum_t rev,
                       apr_pool_t *pool)
 {
-  apr_off_t changes_offset;
   apr_file_t *revision_file;
   svn_boolean_t found;
   fs_x_data_t *ffd = fs->fsap_data;
@@ -2547,29 +2375,10 @@ svn_fs_x__get_changes(apr_array_header_t
       SVN_ERR(svn_fs_x__open_pack_or_rev_file(&revision_file, fs, rev,
                                               pool));
 
-      if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-        {
-          /* 'block-read' will also provide us with the desired data */
-          SVN_ERR(block_read((void **)changes, fs,
-                            rev, SVN_FS_FS__ITEM_INDEX_CHANGES,
-                            revision_file, pool, pool));
-        }
-      else
-        {
-          /* pre-format7 code path */
-          SVN_ERR(get_root_changes_offset(NULL, &changes_offset,
-                                          revision_file, fs, rev, pool));
-          SVN_ERR(svn_io_file_seek(revision_file, APR_SET, &changes_offset,
-                                   pool));
-          SVN_ERR(svn_fs_x__read_changes(changes,
-                      svn_stream_from_aprfile2(revision_file, TRUE, pool),
-                                          pool));
-
-          /* cache for future reference */
-
-          if (ffd->changes_cache)
-            SVN_ERR(svn_cache__set(ffd->changes_cache, &rev, *changes, pool));
-        }
+      /* 'block-read' will also provide us with the desired data */
+      SVN_ERR(block_read((void **)changes, fs,
+                         rev, SVN_FS_FS__ITEM_INDEX_CHANGES,
+                         revision_file, pool, pool));
 
       SVN_ERR(svn_io_file_close(revision_file, pool));
     }

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/caching.c?rev=1498393&r1=1498392&r2=1498393&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/caching.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/caching.c Mon Jul  1 11:59:37 2013
@@ -659,112 +659,98 @@ svn_fs_x__initialize_caches(svn_fs_t *fs
       ffd->combined_window_cache = NULL;
     }
 
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      SVN_ERR(create_cache(&(ffd->noderevs_container_cache),
-                           NULL,
-                           membuffer,
-                           0, 0, /* Do not use inprocess cache */
-                           svn_fs_x__serialize_noderevs_container,
-                           svn_fs_x__deserialize_noderevs_container,
-                           sizeof(pair_cache_key_t),
-                           apr_pstrcat(pool, prefix, "NODEREVSCNT",
-                                       (char *)NULL),
-                           SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
-                           fs,
-                           no_handler,
-                           fs->pool));
-      SVN_ERR(create_cache(&(ffd->changes_container_cache),
-                           NULL,
-                           membuffer,
-                           0, 0, /* Do not use inprocess cache */
-                           svn_fs_x__serialize_changes_container,
-                           svn_fs_x__deserialize_changes_container,
-                           sizeof(pair_cache_key_t),
-                           apr_pstrcat(pool, prefix, "CHANGESCNT",
-                                       (char *)NULL),
-                           0,
-                           fs,
-                           no_handler,
-                           fs->pool));
-      SVN_ERR(create_cache(&(ffd->reps_container_cache),
-                           NULL,
-                           membuffer,
-                           0, 0, /* Do not use inprocess cache */
-                           svn_fs_x__serialize_reps_container,
-                           svn_fs_x__deserialize_reps_container,
-                           sizeof(pair_cache_key_t),
-                           apr_pstrcat(pool, prefix, "REPSCNT",
-                                       (char *)NULL),
-                           0,
-                           fs,
-                           no_handler,
-                           fs->pool));
-
-      SVN_ERR(create_cache(&(ffd->l2p_header_cache),
-                           NULL,
-                           membuffer,
-                           0, 0, /* Do not use inprocess cache */
-                           svn_fs_x__serialize_l2p_header,
-                           svn_fs_x__deserialize_l2p_header,
-                           sizeof(pair_cache_key_t),
-                           apr_pstrcat(pool, prefix, "L2P_HEADER",
-                                       (char *)NULL),
-                           SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
-                           fs,
-                           no_handler,
-                           fs->pool));
-      SVN_ERR(create_cache(&(ffd->l2p_page_cache),
-                           NULL,
-                           membuffer,
-                           0, 0, /* Do not use inprocess cache */
-                           svn_fs_x__serialize_l2p_page,
-                           svn_fs_x__deserialize_l2p_page,
-                           sizeof(svn_fs_x__page_cache_key_t),
-                           apr_pstrcat(pool, prefix, "L2P_PAGE",
-                                       (char *)NULL),
-                           SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
-                           fs,
-                           no_handler,
-                           fs->pool));
-      SVN_ERR(create_cache(&(ffd->p2l_header_cache),
-                           NULL,
-                           membuffer,
-                           0, 0, /* Do not use inprocess cache */
-                           svn_fs_x__serialize_p2l_header,
-                           svn_fs_x__deserialize_p2l_header,
-                           sizeof(pair_cache_key_t),
-                           apr_pstrcat(pool, prefix, "P2L_HEADER",
-                                       (char *)NULL),
-                           SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
-                           fs,
-                           no_handler,
-                           fs->pool));
-      SVN_ERR(create_cache(&(ffd->p2l_page_cache),
-                           NULL,
-                           membuffer,
-                           0, 0, /* Do not use inprocess cache */
-                           svn_fs_x__serialize_p2l_page,
-                           svn_fs_x__deserialize_p2l_page,
-                           sizeof(svn_fs_x__page_cache_key_t),
-                           apr_pstrcat(pool, prefix, "P2L_PAGE",
-                                       (char *)NULL),
-                           SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
-                           fs,
-                           no_handler,
-                           fs->pool));
-    }
-  else
-    {
-      ffd->noderevs_container_cache = NULL;
-      ffd->changes_container_cache = NULL;
-      ffd->reps_container_cache = NULL;
-
-      ffd->l2p_header_cache = NULL;
-      ffd->l2p_page_cache = NULL;
-      ffd->p2l_header_cache = NULL;
-      ffd->p2l_page_cache = NULL;
-    }
+  SVN_ERR(create_cache(&(ffd->noderevs_container_cache),
+                       NULL,
+                       membuffer,
+                       0, 0, /* Do not use inprocess cache */
+                       svn_fs_x__serialize_noderevs_container,
+                       svn_fs_x__deserialize_noderevs_container,
+                       sizeof(pair_cache_key_t),
+                       apr_pstrcat(pool, prefix, "NODEREVSCNT",
+                                   (char *)NULL),
+                       SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
+                       fs,
+                       no_handler,
+                       fs->pool));
+  SVN_ERR(create_cache(&(ffd->changes_container_cache),
+                       NULL,
+                       membuffer,
+                       0, 0, /* Do not use inprocess cache */
+                       svn_fs_x__serialize_changes_container,
+                       svn_fs_x__deserialize_changes_container,
+                       sizeof(pair_cache_key_t),
+                       apr_pstrcat(pool, prefix, "CHANGESCNT",
+                                   (char *)NULL),
+                       0,
+                       fs,
+                       no_handler,
+                       fs->pool));
+  SVN_ERR(create_cache(&(ffd->reps_container_cache),
+                       NULL,
+                       membuffer,
+                       0, 0, /* Do not use inprocess cache */
+                       svn_fs_x__serialize_reps_container,
+                       svn_fs_x__deserialize_reps_container,
+                       sizeof(pair_cache_key_t),
+                       apr_pstrcat(pool, prefix, "REPSCNT",
+                                   (char *)NULL),
+                       0,
+                       fs,
+                       no_handler,
+                       fs->pool));
+
+  SVN_ERR(create_cache(&(ffd->l2p_header_cache),
+                       NULL,
+                       membuffer,
+                       0, 0, /* Do not use inprocess cache */
+                       svn_fs_x__serialize_l2p_header,
+                       svn_fs_x__deserialize_l2p_header,
+                       sizeof(pair_cache_key_t),
+                       apr_pstrcat(pool, prefix, "L2P_HEADER",
+                                   (char *)NULL),
+                       SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
+                       fs,
+                       no_handler,
+                       fs->pool));
+  SVN_ERR(create_cache(&(ffd->l2p_page_cache),
+                       NULL,
+                       membuffer,
+                       0, 0, /* Do not use inprocess cache */
+                       svn_fs_x__serialize_l2p_page,
+                       svn_fs_x__deserialize_l2p_page,
+                       sizeof(svn_fs_x__page_cache_key_t),
+                       apr_pstrcat(pool, prefix, "L2P_PAGE",
+                                   (char *)NULL),
+                       SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
+                       fs,
+                       no_handler,
+                       fs->pool));
+  SVN_ERR(create_cache(&(ffd->p2l_header_cache),
+                       NULL,
+                       membuffer,
+                       0, 0, /* Do not use inprocess cache */
+                       svn_fs_x__serialize_p2l_header,
+                       svn_fs_x__deserialize_p2l_header,
+                       sizeof(pair_cache_key_t),
+                       apr_pstrcat(pool, prefix, "P2L_HEADER",
+                                   (char *)NULL),
+                       SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
+                       fs,
+                       no_handler,
+                       fs->pool));
+  SVN_ERR(create_cache(&(ffd->p2l_page_cache),
+                       NULL,
+                       membuffer,
+                       0, 0, /* Do not use inprocess cache */
+                       svn_fs_x__serialize_p2l_page,
+                       svn_fs_x__deserialize_p2l_page,
+                       sizeof(svn_fs_x__page_cache_key_t),
+                       apr_pstrcat(pool, prefix, "P2L_PAGE",
+                                   (char *)NULL),
+                       SVN_CACHE__MEMBUFFER_HIGH_PRIORITY,
+                       fs,
+                       no_handler,
+                       fs->pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs.h?rev=1498393&r1=1498392&r2=1498393&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs.h Mon Jul  1 11:59:37 2013
@@ -160,9 +160,6 @@ extern "C" {
 /* The minimum format number that supports packed revprops. */
 #define SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT 6
 
-/* The minimum format number that supports packed revprops. */
-#define SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT 7
-
 /* The minimum format number that supports a configuration file (fsfs.conf) */
 #define SVN_FS_FS__MIN_CONFIG_FILE 4
 

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs_x.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs_x.c?rev=1498393&r1=1498392&r2=1498393&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs_x.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs_x.c Mon Jul  1 11:59:37 2013
@@ -327,32 +327,22 @@ read_config(fs_x_data_t *ffd,
       ffd->compress_packed_revprops = FALSE;
     }
 
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      SVN_ERR(svn_config_get_int64(ffd->config, &ffd->block_size,
-                                   CONFIG_SECTION_IO,
-                                   CONFIG_OPTION_BLOCK_SIZE,
-                                   64));
-      SVN_ERR(svn_config_get_int64(ffd->config, &ffd->l2p_page_size,
-                                   CONFIG_SECTION_IO,
-                                   CONFIG_OPTION_L2P_PAGE_SIZE,
-                                   0x2000));
-      SVN_ERR(svn_config_get_int64(ffd->config, &ffd->p2l_page_size,
-                                   CONFIG_SECTION_IO,
-                                   CONFIG_OPTION_P2L_PAGE_SIZE,
-                                   64));
+  SVN_ERR(svn_config_get_int64(ffd->config, &ffd->block_size,
+                                CONFIG_SECTION_IO,
+                                CONFIG_OPTION_BLOCK_SIZE,
+                                64));
+  SVN_ERR(svn_config_get_int64(ffd->config, &ffd->l2p_page_size,
+                                CONFIG_SECTION_IO,
+                                CONFIG_OPTION_L2P_PAGE_SIZE,
+                                0x2000));
+  SVN_ERR(svn_config_get_int64(ffd->config, &ffd->p2l_page_size,
+                                CONFIG_SECTION_IO,
+                                CONFIG_OPTION_P2L_PAGE_SIZE,
+                                64));
+
+  ffd->block_size *= 0x400;
+  ffd->p2l_page_size *= 0x400;
 
-      ffd->block_size *= 0x400;
-      ffd->p2l_page_size *= 0x400;
-    }
-  else
-    {
-      /* should be irrelevant but we initialize them anyway */
-      ffd->block_size = 0x1000;
-      ffd->l2p_page_size = 0x2000;
-      ffd->p2l_page_size = 0x1000;
-    }
-  
   return SVN_NO_ERROR;
 }
 
@@ -944,59 +934,45 @@ write_revision_zero(svn_fs_t *fs)
   const char *path_revision_zero = svn_fs_x__path_rev(fs, 0, fs->pool);
   apr_hash_t *proplist;
   svn_string_t date;
-  fs_x_data_t *ffd = fs->fsap_data;
+  const char *path;
 
   /* Write out a rev file for revision 0. */
-  if (ffd->format < SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    SVN_ERR(svn_io_file_create(path_revision_zero,
-                               "PLAIN\nEND\nENDREP\n"
-                               "id: 0.0.r0/17\n"
-                               "type: dir\n"
-                               "count: 0\n"
-                               "text: 0 0 4 4 "
-                               "2d2977d1c96f487abe4a1e202dd03b4e\n"
-                               "cpath: /\n"
-                               "\n\n17 107\n", fs->pool));
-  else
-    SVN_ERR(svn_io_file_create(path_revision_zero,
-                               "PLAIN\nEND\nENDREP\n"
-                               "id: 0.0.r0/2\n"
-                               "type: dir\n"
-                               "count: 0\n"
-                               "text: 0 3 4 4 "
-                               "2d2977d1c96f487abe4a1e202dd03b4e\n"
-                               "cpath: /\n"
-                               "\n\n", fs->pool));
+  SVN_ERR(svn_io_file_create(path_revision_zero,
+                             "PLAIN\nEND\nENDREP\n"
+                             "id: 0.0.r0/2\n"
+                             "type: dir\n"
+                             "count: 0\n"
+                             "text: 0 3 4 4 "
+                             "2d2977d1c96f487abe4a1e202dd03b4e\n"
+                             "cpath: /\n"
+                             "\n\n", fs->pool));
 
   SVN_ERR(svn_io_set_file_read_only(path_revision_zero, FALSE, fs->pool));
 
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      const char *path = svn_fs_x__path_l2p_index(fs, 0, fs->pool);
-      SVN_ERR(svn_io_file_create_binary
-                 (path,
-                  "\0\1\x80\x40\1\1" /* rev 0, single page */
-                  "\5\4"             /* page size: bytes, count */
-                  "\0"               /* 0 container offsets in list */
-                  "\0\x6b\x12\1",    /* phys offsets + 1 */
-                  13,
-                  fs->pool));
-      SVN_ERR(svn_io_set_file_read_only(path, FALSE, fs->pool));
-
-      path = svn_fs_x__path_p2l_index(fs, 0, fs->pool);
-      SVN_ERR(svn_io_file_create_binary
-                 (path,
-                  "\0"                /* start rev */
-                  "\x80\x80\4\1\x11"  /* 64k pages, 1 page using 17 bytes */
-                  "\0"                /* offset entry 0 page 1 */
-                  "\x11\x11\0\6"      /* len, type + 16 * count, (rev, item)* */
-                  "\x59\x15\0\4"
-                  "\1\x16\0\2"
-                  "\x95\xff\3\0",     /* last entry fills up 64k page */
-                  23,
-                  fs->pool));
-      SVN_ERR(svn_io_set_file_read_only(path, FALSE, fs->pool));
-    }
+  path = svn_fs_x__path_l2p_index(fs, 0, fs->pool);
+  SVN_ERR(svn_io_file_create_binary
+              (path,
+              "\0\1\x80\x40\1\1" /* rev 0, single page */
+              "\5\4"             /* page size: bytes, count */
+              "\0"               /* 0 container offsets in list */
+              "\0\x6b\x12\1",    /* phys offsets + 1 */
+              13,
+              fs->pool));
+  SVN_ERR(svn_io_set_file_read_only(path, FALSE, fs->pool));
+
+  path = svn_fs_x__path_p2l_index(fs, 0, fs->pool);
+  SVN_ERR(svn_io_file_create_binary
+              (path,
+              "\0"                /* start rev */
+              "\x80\x80\4\1\x11"  /* 64k pages, 1 page using 17 bytes */
+              "\0"                /* offset entry 0 page 1 */
+              "\x11\x11\0\6"      /* len, type + 16 * count, (rev, item)* */
+              "\x59\x15\0\4"
+              "\1\x16\0\2"
+              "\x95\xff\3\0",     /* last entry fills up 64k page */
+              23,
+              fs->pool));
+  SVN_ERR(svn_io_set_file_read_only(path, FALSE, fs->pool));
 
   /* Set a date on revision 0. */
   date.data = svn_time_to_cstring(apr_time_now(), fs->pool);

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/index.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/index.c?rev=1498393&r1=1498392&r2=1498393&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/index.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/index.c Mon Jul  1 11:59:37 2013
@@ -2683,30 +2683,12 @@ svn_fs_x__item_offset(apr_off_t *offset,
                       apr_uint64_t item_index,
                       apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
-  if (ffd->format < SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      /* older fsfs formats don't have containers */
-      *sub_item = 0;
-
-      /* older fsfs formats use the manifest file to re-map the offsets */
-      *offset = (apr_off_t)item_index;
-      if (!txn_id && svn_fs_x__is_packed_rev(fs, revision))
-        {
-          apr_off_t rev_offset;
-
-          SVN_ERR(svn_fs_x__get_packed_offset(&rev_offset, fs, revision,
-                                              pool));
-          *offset += rev_offset;
-        }
-    }
+  if (txn_id)
+    SVN_ERR(l2p_proto_index_lookup(offset, sub_item,
+                                   fs, txn_id, item_index, pool));
   else
-    if (txn_id)
-      SVN_ERR(l2p_proto_index_lookup(offset, sub_item,
-                                     fs, txn_id, item_index, pool));
-    else
-      SVN_ERR(l2p_index_lookup(offset, sub_item,
-                               fs, revision, item_index, pool));
+    SVN_ERR(l2p_index_lookup(offset, sub_item,
+                             fs, revision, item_index, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/pack.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/pack.c?rev=1498393&r1=1498392&r2=1498393&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/pack.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/pack.c Mon Jul  1 11:59:37 2013
@@ -237,7 +237,6 @@ initialize_pack_context(pack_context_t *
   const char *temp_dir;
   apr_size_t max_revs = MIN(ffd->max_files_per_dir, (int)max_items);
   
-  SVN_ERR_ASSERT(ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT);
   SVN_ERR_ASSERT(shard_rev % ffd->max_files_per_dir == 0);
   
   /* where we will place our various temp files */
@@ -588,8 +587,8 @@ copy_rep_to_temp(pack_context_t *context
  * trunk-related items are more likely to be contiguous.
  */
 static int
-compare_dir_entries_format7(const svn_sort__item_t *a,
-                            const svn_sort__item_t *b)
+compare_dir_entries(const svn_sort__item_t *a,
+                    const svn_sort__item_t *b)
 {
   const svn_fs_dirent_t *lhs = (const svn_fs_dirent_t *) a->value;
   const svn_fs_dirent_t *rhs = (const svn_fs_dirent_t *) b->value;
@@ -600,42 +599,13 @@ compare_dir_entries_format7(const svn_so
   return 0 - strcmp(lhs->name, rhs->name);
 }
 
-/* Directories entries sorted by revision (decreasing - to max cache hits)
- * and offset (increasing - to max benefit from APR file buffering).
- */
-static int
-compare_dir_entries_format6(const svn_sort__item_t *a,
-                            const svn_sort__item_t *b)
-{
-  const svn_fs_dirent_t *lhs = (const svn_fs_dirent_t *) a->value;
-  const svn_fs_dirent_t *rhs = (const svn_fs_dirent_t *) b->value;
-
-  const svn_fs_x__id_part_t *lhs_rev_item = svn_fs_x__id_rev_item(lhs->id);
-  const svn_fs_x__id_part_t *rhs_rev_item = svn_fs_x__id_rev_item(rhs->id);
-
-  /* decreasing ("reverse") order on revs */
-  if (lhs_rev_item->revision != rhs_rev_item->revision)
-    return lhs_rev_item->revision > rhs_rev_item->revision ? -1 : 1;
-
-  /* increasing order on offsets */
-  if (lhs_rev_item->number != rhs_rev_item->number)
-    return lhs_rev_item->number > rhs_rev_item->number ? 1 : -1;
-
-  return 0;
-}
-
 apr_array_header_t *
 svn_fs_x__order_dir_entries(svn_fs_t *fs,
                             apr_hash_t *directory,
                             apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
   apr_array_header_t *ordered
-    = svn_sort__hash(directory,
-                     ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT
-                       ? compare_dir_entries_format7
-                       : compare_dir_entries_format6,
-                     pool);
+    = svn_sort__hash(directory, compare_dir_entries, pool);
 
   apr_array_header_t *result
     = apr_array_make(pool, ordered->nelts, sizeof(svn_fs_dirent_t *));
@@ -2137,82 +2107,6 @@ svn_fs_x__get_packed_offset(apr_off_t *r
   return svn_cache__set(ffd->packed_offset_cache, &shard, manifest, pool);
 }
 
-/* Format 6 and earlier packing logic:  Simply concatenate all revision
- * contents.
- * 
- * Pack the revision shard starting at SHARD_REV containing exactly
- * MAX_FILES_PER_DIR revisions from SHARD_PATH into the PACK_FILE_DIR,
- * using POOL for allocations.  CANCEL_FUNC and CANCEL_BATON are what you
- * think they are.
- */
-static svn_error_t *
-pack_phys_addressed(const char *pack_file_dir,
-                    const char *shard_path,
-                    svn_revnum_t start_rev,
-                    int max_files_per_dir,
-                    svn_cancel_func_t cancel_func,
-                    void *cancel_baton,
-                    apr_pool_t *pool)
-{
-  const char *pack_file_path, *manifest_file_path;
-  svn_stream_t *pack_stream, *manifest_stream;
-  svn_revnum_t end_rev, rev;
-  apr_off_t next_offset;
-  apr_pool_t *iterpool;
-
-  /* Some useful paths. */
-  pack_file_path = svn_dirent_join(pack_file_dir, PATH_PACKED, pool);
-  manifest_file_path = svn_dirent_join(pack_file_dir, PATH_MANIFEST, pool);
-
-  /* Create the new directory and pack file. */
-  SVN_ERR(svn_stream_open_writable(&pack_stream, pack_file_path, pool,
-                                    pool));
-
-  /* Create the manifest file. */
-  SVN_ERR(svn_stream_open_writable(&manifest_stream, manifest_file_path,
-                                   pool, pool));
-
-  end_rev = start_rev + max_files_per_dir - 1;
-  next_offset = 0;
-  iterpool = svn_pool_create(pool);
-
-  /* Iterate over the revisions in this shard, squashing them together. */
-  for (rev = start_rev; rev <= end_rev; rev++)
-    {
-      svn_stream_t *rev_stream;
-      apr_finfo_t finfo;
-      const char *path;
-
-      svn_pool_clear(iterpool);
-
-      /* Get the size of the file. */
-      path = svn_dirent_join(shard_path, apr_psprintf(iterpool, "%ld", rev),
-                             iterpool);
-      SVN_ERR(svn_io_stat(&finfo, path, APR_FINFO_SIZE, iterpool));
-
-      /* build manifest */
-      SVN_ERR(svn_stream_printf(manifest_stream, iterpool,
-                                "%" APR_OFF_T_FMT "\n", next_offset));
-      next_offset += finfo.size;
-
-      /* Copy all the bits from the rev file to the end of the pack file. */
-      SVN_ERR(svn_stream_open_readonly(&rev_stream, path, iterpool, iterpool));
-      SVN_ERR(svn_stream_copy3(rev_stream, svn_stream_disown(pack_stream,
-                                                             iterpool),
-                               cancel_func, cancel_baton, iterpool));
-    }
-
-  /* disallow write access to the manifest file */
-  SVN_ERR(svn_stream_close(manifest_stream));
-  SVN_ERR(svn_io_set_file_read_only(manifest_file_path, FALSE, iterpool));
-
-  SVN_ERR(svn_stream_close(pack_stream));
-
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
 /* In filesystem FS, pack the revision SHARD containing exactly
  * MAX_FILES_PER_DIR revisions from SHARD_PATH into the PACK_FILE_DIR,
  * using POOL for allocations.  Try to limit the amount of temporary
@@ -2235,7 +2129,6 @@ pack_rev_shard(svn_fs_t *fs,
                void *cancel_baton,
                apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
   const char *pack_file_path;
   svn_revnum_t shard_rev = (svn_revnum_t) (shard * max_files_per_dir);
 
@@ -2250,14 +2143,9 @@ pack_rev_shard(svn_fs_t *fs,
   SVN_ERR(svn_io_dir_make(pack_file_dir, APR_OS_DEFAULT, pool));
 
   /* Index information files */
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    SVN_ERR(pack_log_addressed(fs, pack_file_dir, shard_path, shard_rev,
-                               max_mem, cancel_func, cancel_baton, pool));
-  else
-    SVN_ERR(pack_phys_addressed(pack_file_dir, shard_path, shard_rev,
-                                max_files_per_dir, cancel_func,
-                                cancel_baton, pool));
-  
+  SVN_ERR(pack_log_addressed(fs, pack_file_dir, shard_path, shard_rev,
+                              max_mem, cancel_func, cancel_baton, pool));
+
   SVN_ERR(svn_io_copy_perms(shard_path, pack_file_dir, pool));
   SVN_ERR(svn_io_set_file_read_only(pack_file_path, FALSE, pool));
 

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/transaction.c?rev=1498393&r1=1498392&r2=1498393&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/transaction.c Mon Jul  1 11:59:37 2013
@@ -1588,16 +1588,12 @@ store_l2p_index_entry(svn_fs_t *fs,
                       apr_uint64_t item_index,
                       apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      const char *path = svn_fs_x__path_l2p_proto_index(fs, txn_id, pool);
-      apr_file_t *file;
-      SVN_ERR(svn_fs_x__l2p_proto_index_open(&file, path, pool));
-      SVN_ERR(svn_fs_x__l2p_proto_index_add_entry(file, offset, 0,
-                                                  item_index, pool));
-      SVN_ERR(svn_io_file_close(file, pool));
-    }
+  const char *path = svn_fs_x__path_l2p_proto_index(fs, txn_id, pool);
+  apr_file_t *file;
+  SVN_ERR(svn_fs_x__l2p_proto_index_open(&file, path, pool));
+  SVN_ERR(svn_fs_x__l2p_proto_index_add_entry(file, offset, 0,
+                                              item_index, pool));
+  SVN_ERR(svn_io_file_close(file, pool));
 
   return SVN_NO_ERROR;
 }
@@ -1612,15 +1608,11 @@ store_p2l_index_entry(svn_fs_t *fs,
                       svn_fs_x__p2l_entry_t *entry,
                       apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      const char *path = svn_fs_x__path_p2l_proto_index(fs, txn_id, pool);
-      apr_file_t *file;
-      SVN_ERR(svn_fs_x__p2l_proto_index_open(&file, path, pool));
-      SVN_ERR(svn_fs_x__p2l_proto_index_add_entry(file, entry, pool));
-      SVN_ERR(svn_io_file_close(file, pool));
-    }
+  const char *path = svn_fs_x__path_p2l_proto_index(fs, txn_id, pool);
+  apr_file_t *file;
+  SVN_ERR(svn_fs_x__p2l_proto_index_open(&file, path, pool));
+  SVN_ERR(svn_fs_x__p2l_proto_index_add_entry(file, entry, pool));
+  SVN_ERR(svn_io_file_close(file, pool));
 
   return SVN_NO_ERROR;
 }
@@ -1639,42 +1631,34 @@ allocate_item_index(apr_uint64_t *item_i
                     apr_off_t my_offset,
                     apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
-  if (ffd->format < SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      *item_index = (apr_uint64_t)my_offset;
-    }
+  apr_file_t *file;
+  char buffer[SVN_INT64_BUFFER_SIZE] = { 0 };
+  svn_boolean_t eof = FALSE;
+  apr_size_t to_write;
+  apr_size_t read;
+  apr_off_t offset = 0;
+
+  /* read number, increment it and write it back to disk */
+  SVN_ERR(svn_io_file_open(&file,
+                            svn_fs_x__path_txn_item_index(fs, txn_id, pool),
+                            APR_READ | APR_WRITE
+                            | APR_CREATE | APR_BUFFERED,
+                            APR_OS_DEFAULT, pool));
+  SVN_ERR(svn_io_file_read_full2(file, buffer, sizeof(buffer)-1,
+                                  &read, &eof, pool));
+  if (read)
+    SVN_ERR(svn_cstring_atoui64(item_index, buffer));
   else
-    {
-      apr_file_t *file;
-      char buffer[SVN_INT64_BUFFER_SIZE] = { 0 };
-      svn_boolean_t eof = FALSE;
-      apr_size_t to_write;
-      apr_size_t read;
-      apr_off_t offset = 0;
-
-      /* read number, increment it and write it back to disk */
-      SVN_ERR(svn_io_file_open(&file,
-                               svn_fs_x__path_txn_item_index(fs, txn_id, pool),
-                               APR_READ | APR_WRITE
-                               | APR_CREATE | APR_BUFFERED,
-                               APR_OS_DEFAULT, pool));
-      SVN_ERR(svn_io_file_read_full2(file, buffer, sizeof(buffer)-1,
-                                     &read, &eof, pool));
-      if (read)
-        SVN_ERR(svn_cstring_atoui64(item_index, buffer));
-      else
-        *item_index = SVN_FS_FS__ITEM_INDEX_FIRST_USER;
+    *item_index = SVN_FS_FS__ITEM_INDEX_FIRST_USER;
 
-      to_write = svn__ui64toa(buffer, *item_index + 1);
-      SVN_ERR(svn_io_file_seek(file, SEEK_SET, &offset, pool));
-      SVN_ERR(svn_io_file_write_full(file, buffer, to_write, NULL, pool));
-      SVN_ERR(svn_io_file_close(file, pool));
-
-      /* write log-to-phys index */
-      SVN_ERR(store_l2p_index_entry(fs, txn_id, my_offset, *item_index,
-                                    pool));
-    }
+  to_write = svn__ui64toa(buffer, *item_index + 1);
+  SVN_ERR(svn_io_file_seek(file, SEEK_SET, &offset, pool));
+  SVN_ERR(svn_io_file_write_full(file, buffer, to_write, NULL, pool));
+  SVN_ERR(svn_io_file_close(file, pool));
+
+  /* write log-to-phys index */
+  SVN_ERR(store_l2p_index_entry(fs, txn_id, my_offset, *item_index,
+                                pool));
 
   return SVN_NO_ERROR;
 }
@@ -2688,6 +2672,8 @@ write_final_rev(const svn_fs_id_t **new_
   svn_fs_x__id_part_t node_id, copy_id, rev_item;
   fs_x_data_t *ffd = fs->fsap_data;
   const svn_fs_x__id_part_t *txn_id = svn_fs_x__id_txn_id(id);
+  svn_fs_x__p2l_entry_t entry;
+
   *new_id_p = NULL;
 
   /* Check to see if this is a transaction node. */
@@ -2759,17 +2745,6 @@ write_final_rev(const svn_fs_id_t **new_
         {
           svn_fs_x__id_txn_reset(&noderev->data_rep->txn_id);
           noderev->data_rep->revision = rev;
-
-          if (ffd->format < SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-            {
-              /* See issue 3845.  Some unknown mechanism caused the
-                 protorev file to get truncated, so check for that
-                 here.  */
-              if (noderev->data_rep->item_index + noderev->data_rep->size
-                  > initial_offset)
-                return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
-                                        _("Truncated protorev file detected"));
-            }
         }
     }
 
@@ -2805,15 +2780,10 @@ write_final_rev(const svn_fs_id_t **new_
     noderev->copyroot_rev = rev;
 
   SVN_ERR(svn_fs_x__get_file_offset(&my_offset, file, pool));
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT && at_root)
-    {
-      /* reference the root noderev from the log-to-phys index */
-      rev_item.number = SVN_FS_FS__ITEM_INDEX_ROOT_NODE;
-      SVN_ERR(store_l2p_index_entry(fs, txn_id, my_offset, rev_item.number,
-                                    pool));
-    }
-  else
-    SVN_ERR(allocate_item_index(&rev_item.number, fs, txn_id, my_offset,
+
+  /* reference the root noderev from the log-to-phys index */
+  rev_item.number = SVN_FS_FS__ITEM_INDEX_ROOT_NODE;
+  SVN_ERR(store_l2p_index_entry(fs, txn_id, my_offset, rev_item.number,
                                 pool));
 
   rev_item.revision = rev;
@@ -2869,20 +2839,16 @@ write_final_rev(const svn_fs_id_t **new_
                                   pool));
 
   /* reference the root noderev from the log-to-phys index */
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      svn_fs_x__p2l_entry_t entry;
-      rev_item.revision = SVN_INVALID_REVNUM;
+  rev_item.revision = SVN_INVALID_REVNUM;
 
-      entry.offset = my_offset;
-      SVN_ERR(svn_fs_x__get_file_offset(&my_offset, file, pool));
-      entry.size = my_offset - entry.offset;
-      entry.type = SVN_FS_FS__ITEM_TYPE_NODEREV;
-      entry.item_count = 1;
-      entry.items = &rev_item;
+  entry.offset = my_offset;
+  SVN_ERR(svn_fs_x__get_file_offset(&my_offset, file, pool));
+  entry.size = my_offset - entry.offset;
+  entry.type = SVN_FS_FS__ITEM_TYPE_NODEREV;
+  entry.item_count = 1;
+  entry.items = &rev_item;
 
-      SVN_ERR(store_p2l_index_entry(fs, txn_id, &entry, pool));
-    }
+  SVN_ERR(store_p2l_index_entry(fs, txn_id, &entry, pool));
 
   /* Return our ID that references the revision file. */
   *new_id_p = noderev->id;
@@ -2903,35 +2869,28 @@ write_final_changed_path_info(apr_off_t 
 {
   apr_hash_t *changed_paths;
   apr_off_t offset;
-  fs_x_data_t *ffd = fs->fsap_data;
+  svn_fs_x__p2l_entry_t entry;
+  svn_fs_x__id_part_t rev_item
+    = {SVN_INVALID_REVNUM, SVN_FS_FS__ITEM_INDEX_CHANGES};
 
   SVN_ERR(svn_fs_x__get_file_offset(&offset, file, pool));
-
   SVN_ERR(svn_fs_x__txn_changes_fetch(&changed_paths, fs, txn_id, pool));
-
   SVN_ERR(svn_fs_x__write_changes(svn_stream_from_aprfile2(file, TRUE, pool),
                                   fs, changed_paths, TRUE, pool));
 
   *offset_p = offset;
 
   /* reference changes from the indexes */
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      svn_fs_x__p2l_entry_t entry;
-      svn_fs_x__id_part_t rev_item
-        = {SVN_INVALID_REVNUM, SVN_FS_FS__ITEM_INDEX_CHANGES};
-
-      entry.offset = offset;
-      SVN_ERR(svn_fs_x__get_file_offset(&offset, file, pool));
-      entry.size = offset - entry.offset;
-      entry.type = SVN_FS_FS__ITEM_TYPE_CHANGES;
-      entry.item_count = 1;
-      entry.items = &rev_item;
-
-      SVN_ERR(store_p2l_index_entry(fs, txn_id, &entry, pool));
-      SVN_ERR(store_l2p_index_entry(fs, txn_id, entry.offset,
-                                    SVN_FS_FS__ITEM_INDEX_CHANGES, pool));
-    }
+  entry.offset = offset;
+  SVN_ERR(svn_fs_x__get_file_offset(&offset, file, pool));
+  entry.size = offset - entry.offset;
+  entry.type = SVN_FS_FS__ITEM_TYPE_CHANGES;
+  entry.item_count = 1;
+  entry.items = &rev_item;
+
+  SVN_ERR(store_p2l_index_entry(fs, txn_id, &entry, pool));
+  SVN_ERR(store_l2p_index_entry(fs, txn_id, entry.offset,
+                                SVN_FS_FS__ITEM_INDEX_CHANGES, pool));
 
   return SVN_NO_ERROR;
 }
@@ -3156,29 +3115,6 @@ commit_body(void *baton, apr_pool_t *poo
   SVN_ERR(write_final_changed_path_info(&changed_path_offset, proto_file,
                                         cb->fs, txn_id, pool));
 
-  if (ffd->format < SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      /* Write the final line. */
-
-      svn_stringbuf_t *trailer;
-      apr_off_t root_offset;
-      apr_uint32_t sub_item;
-      SVN_ERR(svn_fs_x__item_offset(&root_offset,
-                                    &sub_item,
-                                    cb->fs,
-                                    svn_fs_x__id_rev(new_root_id),
-                                    NULL,
-                                    svn_fs_x__id_item(new_root_id),
-                                    pool));
-      SVN_ERR_ASSERT(sub_item == 0);
-      trailer = svn_fs_x__unparse_revision_trailer
-                  (root_offset,
-                   changed_path_offset,
-                   pool);
-      SVN_ERR(svn_io_file_write_full(proto_file, trailer->data, trailer->len,
-                                     NULL, pool));
-    }
-
   SVN_ERR(svn_io_file_flush_to_disk(proto_file, pool));
   SVN_ERR(svn_io_file_close(proto_file, pool));
 
@@ -3241,19 +3177,16 @@ commit_body(void *baton, apr_pool_t *poo
         }
     }
 
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      /* Convert the index files from the proto format into their form
-         in their final location */
-      SVN_ERR(svn_fs_x__l2p_index_create(cb->fs,
-                       svn_fs_x__path_l2p_index(cb->fs, new_rev, pool),
-                       svn_fs_x__path_l2p_proto_index(cb->fs, txn_id, pool),
-                       new_rev, pool));
-      SVN_ERR(svn_fs_x__p2l_index_create(cb->fs,
-                       svn_fs_x__path_p2l_index(cb->fs, new_rev, pool),
-                       svn_fs_x__path_p2l_proto_index(cb->fs, txn_id, pool),
-                       new_rev, pool));
-    }
+  /* Convert the index files from the proto format into their form
+      in their final location */
+  SVN_ERR(svn_fs_x__l2p_index_create(cb->fs,
+                    svn_fs_x__path_l2p_index(cb->fs, new_rev, pool),
+                    svn_fs_x__path_l2p_proto_index(cb->fs, txn_id, pool),
+                    new_rev, pool));
+  SVN_ERR(svn_fs_x__p2l_index_create(cb->fs,
+                    svn_fs_x__path_p2l_index(cb->fs, new_rev, pool),
+                    svn_fs_x__path_p2l_proto_index(cb->fs, txn_id, pool),
+                    new_rev, pool));
 
   /* Move the finished rev file into place. */
   old_rev_filename = svn_fs_x__path_rev_absolute(cb->fs, old_rev, pool);

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/verify.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/verify.c?rev=1498393&r1=1498392&r2=1498393&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/verify.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/verify.c Mon Jul  1 11:59:37 2013
@@ -384,10 +384,9 @@ svn_fs_x__verify(svn_fs_t *fs,
 
   /* log/phys index consistency.  We need to check them first to make
      sure we can access the rev / pack files in format7. */
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    SVN_ERR(verify_index_consistency(fs, start, end,
-                                     notify_func, notify_baton,
-                                     cancel_func, cancel_baton, pool));
+  SVN_ERR(verify_index_consistency(fs, start, end,
+                                   notify_func, notify_baton,
+                                   cancel_func, cancel_baton, pool));
 
   /* rep cache consistency */
   if (ffd->format >= SVN_FS_FS__MIN_REP_SHARING_FORMAT)