subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1670791 - in /subversion/branches/fsx-1.10/subversion/libsvn_fs_x: revprops.c revprops.h
Date Wed, 01 Apr 2015 22:53:09 GMT
Author: stefan2
Date: Wed Apr  1 22:53:09 2015
New Revision: 1670791

URL: http://svn.apache.org/r1670791
Log:
On the fsx-1.10 branch:
Remove obsolete revprop packing upgrade code from FSX that had been
carried over from FSFS.  In FSX, rev and revprops packing is always
in sync.

* subversion/libsvn_fs_x/revprops.c
  (svn_fs_x__upgrade_pack_revprops,
   svn_fs_x__upgrade_cleanup_pack_revprops): Remove.
  (svn_fs_x__copy_revprops): Rename to ...
  (copy_revprops): ... this and make it static. Take docstring from
                   header.  There are no external callers anymore.
  (svn_fs_x__pack_revprops_shard): Update caller.

* subversion/libsvn_fs_x/revprops.h
  (svn_fs_x__upgrade_pack_revprops,
   svn_fs_x__upgrade_cleanup_pack_revprops,
   svn_fs_x__copy_revprops): Remove.

Modified:
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.h

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c?rev=1670791&r1=1670790&r2=1670791&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c Wed Apr  1 22:53:09 2015
@@ -53,98 +53,6 @@
            (SVN_INT64_BUFFER_SIZE + 3 + APR_MD5_DIGESTSIZE * 2)
 
 
-svn_error_t *
-svn_fs_x__upgrade_pack_revprops(svn_fs_t *fs,
-                                svn_fs_upgrade_notify_t notify_func,
-                                void *notify_baton,
-                                svn_cancel_func_t cancel_func,
-                                void *cancel_baton,
-                                apr_pool_t *scratch_pool)
-{
-  svn_fs_x__data_t *ffd = fs->fsap_data;
-  const char *revprops_shard_path;
-  const char *revprops_pack_file_dir;
-  apr_int64_t shard;
-  apr_int64_t first_unpacked_shard
-    =  ffd->min_unpacked_rev / ffd->max_files_per_dir;
-
-  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-  const char *revsprops_dir = svn_dirent_join(fs->path, PATH_REVPROPS_DIR,
-                                              scratch_pool);
-  int compression_level = ffd->compress_packed_revprops
-                           ? SVN_DELTA_COMPRESSION_LEVEL_DEFAULT
-                           : SVN_DELTA_COMPRESSION_LEVEL_NONE;
-
-  /* first, pack all revprops shards to match the packed revision shards */
-  for (shard = 0; shard < first_unpacked_shard; ++shard)
-    {
-      svn_pool_clear(iterpool);
-
-      revprops_pack_file_dir = svn_dirent_join(revsprops_dir,
-                   apr_psprintf(iterpool,
-                                "%" APR_INT64_T_FMT PATH_EXT_PACKED_SHARD,
-                                shard),
-                   iterpool);
-      revprops_shard_path = svn_dirent_join(revsprops_dir,
-                       apr_psprintf(iterpool, "%" APR_INT64_T_FMT, shard),
-                       iterpool);
-
-      SVN_ERR(svn_fs_x__pack_revprops_shard(revprops_pack_file_dir,
-                                      revprops_shard_path,
-                                      shard, ffd->max_files_per_dir,
-                                      (int)(0.9 * ffd->revprop_pack_size),
-                                      compression_level,
-                                      cancel_func, cancel_baton, iterpool));
-      if (notify_func)
-        SVN_ERR(notify_func(notify_baton, shard,
-                            svn_fs_upgrade_pack_revprops, iterpool));
-    }
-
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_fs_x__upgrade_cleanup_pack_revprops(svn_fs_t *fs,
-                                        svn_fs_upgrade_notify_t notify_func,
-                                        void *notify_baton,
-                                        svn_cancel_func_t cancel_func,
-                                        void *cancel_baton,
-                                        apr_pool_t *scratch_pool)
-{
-  svn_fs_x__data_t *ffd = fs->fsap_data;
-  const char *revprops_shard_path;
-  apr_int64_t shard;
-  apr_int64_t first_unpacked_shard
-    =  ffd->min_unpacked_rev / ffd->max_files_per_dir;
-
-  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-  const char *revsprops_dir = svn_dirent_join(fs->path, PATH_REVPROPS_DIR,
-                                              scratch_pool);
-  
-  /* delete the non-packed revprops shards afterwards */
-  for (shard = 0; shard < first_unpacked_shard; ++shard)
-    {
-      svn_pool_clear(iterpool);
-
-      revprops_shard_path = svn_dirent_join(revsprops_dir,
-                       apr_psprintf(iterpool, "%" APR_INT64_T_FMT, shard),
-                       iterpool);
-      SVN_ERR(svn_fs_x__delete_revprops_shard(revprops_shard_path,
-                                              shard, ffd->max_files_per_dir,
-                                              cancel_func, cancel_baton,
-                                              iterpool));
-      if (notify_func)
-        SVN_ERR(notify_func(notify_baton, shard,
-                            svn_fs_upgrade_cleanup_revprops, iterpool));
-    }
-
-  svn_pool_destroy(iterpool);
-
-  return SVN_NO_ERROR;
-}
-
 /* Revprop caching management.
  *
  * Mechanism:
@@ -1734,18 +1642,34 @@ svn_fs_x__packed_revprop_available(svn_b
 
 /****** Packing FSX shards *********/
 
-svn_error_t *
-svn_fs_x__copy_revprops(const char *pack_file_dir,
-                        const char *pack_filename,
-                        const char *shard_path,
-                        svn_revnum_t start_rev,
-                        svn_revnum_t end_rev,
-                        apr_array_header_t *sizes,
-                        apr_size_t total_size,
-                        int compression_level,
-                        svn_cancel_func_t cancel_func,
-                        void *cancel_baton,
-                        apr_pool_t *scratch_pool)
+/* Copy revprop files for revisions [START_REV, END_REV) from SHARD_PATH
+ * to the pack file at PACK_FILE_NAME in PACK_FILE_DIR.
+ *
+ * The file sizes have already been determined and written to SIZES.
+ * Please note that this function will be executed while the filesystem
+ * has been locked and that revprops files will therefore not be modified
+ * while the pack is in progress.
+ *
+ * COMPRESSION_LEVEL defines how well the resulting pack file shall be
+ * compressed or whether is shall be compressed at all.  TOTAL_SIZE is
+ * a hint on which initial buffer size we should use to hold the pack file
+ * content.
+ *
+ * CANCEL_FUNC and CANCEL_BATON are used as usual. Temporary allocations
+ * are done in SCRATCH_POOL.
+ */
+static svn_error_t *
+copy_revprops(const char *pack_file_dir,
+              const char *pack_filename,
+              const char *shard_path,
+              svn_revnum_t start_rev,
+              svn_revnum_t end_rev,
+              apr_array_header_t *sizes,
+              apr_size_t total_size,
+              int compression_level,
+              svn_cancel_func_t cancel_func,
+              void *cancel_baton,
+              apr_pool_t *scratch_pool)
 {
   svn_stream_t *pack_stream;
   apr_file_t *pack_file;
@@ -1868,11 +1792,11 @@ svn_fs_x__pack_revprops_shard(const char
       if (sizes->nelts != 0 &&
           total_size + SVN_INT64_BUFFER_SIZE + finfo.size > max_pack_size)
         {
-          SVN_ERR(svn_fs_x__copy_revprops(pack_file_dir, pack_filename,
-                                          shard_path, start_rev, rev-1,
-                                          sizes, (apr_size_t)total_size,
-                                          compression_level, cancel_func,
-                                          cancel_baton, iterpool));
+          SVN_ERR(copy_revprops(pack_file_dir, pack_filename,
+                                shard_path, start_rev, rev-1,
+                                sizes, (apr_size_t)total_size,
+                                compression_level, cancel_func,
+                                cancel_baton, iterpool));
 
           /* next pack file starts empty again */
           apr_array_clear(sizes);
@@ -1895,10 +1819,10 @@ svn_fs_x__pack_revprops_shard(const char
 
   /* write the last pack file */
   if (sizes->nelts != 0)
-    SVN_ERR(svn_fs_x__copy_revprops(pack_file_dir, pack_filename, shard_path,
-                                    start_rev, rev-1, sizes,
-                                    (apr_size_t)total_size, compression_level,
-                                    cancel_func, cancel_baton, iterpool));
+    SVN_ERR(copy_revprops(pack_file_dir, pack_filename, shard_path,
+                          start_rev, rev-1, sizes,
+                          (apr_size_t)total_size, compression_level,
+                          cancel_func, cancel_baton, iterpool));
 
   /* flush the manifest file and update permissions */
   SVN_ERR(svn_stream_close(manifest_stream));

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.h?rev=1670791&r1=1670790&r2=1670791&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.h (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.h Wed Apr  1 22:53:09 2015
@@ -39,42 +39,6 @@ svn_error_t *
 svn_fs_x__reset_revprop_generation_file(svn_fs_t *fs,
                                         apr_pool_t *scratch_pool);
 
-/* In the filesystem FS, pack all revprop shards up to min_unpacked_rev.
- * 
- * NOTE: Keep the old non-packed shards around until after the format bump.
- * Otherwise, re-running upgrade will drop the packed revprop shard but
- * have no unpacked data anymore.  Call upgrade_cleanup_pack_revprops after
- * the bump.
- * 
- * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
- * used in the usual way.  Temporary allocations are done in SCRATCH_POOL.
- */
-svn_error_t *
-svn_fs_x__upgrade_pack_revprops(svn_fs_t *fs,
-                                svn_fs_upgrade_notify_t notify_func,
-                                void *notify_baton,
-                                svn_cancel_func_t cancel_func,
-                                void *cancel_baton,
-                                apr_pool_t *scratch_pool);
-
-/* In the filesystem FS, remove all non-packed revprop shards up to
- * min_unpacked_rev.  Temporary allocations are done in SCRATCH_POOL.
- * 
- * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
- * used in the usual way.  Cancellation is supported in the sense that we
- * will cleanly abort the operation.  However, there will be remnant shards
- * that must be removed manually.
- *
- * See upgrade_pack_revprops for more info.
- */
-svn_error_t *
-svn_fs_x__upgrade_cleanup_pack_revprops(svn_fs_t *fs,
-                                        svn_fs_upgrade_notify_t notify_func,
-                                        void *notify_baton,
-                                        svn_cancel_func_t cancel_func,
-                                        void *cancel_baton,
-                                        apr_pool_t *scratch_pool);
-
 /* Read the revprops for revision REV in FS and return them in *PROPLIST_P.
  * If BYPASS_CACHE is set, don't consult the disks but always read from disk.
  *
@@ -111,35 +75,6 @@ svn_fs_x__packed_revprop_available(svn_b
 
 /****** Packing FSX shards *********/
 
-/* Copy revprop files for revisions [START_REV, END_REV) from SHARD_PATH
- * to the pack file at PACK_FILE_NAME in PACK_FILE_DIR.
- *
- * The file sizes have already been determined and written to SIZES.
- * Please note that this function will be executed while the filesystem
- * has been locked and that revprops files will therefore not be modified
- * while the pack is in progress.
- *
- * COMPRESSION_LEVEL defines how well the resulting pack file shall be
- * compressed or whether is shall be compressed at all.  TOTAL_SIZE is
- * a hint on which initial buffer size we should use to hold the pack file
- * content.
- *
- * CANCEL_FUNC and CANCEL_BATON are used as usual. Temporary allocations
- * are done in SCRATCH_POOL.
- */
-svn_error_t *
-svn_fs_x__copy_revprops(const char *pack_file_dir,
-                        const char *pack_filename,
-                        const char *shard_path,
-                        svn_revnum_t start_rev,
-                        svn_revnum_t end_rev,
-                        apr_array_header_t *sizes,
-                        apr_size_t total_size,
-                        int compression_level,
-                        svn_cancel_func_t cancel_func,
-                        void *cancel_baton,
-                        apr_pool_t *scratch_pool);
-
 /* For the revprop SHARD at SHARD_PATH with exactly MAX_FILES_PER_DIR
  * revprop files in it, create a packed shared at PACK_FILE_DIR.
  *



Mime
View raw message