subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1588901 - in /subversion/trunk/subversion/libsvn_fs_fs: fs_fs.c util.c util.h
Date Mon, 21 Apr 2014 15:26:41 GMT
Author: stefan2
Date: Mon Apr 21 15:26:40 2014
New Revision: 1588901

URL: http://svn.apache.org/r1588901
Log:
Minor code consistency fix in FSFS: get rid of the redundant path_lock()
function and make the path to the pack lock file available through a
similar private API function.

* subversion/libsvn_fs_fs/util.h
  (svn_fs_fs__path_pack_lock): Declare this path constructor similarly to
                               the already existing one for the write lock.

* subversion/libsvn_fs_fs/util.c
  (svn_fs_fs__path_pack_lock): Moved here from fs_fs.c:path_pack_lock().

* subversion/libsvn_fs_fs/fs_fs.c
  (path_lock,
   path_pack_lock): Drop as redundant.
  (init_lock_baton,
   svn_fs_fs__create): Call the functions provide from utils.h
                       instead of the static ones.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
    subversion/trunk/subversion/libsvn_fs_fs/util.c
    subversion/trunk/subversion/libsvn_fs_fs/util.h

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1588901&r1=1588900&r2=1588901&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Mon Apr 21 15:26:40 2014
@@ -105,18 +105,6 @@ svn_fs_fs__path_current(svn_fs_t *fs, ap
   return svn_dirent_join(fs->path, PATH_CURRENT, pool);
 }
 
-static APR_INLINE const char *
-path_lock(svn_fs_t *fs, apr_pool_t *pool)
-{
-  return svn_dirent_join(fs->path, PATH_LOCK_FILE, pool);
-}
-
-static APR_INLINE const char *
-path_pack_lock(svn_fs_t *fs, apr_pool_t *pool)
-{
-  return svn_dirent_join(fs->path, PATH_PACK_LOCK_FILE, pool);
-}
-
 
 
 /* Get a lock on empty file LOCK_FILENAME, creating it in POOL. */
@@ -283,8 +271,8 @@ init_lock_baton(with_lock_baton_t *baton
   switch (lock_id)
     {
       case write_lock: baton->mutex = ffsd->fs_write_lock;
-                       baton->lock_path = path_lock(baton->fs,
-                                                    baton->lock_pool);
+                       baton->lock_path = svn_fs_fs__path_lock
+                                            (baton->fs, baton->lock_pool);
                        baton->is_global_lock = TRUE;
                        break;
 
@@ -295,8 +283,8 @@ init_lock_baton(with_lock_baton_t *baton
                        break;
 
       case pack_lock:  baton->mutex = ffsd->fs_pack_lock;
-                       baton->lock_path = path_pack_lock(baton->fs,
-                                                         baton->lock_pool);
+                       baton->lock_path = svn_fs_fs__path_pack_lock
+                                            (baton->fs, baton->lock_pool);
                        baton->is_global_lock = FALSE;
                        break;
     }
@@ -1574,7 +1562,7 @@ svn_fs_fs__create(svn_fs_t *fs,
                              (format >= SVN_FS_FS__MIN_NO_GLOBAL_IDS_FORMAT
                               ? "0\n" : "0 1 1\n"),
                              pool));
-  SVN_ERR(svn_io_file_create_empty(path_lock(fs, pool), pool));
+  SVN_ERR(svn_io_file_create_empty(svn_fs_fs__path_lock(fs, pool), pool));
   SVN_ERR(svn_fs_fs__set_uuid(fs, NULL, pool));
 
   SVN_ERR(write_revision_zero(fs));

Modified: subversion/trunk/subversion/libsvn_fs_fs/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/util.c?rev=1588901&r1=1588900&r2=1588901&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/util.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/util.c Mon Apr 21 15:26:40 2014
@@ -77,6 +77,13 @@ svn_fs_fs__path_lock(svn_fs_t *fs,
 }
 
 const char *
+svn_fs_fs__path_pack_lock(svn_fs_t *fs,
+                          apr_pool_t *pool)
+{
+  return svn_dirent_join(fs->path, PATH_PACK_LOCK_FILE, pool);
+}
+
+const char *
 svn_fs_fs__path_revprop_generation(svn_fs_t *fs,
                                    apr_pool_t *pool)
 {

Modified: subversion/trunk/subversion/libsvn_fs_fs/util.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/util.h?rev=1588901&r1=1588900&r2=1588901&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/util.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/util.h Mon Apr 21 15:26:40 2014
@@ -123,6 +123,13 @@ const char *
 svn_fs_fs__path_lock(svn_fs_t *fs,
                      apr_pool_t *pool);
 
+/* Return the full path of the pack operation lock file in FS.
+ * The result will be allocated in POOL.
+ */
+const char *
+svn_fs_fs__path_pack_lock(svn_fs_t *fs,
+                          apr_pool_t *pool);
+
 /* Return the full path of the revprop generation file in FS.
  * Allocate the result in POOL.
  */



Mime
View raw message