Author: stefan2
Date: Sun Aug 24 22:09:38 2014
New Revision: 1620211

URL: http://svn.apache.org/r1620211
Log:
On the revprop-caching-ng branch:  Minor refactoring.

* subversion/libsvn_fs_fs/revprops.c
  (close_revprop_generation_file): New function, extracted from ...
  (svn_fs_fs__reset_revprop_generation_file): ... this.

Modified:
    subversion/branches/revprop-caching-ng/subversion/libsvn_fs_fs/revprops.c

Modified: 
subversion/branches/revprop-caching-ng/subversion/libsvn_fs_fs/revprops.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/revprop-caching-ng/subversion/libsvn_fs_fs/revprops.c?rev=1620211&r1=1620210&r2=1620211&view=diff
==============================================================================
--- subversion/branches/revprop-caching-ng/subversion/libsvn_fs_fs/revprops.c 
(original)
+++ subversion/branches/revprop-caching-ng/subversion/libsvn_fs_fs/revprops.c 
Sun Aug 24 22:09:38 2014
@@ -196,6 +196,23 @@ ensure_revprop_generation(svn_fs_t *fs,
   return SVN_NO_ERROR;
 }
 
+/* If the revprop generation file in FS is open, close it.  This is a no-op
+ * if the file is not open.
+ */
+static svn_error_t *
+close_revprop_generation_file(svn_fs_t *fs,
+                              apr_pool_t *scratch_pool)
+{
+  fs_fs_data_t *ffd = fs->fsap_data;
+  if (ffd->revprop_generation_file)
+    {
+      SVN_ERR(svn_io_file_close(ffd->revprop_generation_file, scratch_pool));
+      ffd->revprop_generation_file = NULL;
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* Read revprop generation as stored on disk for repository FS. The result is
  * returned in *CURRENT.  Call only for repos that support revprop caching.
  */
@@ -260,11 +277,7 @@ svn_fs_fs__reset_revprop_generation_file
 
   /* Unconditionally close the revprop generation file.
    * Don't care about FS formats. This ensures consistent internal state. */
-  if (ffd->revprop_generation_file)
-    {
-      SVN_ERR(svn_io_file_close(ffd->revprop_generation_file, scratch_pool));
-      ffd->revprop_generation_file = NULL;
-    }
+  SVN_ERR(close_revprop_generation_file(fs, scratch_pool));
 
   /* Unconditionally remove any old revprop generation file.
    * Don't care about FS formats.  This ensures consistent on-disk state


Reply via email to