subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1434454 - in /subversion/branches/fsfs-format7: subversion/libsvn_fs_fs/fs_fs.c subversion/libsvn_fs_fs/recovery.c subversion/libsvn_fs_fs/rep-cache.c tools/server-side/svn-rep-sharing-stats.c
Date Wed, 16 Jan 2013 22:36:46 GMT
Author: stefan2
Date: Wed Jan 16 22:36:46 2013
New Revision: 1434454

URL: http://svn.apache.org/viewvc?rev=1434454&view=rev
Log:
On the fsfs-format7 branch: Adapt the remaning files to the recent API
changes and make fsfs create a proper empty repo for format 7.

* subversion/libsvn_fs_fs/fs_fs.c
  (svn_fs_fs__noderev_same_rep_key): s/offset/item_index
  (write_revision_zero): add template for format 7 repos

* subversion/libsvn_fs_fs/recovery.c
  (recover_find_max_ids,
   svn_fs_fs__find_max_ids): adapt to API changes

* subversion/libsvn_fs_fs/rep-cache.c
  (svn_fs_fs__walk_rep_reference,
   svn_fs_fs__get_rep_reference, 
   svn_fs_fs__set_rep_reference): s/offset/item_index

* tools/server-side/svn-rep-sharing-stats.c
  (key_t,
   record): ditto

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/recovery.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c
    subversion/branches/fsfs-format7/tools/server-side/svn-rep-sharing-stats.c

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c?rev=1434454&r1=1434453&r2=1434454&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c Wed Jan 16 22:36:46 2013
@@ -750,7 +750,7 @@ svn_fs_fs__noderev_same_rep_key(represen
   if (a == NULL || b == NULL)
     return FALSE;
 
-  if (a->offset != b->offset)
+  if (a->item_index != b->item_index)
     return FALSE;
 
   if (a->revision != b->revision)
@@ -820,19 +820,57 @@ write_revision_zero(svn_fs_t *fs)
   const char *path_revision_zero = path_rev(fs, 0, fs->pool);
   apr_hash_t *proplist;
   svn_string_t date;
+  fs_fs_data_t *ffd = fs->fsap_data;
 
   /* Write out a rev file for revision 0. */
-  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));
+  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_set_file_read_only(path_revision_zero, FALSE, fs->pool));
 
+  if (ffd->format >= SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
+    {
+      const char *path = path_l2p_index(fs, 0, fs->pool);
+      SVN_ERR(svn_io_file_create2(path,
+                                  "\0\1\1\1"      /* rev 0, single page */
+                                  "\4\4"          /* page size: count, bytes */
+                                  "\0\x6b\x12\1", /* phys offsets + 1 */
+                                  10,
+                                  fs->pool));
+      SVN_ERR(svn_io_set_file_read_only(path, FALSE, fs->pool));
+
+      path = path_p2l_index(fs, 0, fs->pool);
+      SVN_ERR(svn_io_file_create2(path,
+                                  "\0"
+                                  "\1\x13"
+                                  "\0"
+                                  "\x11\1\0\3"
+                                  "\x59\2\0\2"
+                                  "\1\3\0\1"
+                                  "\x95\xff\3\0\0\0",
+                                  22,
+                                  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);
   date.len = strlen(date.data);

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/recovery.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/recovery.c?rev=1434454&r1=1434453&r2=1434454&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/recovery.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/recovery.c Wed Jan 16 22:36:46
2013
@@ -183,7 +183,8 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
 
   /* We could use get_dir_contents(), but this is much cheaper.  It does
      rely on directory entries being stored as PLAIN reps, though. */
-  offset = noderev->data_rep->offset;
+  SVN_ERR(svn_fs_fs__item_offset(&offset, fs, rev, NULL,
+                                 noderev->data_rep->item_index, pool));
   SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &offset, pool));
 
   baton.stream = svn_stream_from_aprfile2(rev_file, TRUE, pool);
@@ -271,6 +272,7 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
       SVN_ERR(svn_fs_fs__item_offset(&child_dir_offset,
                                      fs,
                                      svn_fs_fs__id_rev(id),
+                                     NULL,
                                      svn_fs_fs__id_item(id),
                                      iterpool));
       SVN_ERR(recover_find_max_ids(fs, rev, rev_file, child_dir_offset,
@@ -297,6 +299,7 @@ svn_fs_fs__find_max_ids(svn_fs_t *fs, sv
   SVN_ERR(svn_fs_fs__rev_get_root(&root_id, fs, youngest, pool));
   SVN_ERR(svn_fs_fs__item_offset(&root_offset, fs,
                                  svn_fs_fs__id_rev(root_id),
+                                 NULL,
                                  svn_fs_fs__id_item(root_id),
                                  pool));
 

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c?rev=1434454&r1=1434453&r2=1434454&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/rep-cache.c Wed Jan 16 22:36:46
2013
@@ -190,7 +190,7 @@ svn_fs_fs__walk_rep_reference(svn_fs_t *
                                      svn_checksum_sha1, sha1_digest,
                                      iterpool));
       rep->revision = svn_sqlite__column_revnum(stmt, 1);
-      rep->offset = svn_sqlite__column_int64(stmt, 2);
+      rep->item_index = svn_sqlite__column_int64(stmt, 2);
       rep->size = svn_sqlite__column_int64(stmt, 3);
       rep->expanded_size = svn_sqlite__column_int64(stmt, 4);
 
@@ -240,7 +240,7 @@ svn_fs_fs__get_rep_reference(representat
       *rep = apr_pcalloc(pool, sizeof(**rep));
       (*rep)->sha1_checksum = svn_checksum_dup(checksum, pool);
       (*rep)->revision = svn_sqlite__column_revnum(stmt, 0);
-      (*rep)->offset = svn_sqlite__column_int64(stmt, 1);
+      (*rep)->item_index = svn_sqlite__column_int64(stmt, 1);
       (*rep)->size = svn_sqlite__column_int64(stmt, 2);
       (*rep)->expanded_size = svn_sqlite__column_int64(stmt, 3);
     }
@@ -277,7 +277,7 @@ svn_fs_fs__set_rep_reference(svn_fs_t *f
   SVN_ERR(svn_sqlite__bindf(stmt, "siiii",
                             svn_checksum_to_cstring(rep->sha1_checksum, pool),
                             (apr_int64_t) rep->revision,
-                            (apr_int64_t) rep->offset,
+                            (apr_int64_t) rep->item_index,
                             (apr_int64_t) rep->size,
                             (apr_int64_t) rep->expanded_size));
 
@@ -301,7 +301,7 @@ svn_fs_fs__set_rep_reference(svn_fs_t *f
       if (old_rep)
         {
           if (reject_dup && ((old_rep->revision != rep->revision)
-                             || (old_rep->offset != rep->offset)
+                             || (old_rep->item_index != rep->item_index)
                              || (old_rep->size != rep->size)
                              || (old_rep->expanded_size != rep->expanded_size)))
             return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
@@ -314,9 +314,9 @@ svn_fs_fs__set_rep_reference(svn_fs_t *f
                               SVN_FILESIZE_T_FMT, APR_OFF_T_FMT,
                               SVN_FILESIZE_T_FMT, SVN_FILESIZE_T_FMT),
                  svn_checksum_to_cstring_display(rep->sha1_checksum, pool),
-                 fs->path, old_rep->revision, old_rep->offset, old_rep->size,
-                 old_rep->expanded_size, rep->revision, rep->offset, rep->size,
-                 rep->expanded_size);
+                 fs->path, old_rep->revision, old_rep->item_index,
+                 old_rep->size, old_rep->expanded_size, rep->revision,
+                 rep->item_index, rep->size, rep->expanded_size);
           else
             return SVN_NO_ERROR;
         }

Modified: subversion/branches/fsfs-format7/tools/server-side/svn-rep-sharing-stats.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/tools/server-side/svn-rep-sharing-stats.c?rev=1434454&r1=1434453&r2=1434454&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/tools/server-side/svn-rep-sharing-stats.c (original)
+++ subversion/branches/fsfs-format7/tools/server-side/svn-rep-sharing-stats.c Wed Jan 16
22:36:46 2013
@@ -175,7 +175,7 @@ static svn_error_t *check_experimental(v
 struct key_t
 {
   svn_revnum_t revision;
-  apr_off_t offset;
+  apr_uint64_t item_index;
 };
 
 /* What we need to know about a rep. */
@@ -208,7 +208,7 @@ static svn_error_t *record(apr_hash_t *r
    */
   key = apr_pcalloc(result_pool, sizeof(*key));
   key->revision = rep->revision;
-  key->offset = rep->offset;
+  key->item_index = rep->item_index;
 
   /* Update or create the value. */
   if ((value = apr_hash_get(records, key, sizeof(*key))))



Mime
View raw message