subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1498165 [5/5] - in /subversion/branches/fsfs-format7/subversion: libsvn_fs_fs/ tests/libsvn_fs_fs/
Date Sun, 30 Jun 2013 17:44:56 GMT
Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c?rev=1498165&r1=1498164&r2=1498165&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c Sun Jun 30 17:44:56
2013
@@ -1563,107 +1563,6 @@ svn_fs_fs__add_change(svn_fs_t *fs,
   return svn_io_file_close(file, pool);
 }
 
-/* If it is supported by the format of file system FS, store the (ITEM_INDEX,
- * OFFSET) pair in the log-to-phys proto index file of transaction TXN_ID.
- * Use POOL for allocations.
- */
-static svn_error_t *
-store_l2p_index_entry(svn_fs_t *fs,
-                      const svn_fs_fs__id_part_t *txn_id,
-                      apr_off_t offset,
-                      apr_uint64_t item_index,
-                      apr_pool_t *pool)
-{
-  fs_fs_data_t *ffd = fs->fsap_data;
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      const char *path = path_l2p_proto_index(fs, txn_id, pool);
-      apr_file_t *file;
-      SVN_ERR(svn_fs_fs__l2p_proto_index_open(&file, path, pool));
-      SVN_ERR(svn_fs_fs__l2p_proto_index_add_entry(file, offset, 0,
-                                                   item_index, pool));
-      SVN_ERR(svn_io_file_close(file, pool));
-    }
-
-  return SVN_NO_ERROR;
-}
-
-/* If it is supported by the format of file system FS, store ENTRY in the
- * phys-to-log proto index file of transaction TXN_ID.
- * Use POOL for allocations.
- */
-static svn_error_t *
-store_p2l_index_entry(svn_fs_t *fs,
-                      const svn_fs_fs__id_part_t *txn_id,
-                      svn_fs_fs__p2l_entry_t *entry,
-                      apr_pool_t *pool)
-{
-  fs_fs_data_t *ffd = fs->fsap_data;
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      const char *path = path_p2l_proto_index(fs, txn_id, pool);
-      apr_file_t *file;
-      SVN_ERR(svn_fs_fs__p2l_proto_index_open(&file, path, pool));
-      SVN_ERR(svn_fs_fs__p2l_proto_index_add_entry(file, entry, pool));
-      SVN_ERR(svn_io_file_close(file, pool));
-    }
-
-  return SVN_NO_ERROR;
-}
-
-/* Allocate an item index for the given MY_OFFSET in the transaction TXN_ID
- * 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.
- * 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,
-                    apr_off_t my_offset,
-                    apr_pool_t *pool)
-{
-  fs_fs_data_t *ffd = fs->fsap_data;
-  if (ffd->format < SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      *item_index = (apr_uint64_t)my_offset;
-    }
-  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, 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;
-
-      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;
-}
-
 /* This baton is used by the representation writing streams.  It keeps
    track of the checksum information as well as the total size of the
    representation so far. */
@@ -2117,8 +2016,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,
-                                  b->rep_offset, b->pool));
+      rep->item_index = b->rep_offset;
 
       b->noderev->data_rep = rep;
     }
@@ -2130,22 +2028,7 @@ rep_write_contents_close(void *baton)
   SVN_ERR(svn_fs_fs__put_node_revision(b->fs, b->noderev->id, b->noderev,
                                        FALSE, b->pool));
   if (!old_rep)
-    {
-      svn_fs_fs__p2l_entry_t entry;
-      svn_fs_fs__id_part_t rev_item;
-      rev_item.revision = SVN_INVALID_REVNUM;
-      rev_item.number = rep->item_index;
-
-      entry.offset = b->rep_offset;
-      SVN_ERR(get_file_offset(&offset, b->file, b->pool));
-      entry.size = offset - b->rep_offset;
-      entry.type = SVN_FS_FS__ITEM_TYPE_FILE_REP;
-      entry.item_count = 1;
-      entry.items = &rev_item;
-
-      SVN_ERR(store_sha1_rep_mapping(b->fs, b->noderev, b->pool));
-      SVN_ERR(store_p2l_index_entry(b->fs, &rep->txn_id, &entry, b->pool));
-    }
+    SVN_ERR(store_sha1_rep_mapping(b->fs, b->noderev, b->pool));
 
   SVN_ERR(svn_io_file_close(b->file, b->pool));
   SVN_ERR(unlock_proto_rev(b->fs, &rep->txn_id, b->lockcookie, b->pool));
@@ -2340,7 +2223,6 @@ write_hash_rep(representation_t *rep,
                svn_fs_t *fs,
                const svn_fs_fs__id_part_t *txn_id,
                apr_hash_t *reps_hash,
-               int item_type,
                apr_pool_t *pool)
 {
   svn_stream_t *stream;
@@ -2381,25 +2263,10 @@ write_hash_rep(representation_t *rep,
     }
   else
     {
-      svn_fs_fs__p2l_entry_t entry;
-      svn_fs_fs__id_part_t rev_item;
-
       /* Write out our cosmetic end marker. */
       SVN_ERR(svn_stream_puts(whb->stream, "ENDREP\n"));
 
-      SVN_ERR(allocate_item_index(&rep->item_index, fs, txn_id, offset,
-                                  pool));
-      
-      rev_item.revision = SVN_INVALID_REVNUM;
-      rev_item.number = rep->item_index;
-
-      entry.offset = offset;
-      SVN_ERR(get_file_offset(&offset, file, pool));
-      entry.size = offset - entry.offset;
-      entry.type = item_type;
-      entry.item_count = 1;
-      entry.items = &rev_item;
-      SVN_ERR(store_p2l_index_entry(fs, txn_id, &entry, pool));
+      rep->item_index = offset;
 
       /* update the representation */
       rep->size = whb->size;
@@ -2425,7 +2292,7 @@ write_hash_delta_rep(representation_t *r
                      const svn_fs_fs__id_part_t *txn_id,
                      node_revision_t *noderev,
                      apr_hash_t *reps_hash,
-                     int item_type,
+                     svn_boolean_t is_props,
                      apr_pool_t *pool)
 {
   svn_txdelta_window_handler_t diff_wh;
@@ -2445,8 +2312,6 @@ write_hash_delta_rep(representation_t *r
   struct write_hash_baton *whb;
   fs_fs_data_t *ffd = fs->fsap_data;
   int diff_version = ffd->format >= SVN_FS_FS__MIN_SVNDIFF1_FORMAT ? 1 : 0;
-  svn_boolean_t is_props = (item_type == SVN_FS_FS__ITEM_TYPE_FILE_PROPS)
-                        || (item_type == SVN_FS_FS__ITEM_TYPE_DIR_PROPS);
 
   /* Get the base for this delta. */
   SVN_ERR(choose_delta_base(&base_rep, fs, noderev, is_props, pool));
@@ -2509,27 +2374,11 @@ write_hash_delta_rep(representation_t *r
     }
   else
     {
-      svn_fs_fs__p2l_entry_t entry;
-      svn_fs_fs__id_part_t rev_item;
-
       /* Write out our cosmetic end marker. */
       SVN_ERR(get_file_offset(&rep_end, file, pool));
       SVN_ERR(svn_stream_puts(file_stream, "ENDREP\n"));
 
-      SVN_ERR(allocate_item_index(&rep->item_index, fs, txn_id, offset,
-                                  pool));
-
-      rev_item.revision = SVN_INVALID_REVNUM;
-      rev_item.number = rep->item_index;
-
-      entry.offset = offset;
-      SVN_ERR(get_file_offset(&offset, file, pool));
-      entry.size = offset - entry.offset;
-      entry.type = item_type;
-      entry.item_count = 1;
-      entry.items = &rev_item;
-
-      SVN_ERR(store_p2l_index_entry(fs, txn_id, &entry, pool));
+      rep->item_index = offset;
 
       /* update the representation */
       rep->expanded_size = whb->size;
@@ -2721,12 +2570,10 @@ write_final_rev(const svn_fs_id_t **new_
           if (ffd->deltify_directories)
             SVN_ERR(write_hash_delta_rep(noderev->data_rep, file,
                                          str_entries, fs, txn_id, noderev,
-                                         NULL, SVN_FS_FS__ITEM_TYPE_DIR_REP,
-                                         pool));
+                                         NULL, FALSE, pool));
           else
             SVN_ERR(write_hash_rep(noderev->data_rep, file, str_entries,
-                                   fs, txn_id, NULL,
-                                   SVN_FS_FS__ITEM_TYPE_DIR_REP, pool));
+                                   fs, txn_id, NULL, pool));
 
           svn_fs_fs__id_txn_reset(&noderev->data_rep->txn_id);
         }
@@ -2743,16 +2590,13 @@ write_final_rev(const svn_fs_id_t **new_
           svn_fs_fs__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"));
-            }
+          /* 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"));
         }
     }
 
@@ -2761,9 +2605,6 @@ write_final_rev(const svn_fs_id_t **new_
       && svn_fs_fs__id_txn_used(&noderev->prop_rep->txn_id))
     {
       apr_hash_t *proplist;
-      int item_type = noderev->kind == svn_node_dir
-                    ? SVN_FS_FS__ITEM_TYPE_DIR_PROPS
-                    : SVN_FS_FS__ITEM_TYPE_FILE_PROPS;
       SVN_ERR(svn_fs_fs__get_proplist(&proplist, fs, noderev, pool));
 
       svn_fs_fs__id_txn_reset(&noderev->prop_rep->txn_id);
@@ -2772,10 +2613,10 @@ write_final_rev(const svn_fs_id_t **new_
       if (ffd->deltify_properties)
         SVN_ERR(write_hash_delta_rep(noderev->prop_rep, file,
                                      proplist, fs, txn_id, noderev,
-                                     reps_hash, item_type, pool));
+                                     reps_hash, TRUE, pool));
       else
         SVN_ERR(write_hash_rep(noderev->prop_rep, file, proplist,
-                               fs, txn_id, reps_hash, item_type, pool));
+                               fs, txn_id, reps_hash, pool));
     }
 
   /* Convert our temporary ID into a permanent revision one. */
@@ -2788,16 +2629,7 @@ write_final_rev(const svn_fs_id_t **new_
     noderev->copyroot_rev = rev;
 
   SVN_ERR(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,
-                                pool));
+  rev_item.number = my_offset;
 
   rev_item.revision = rev;
   new_id = svn_fs_fs__id_rev_create(&node_id, &copy_id, &rev_item, pool);
@@ -2851,22 +2683,6 @@ write_final_rev(const svn_fs_id_t **new_
                                    svn_fs_fs__fs_supports_mergeinfo(fs),
                                    pool));
 
-  /* reference the root noderev from the log-to-phys index */
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      svn_fs_fs__p2l_entry_t entry;
-      rev_item.revision = SVN_INVALID_REVNUM;
-
-      entry.offset = my_offset;
-      SVN_ERR(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));
-    }
-
   /* Return our ID that references the revision file. */
   *new_id_p = noderev->id;
 
@@ -2886,7 +2702,6 @@ write_final_changed_path_info(apr_off_t 
 {
   apr_hash_t *changed_paths;
   apr_off_t offset;
-  fs_fs_data_t *ffd = fs->fsap_data;
 
   SVN_ERR(get_file_offset(&offset, file, pool));
 
@@ -2897,25 +2712,6 @@ write_final_changed_path_info(apr_off_t 
 
   *offset_p = offset;
 
-  /* reference changes from the indexes */
-  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    {
-      svn_fs_fs__p2l_entry_t entry;
-      svn_fs_fs__id_part_t rev_item
-        = {SVN_INVALID_REVNUM, SVN_FS_FS__ITEM_INDEX_CHANGES};
-
-      entry.offset = offset;
-      SVN_ERR(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;
 }
 
@@ -3099,6 +2895,9 @@ commit_body(void *baton, apr_pool_t *poo
   svn_prop_t prop;
   svn_string_t date;
   const svn_fs_fs__id_part_t *txn_id = svn_fs_fs__txn_get_id(cb->txn);
+  svn_stringbuf_t *trailer;
+  apr_off_t root_offset;
+  apr_uint32_t sub_item;
 
   /* Get the current youngest revision. */
   SVN_ERR(svn_fs_fs__youngest_rev(&old_rev, cb->fs, pool));
@@ -3139,28 +2938,22 @@ 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. */
+  /* Write the final line. */
 
-      svn_stringbuf_t *trailer;
-      apr_off_t root_offset;
-      apr_uint32_t sub_item;
-      SVN_ERR(svn_fs_fs__item_offset(&root_offset,
-                                     &sub_item,
-                                     cb->fs,
-                                     svn_fs_fs__id_rev(new_root_id),
-                                     NULL,
-                                     svn_fs_fs__id_item(new_root_id),
-                                     pool));
-      SVN_ERR_ASSERT(sub_item == 0);
-      trailer = svn_fs_fs__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_fs_fs__item_offset(&root_offset,
+                                  &sub_item,
+                                  cb->fs,
+                                  svn_fs_fs__id_rev(new_root_id),
+                                  NULL,
+                                  svn_fs_fs__id_item(new_root_id),
+                                  pool));
+  SVN_ERR_ASSERT(sub_item == 0);
+  trailer = svn_fs_fs__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));
@@ -3222,26 +3015,6 @@ 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_fs__l2p_index_create(cb->fs,
-                                          path_l2p_index(cb->fs, new_rev,
-                                                         pool),
-                                          path_l2p_proto_index(cb->fs,
-                                                               txn_id,
-                                                               pool),
-                                          new_rev, pool));
-      SVN_ERR(svn_fs_fs__p2l_index_create(cb->fs,
-                                          path_p2l_index(cb->fs, new_rev,
-                                                         pool),
-                                          path_p2l_proto_index(cb->fs,
-                                                               txn_id,
-                                                               pool),
-                                          new_rev, pool));
-    }
-
   /* Move the finished rev file into place. */
   old_rev_filename = svn_fs_fs__path_rev_absolute(cb->fs, old_rev, pool);
 

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/verify.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/verify.c?rev=1498165&r1=1498164&r2=1498165&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/verify.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/verify.c Sun Jun 30 17:44:56
2013
@@ -155,212 +155,6 @@ verify_rep_cache(svn_fs_t *fs,
   return SVN_NO_ERROR;
 }
 
-/* Verify that for all log-to-phys index entries for revisions START to
- * START + COUNT-1 in FS there is a consistent entry in the phys-to-log
- * index.  If given, invoke CANCEL_FUNC with CANCEL_BATON at regular
- * intervals. Use POOL for allocations.
- */
-static svn_error_t *
-compare_l2p_to_p2l_index(svn_fs_t *fs,
-                         svn_revnum_t start,
-                         svn_revnum_t count,
-                         svn_cancel_func_t cancel_func,
-                         void *cancel_baton,
-                         apr_pool_t *pool)
-{
-  svn_revnum_t i;
-  apr_pool_t *iterpool = svn_pool_create(pool);
-  apr_array_header_t *max_ids;
-
-  /* determine the range of items to check for each revision */
-  SVN_ERR(svn_fs_fs__l2p_get_max_ids(&max_ids, fs, start, count, pool));
-
-  /* check all items in all revisions if the given range */
-  for (i = 0; i < max_ids->nelts; ++i)
-    {
-      apr_uint64_t k;
-      apr_uint64_t max_id = APR_ARRAY_IDX(max_ids, i, apr_uint64_t);
-      svn_revnum_t revision = start + i;
-
-      for (k = 0; k < max_id; ++k)
-        {
-          apr_off_t offset;
-          apr_uint32_t sub_item;
-          svn_fs_fs__id_part_t *p2l_item;
-
-          /* get L2P entry.  Ignore unused entries. */
-          SVN_ERR(svn_fs_fs__item_offset(&offset, &sub_item, fs,
-                                         revision, NULL, k, iterpool));
-          if (offset == -1)
-            continue;
-
-          /* find the corresponding P2L entry */
-          SVN_ERR(svn_fs_fs__p2l_item_lookup(&p2l_item, fs, start,
-                                             offset, sub_item, iterpool));
-
-          if (p2l_item == NULL)
-            return svn_error_createf(SVN_ERR_FS_ITEM_INDEX_INCONSISTENT,
-                                     NULL,
-                                     _("p2l index entry not found for "
-                                       "PHYS o%s:s%ld returned by "
-                                       "l2p index for LOG r%ld:i%ld"),
-                                     apr_off_t_toa(pool, offset),
-                                     (long)sub_item, revision, (long)k);
-
-          if (p2l_item->number != k || p2l_item->revision != revision)
-            return svn_error_createf(SVN_ERR_FS_ITEM_INDEX_INCONSISTENT,
-                                     NULL,
-                                     _("p2l index info LOG r%ld:i%ld"
-                                       " does not match "
-                                       "l2p index for LOG r%ld:i%ld"),
-                                     p2l_item->revision,
-                                     (long)p2l_item->number, revision,
-                                     (long)k);
-
-          svn_pool_clear(iterpool);
-        }
-
-      if (cancel_func)
-        SVN_ERR(cancel_func(cancel_baton));
-    }
-
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
-/* Verify that for all phys-to-log index entries for revisions START to
- * START + COUNT-1 in FS there is a consistent entry in the log-to-phys
- * index.  If given, invoke CANCEL_FUNC with CANCEL_BATON at regular
- * intervals. Use POOL for allocations.
- *
- * Please note that we can only check on pack / rev file granularity and
- * must only be called for a single rev / pack file.
- */
-static svn_error_t *
-compare_p2l_to_l2p_index(svn_fs_t *fs,
-                         svn_revnum_t start,
-                         svn_revnum_t count,
-                         svn_cancel_func_t cancel_func,
-                         void *cancel_baton,
-                         apr_pool_t *pool)
-{
-  apr_pool_t *iterpool = svn_pool_create(pool);
-  apr_off_t max_offset;
-  apr_off_t offset = 0;
-
-  /* get the size of the rev / pack file as covered by the P2L index */
-  SVN_ERR(svn_fs_fs__p2l_get_max_offset(&max_offset, fs, start, pool));
-
-  /* for all offsets in the file, get the P2L index entries and check
-     them against the L2P index */
-  for (offset = 0; offset < max_offset; )
-    {
-      apr_array_header_t *entries;
-      svn_fs_fs__p2l_entry_t *last_entry;
-      int i;
-
-      /* get all entries for the current block */
-      SVN_ERR(svn_fs_fs__p2l_index_lookup(&entries, fs, start, offset,
-                                          iterpool));
-      if (entries->nelts == 0)
-        return svn_error_createf(SVN_ERR_FS_ITEM_INDEX_CORRUPTION,
-                                 NULL,
-                                 _("p2l does not cover offset %s"
-                                   " for revision %ld"),
-                                  apr_off_t_toa(pool, offset), start);
-
-      /* process all entries (and later continue with the next block) */
-      last_entry
-        = &APR_ARRAY_IDX(entries, entries->nelts-1, svn_fs_fs__p2l_entry_t);
-      offset = last_entry->offset + last_entry->size;
-      
-      for (i = 0; i < entries->nelts; ++i)
-        {
-          apr_uint32_t k;
-          svn_fs_fs__p2l_entry_t *entry
-            = &APR_ARRAY_IDX(entries, i, svn_fs_fs__p2l_entry_t);
-
-          /* check all sub-items for consist entries in the L2P index */
-          for (k = 0; k < entry->item_count; ++k)
-            {
-              apr_off_t l2p_offset;
-              apr_uint32_t sub_item;
-              svn_fs_fs__id_part_t *p2l_item = &entry->items[k];
-
-              SVN_ERR(svn_fs_fs__item_offset(&l2p_offset, &sub_item, fs,
-                                             p2l_item->revision, NULL,
-                                             p2l_item->number, iterpool));
-
-              if (sub_item != k || l2p_offset != entry->offset)
-                return svn_error_createf(SVN_ERR_FS_ITEM_INDEX_INCONSISTENT,
-                                         NULL,
-                                         _("l2p index entry PHYS o%s:s%ld "
-                                           "does not match p2l index value "
-                                           "LOG r%ld:i%ld for PHYS o%s:s%ld"),
-                                         apr_off_t_toa(pool, l2p_offset),
-                                         (long)sub_item,
-                                         p2l_item->revision,
-                                         (long)p2l_item->number,
-                                         apr_off_t_toa(pool, entry->offset),
-                                         (long)k);
-            }
-        }
-
-      svn_pool_clear(iterpool);
-
-      if (cancel_func)
-        SVN_ERR(cancel_func(cancel_baton));
-    }
-
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
-/* Verify that the log-to-phys indexes and phys-to-log indexes are
- * consistent with each other.  The function signature is similar to
- * svn_fs_fs__verify.
- *
- * The values of START and END have already been auto-selected and
- * verified.  You may call this for format7 or higher repos.
- */
-static svn_error_t *
-verify_index_consistency(svn_fs_t *fs,
-                         svn_revnum_t start,
-                         svn_revnum_t end,
-                         svn_fs_progress_notify_func_t notify_func,
-                         void *notify_baton,
-                         svn_cancel_func_t cancel_func,
-                         void *cancel_baton,
-                         apr_pool_t *pool)
-{
-  fs_fs_data_t *ffd = fs->fsap_data;
-  svn_revnum_t revision, pack_start, pack_end;
-  apr_pool_t *iterpool = svn_pool_create(pool);
-
-  for (revision = start; revision <= end; revision = pack_end)
-    {
-      pack_start = packed_base_rev(fs, revision);
-      pack_end = pack_start + pack_size(fs, revision);
-
-      if (notify_func && (pack_start % ffd->max_files_per_dir == 0))
-        notify_func(pack_start, notify_baton, iterpool);
-
-      /* two-way index check */
-      SVN_ERR(compare_l2p_to_p2l_index(fs, pack_start, pack_end - pack_start,
-                                       cancel_func, cancel_baton, iterpool));
-      SVN_ERR(compare_p2l_to_l2p_index(fs, pack_start, pack_end - pack_start,
-                                       cancel_func, cancel_baton, iterpool));
-
-      svn_pool_clear(iterpool);
-    }
-
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_fs_fs__verify(svn_fs_t *fs,
                   svn_revnum_t start,
@@ -382,13 +176,6 @@ svn_fs_fs__verify(svn_fs_t *fs,
   SVN_ERR(svn_fs_fs__ensure_revision_exists(start, fs, pool));
   SVN_ERR(svn_fs_fs__ensure_revision_exists(end, fs, pool));
 
-  /* 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));
-
   /* rep cache consistency */
   if (ffd->format >= SVN_FS_FS__MIN_REP_SHARING_FORMAT)
     SVN_ERR(verify_rep_cache(fs, start, end, notify_func, notify_baton,

Modified: subversion/branches/fsfs-format7/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c?rev=1498165&r1=1498164&r2=1498165&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c (original)
+++ subversion/branches/fsfs-format7/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c Sun Jun
30 17:44:56 2013
@@ -26,7 +26,6 @@
 
 #include "../svn_test.h"
 #include "../../libsvn_fs_fs/fs.h"
-#include "../../libsvn_fs_fs/reps.h"
 
 #include "svn_pools.h"
 #include "svn_props.h"
@@ -308,37 +307,14 @@ pack_filesystem(const svn_test_opts_t *o
         return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
                                  "Expected pack file '%s' not found", path);
 
-      if (opts->server_minor_version && (opts->server_minor_version < 6))
-        {
-          path = svn_dirent_join_many(pool, REPO_NAME, "revs",
-                                      apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
-                                      "manifest", NULL);
-          SVN_ERR(svn_io_check_path(path, &kind, pool));
-          if (kind != svn_node_file)
-            return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
-                                     "Expected manifest file '%s' not found",
-                                     path);
-        }
-      else
-        {
-          path = svn_dirent_join_many(pool, REPO_NAME, "revs",
-                                      apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
-                                      "pack.l2p", NULL);
-          SVN_ERR(svn_io_check_path(path, &kind, pool));
-          if (kind != svn_node_file)
-            return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
-                                     "Expected log-to-phys index file '%s' not found",
-                                     path);
-
-          path = svn_dirent_join_many(pool, REPO_NAME, "revs",
-                                      apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
-                                      "pack.p2l", NULL);
-          SVN_ERR(svn_io_check_path(path, &kind, pool));
-          if (kind != svn_node_file)
-            return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
-                                     "Expected phys-to-log index file '%s' not found",
-                                     path);
-        }
+      path = svn_dirent_join_many(pool, REPO_NAME, "revs",
+                                  apr_psprintf(pool, "%d.pack", i / SHARD_SIZE),
+                                  "manifest", NULL);
+      SVN_ERR(svn_io_check_path(path, &kind, pool));
+      if (kind != svn_node_file)
+        return svn_error_createf(SVN_ERR_FS_GENERAL, NULL,
+                                  "Expected manifest file '%s' not found",
+                                  path);
 
       /* This directory should not exist. */
       path = svn_dirent_join_many(pool, REPO_NAME, "revs",
@@ -852,61 +828,6 @@ test_info(const svn_test_opts_t *opts,
 #undef MAX_REV
 
 /* ------------------------------------------------------------------------ */
-#define REPO_NAME "test-repo-fsfs-rev-container"
-#define SHARD_SIZE 3
-#define MAX_REV 5
-static svn_error_t *
-test_reps(const svn_test_opts_t *opts,
-          apr_pool_t *pool)
-{
-  svn_fs_t *fs = NULL;
-  svn_fs_fs__reps_builder_t *builder;
-  svn_fs_fs__reps_t *container;
-  svn_stringbuf_t *serialized;
-  svn_stream_t *stream;
-  svn_stringbuf_t *contents = svn_stringbuf_create_ensure(10000, pool);
-
-  int i;
-  for (i = 0; i < 10000; ++i)
-    {
-      int v, s = 0;
-      for (v = i; v > 0; v /= 10)
-        s += v % 10;
-
-      svn_stringbuf_appendbyte(contents, (char)(s + ' '));
-    }
-
-  SVN_ERR(create_packed_filesystem(REPO_NAME, opts, MAX_REV, SHARD_SIZE,
-                                   pool));
-
-  SVN_ERR(svn_fs_open(&fs, REPO_NAME, NULL, pool));
-
-  builder = svn_fs_fs__reps_builder_create(fs, pool);
-  for (i = 10000; i > 10; --i)
-    {
-      svn_string_t string;
-      string.data = contents->data;
-      string.len = i;
-
-      svn_fs_fs__reps_add(builder, &string);
-    }
-
-  serialized = svn_stringbuf_create_empty(pool);
-  stream = svn_stream_from_stringbuf(serialized, pool);
-  SVN_ERR(svn_fs_fs__write_reps_container(stream, builder, pool));
-
-  SVN_ERR(svn_stream_reset(stream));
-  SVN_ERR(svn_fs_fs__read_reps_container(&container, stream, pool, pool));
-  SVN_ERR(svn_stream_close(stream));
-
-  return SVN_NO_ERROR;
-}
-
-#undef REPO_NAME
-#undef SHARD_SIZE
-#undef MAX_REV
-
-/* ------------------------------------------------------------------------ */
 #define REPO_NAME "test-repo-fsfs-pack-shard-size-one"
 #define SHARD_SIZE 1
 #define MAX_REV 4
@@ -962,8 +883,6 @@ struct svn_test_descriptor_t test_funcs[
                        "test file hint at shard boundary"),
     SVN_TEST_OPTS_PASS(test_info,
                        "test svn_fs_info"),
-    SVN_TEST_OPTS_PASS(test_reps,
-                       "test representations container"),
     SVN_TEST_OPTS_PASS(pack_shard_size_one,
                        "test packing with shard size = 1"),
     SVN_TEST_NULL



Mime
View raw message