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/17 14:34:44 UTC

svn commit: r1504098 - in /subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs: fs_fs.c fs_fs.h

Author: stefan2
Date: Wed Jul 17 12:34:44 2013
New Revision: 1504098

URL: http://svn.apache.org/r1504098
Log:
On the fsfs-improvements branch:  remove static functions that are
already available via private API.

Also, make with_txn_current_lock available through a private API
as well (symmetrical to svn_fs_fs__with_write_lock.

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__with_txn_current_lock): declare a new private API

* subversion/libsvn_fs_fs/fs_fs.c
  (path_txn_current,
   path_txn_current_lock): drop
  (upgrade_body,
   get_and_increment_txn_key_body, 
   create_txn_dir,
   svn_fs_fs__create): call the APIs
  (with_txn_current_lock): rename to ...
  (svn_fs_fs__with_txn_current_lock): this

Modified:
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.h

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c?rev=1504098&r1=1504097&r2=1504098&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c Wed Jul 17 12:34:44 2013
@@ -147,18 +147,6 @@ svn_fs_fs__path_current(svn_fs_t *fs, ap
 }
 
 static APR_INLINE const char *
-path_txn_current(svn_fs_t *fs, apr_pool_t *pool)
-{
-  return svn_dirent_join(fs->path, PATH_TXN_CURRENT, pool);
-}
-
-static APR_INLINE const char *
-path_txn_current_lock(svn_fs_t *fs, apr_pool_t *pool)
-{
-  return svn_dirent_join(fs->path, PATH_TXN_CURRENT_LOCK, 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);
@@ -440,21 +428,21 @@ svn_fs_fs__with_write_lock(svn_fs_t *fs,
 
 /* Run BODY (with BATON and POOL) while the txn-current file
    of FS is locked. */
-static svn_error_t *
-with_txn_current_lock(svn_fs_t *fs,
-                      svn_error_t *(*body)(void *baton,
-                                           apr_pool_t *pool),
-                      void *baton,
-                      apr_pool_t *pool)
+svn_error_t *
+svn_fs_fs__with_txn_current_lock(svn_fs_t *fs,
+                                 svn_error_t *(*body)(void *baton,
+                                                      apr_pool_t *pool),
+                                 void *baton,
+                                 apr_pool_t *pool)
 {
   fs_fs_data_t *ffd = fs->fsap_data;
   fs_fs_shared_data_t *ffsd = ffd->shared;
 
   SVN_MUTEX__WITH_LOCK(ffsd->txn_current_lock,
                        with_some_lock_file(fs, body, baton,
-                                           path_txn_current_lock(fs, pool),
-                                           FALSE,
-                                           pool));
+                               svn_fs_fs__path_txn_current_lock(fs, pool),
+                               FALSE,
+                               pool));
 
   return SVN_NO_ERROR;
 }
@@ -1182,10 +1170,12 @@ upgrade_body(void *baton, apr_pool_t *po
      file', make that file and its corresponding lock file. */
   if (format < SVN_FS_FS__MIN_TXN_CURRENT_FORMAT)
     {
-      SVN_ERR(create_file_ignore_eexist(path_txn_current(fs, pool), "0\n",
-                                        pool));
-      SVN_ERR(create_file_ignore_eexist(path_txn_current_lock(fs, pool), "",
-                                        pool));
+      SVN_ERR(create_file_ignore_eexist(
+                           svn_fs_fs__path_txn_current(fs, pool), "0\n",
+                           pool));
+      SVN_ERR(create_file_ignore_eexist(
+                           svn_fs_fs__path_txn_current_lock(fs, pool), "",
+                           pool));
     }
 
   /* If our filesystem predates the existance of the 'txn-protorevs'
@@ -1918,7 +1908,8 @@ static svn_error_t *
 get_and_increment_txn_key_body(void *baton, apr_pool_t *pool)
 {
   struct get_and_increment_txn_key_baton *cb = baton;
-  const char *txn_current_filename = path_txn_current(cb->fs, pool);
+  const char *txn_current_filename
+    = svn_fs_fs__path_txn_current(cb->fs, pool);
   char next_txn_id[MAX_KEY_SIZE+3];
   apr_size_t len;
 
@@ -1959,10 +1950,10 @@ create_txn_dir(const char **id_p, svn_fs
      number the transaction is based off into the transaction id. */
   cb.pool = pool;
   cb.fs = fs;
-  SVN_ERR(with_txn_current_lock(fs,
-                                get_and_increment_txn_key_body,
-                                &cb,
-                                pool));
+  SVN_ERR(svn_fs_fs__with_txn_current_lock(fs,
+                                           get_and_increment_txn_key_body,
+                                           &cb,
+                                           pool));
   *id_p = apr_psprintf(pool, "%ld-%s", rev, cb.txn_id);
 
   txn_dir = svn_dirent_join_many(pool,
@@ -4157,9 +4148,9 @@ svn_fs_fs__create(svn_fs_t *fs,
      the transaction sequence file. */
   if (format >= SVN_FS_FS__MIN_TXN_CURRENT_FORMAT)
     {
-      SVN_ERR(svn_io_file_create(path_txn_current(fs, pool),
+      SVN_ERR(svn_io_file_create(svn_fs_fs__path_txn_current(fs, pool),
                                  "0\n", pool));
-      SVN_ERR(svn_io_file_create(path_txn_current_lock(fs, pool),
+      SVN_ERR(svn_io_file_create(svn_fs_fs__path_txn_current_lock(fs, pool),
                                  "", pool));
     }
 

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.h?rev=1504098&r1=1504097&r2=1504098&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.h Wed Jul 17 12:34:44 2013
@@ -316,6 +316,15 @@ svn_fs_fs__with_write_lock(svn_fs_t *fs,
                            void *baton,
                            apr_pool_t *pool);
 
+/* Run BODY (with BATON and POOL) while the txn-current file
+   of FS is locked. */
+svn_error_t *
+svn_fs_fs__with_txn_current_lock(svn_fs_t *fs,
+                                 svn_error_t *(*body)(void *baton,
+                                                      apr_pool_t *pool),
+                                 void *baton,
+                                 apr_pool_t *pool);
+
 /* Find the value of the property named PROPNAME in transaction TXN.
    Return the contents in *VALUE_P.  The contents will be allocated
    from POOL. */