subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1562222 - /subversion/trunk/subversion/libsvn_fs_x/index.c
Date Tue, 28 Jan 2014 20:39:23 GMT
Author: stefan2
Date: Tue Jan 28 20:39:23 2014
New Revision: 1562222

URL: http://svn.apache.org/r1562222
Log:
Reduce the lifetime of open proto index files when building log-to-phys and
phys-to-log indices in FSX.  These files are only required locally, so there is
no reason not to close them as soon as possible.  This changeset fixes the
ENOTEMPTY error when committing things (purging transactions, actually) to FSX
repositories on Windows and unbreaks every non-trivial --fs-type=fsx test.

* subversion/libsvn_fs_x/index.c
  (svn_fs_x__l2p_index_create, svn_fs_x__p2l_index_create):
    For consistency, open the proto index files in LOCAL_POOL.  Explicitly call
    svn_io_file_close() for these files when they are no longer required.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

Modified:
    subversion/trunk/subversion/libsvn_fs_x/index.c

Modified: subversion/trunk/subversion/libsvn_fs_x/index.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/index.c?rev=1562222&r1=1562221&r2=1562222&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/index.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/index.c Tue Jan 28 20:39:23 2014
@@ -696,7 +696,7 @@ svn_fs_x__l2p_index_create(svn_fs_t *fs,
   /* start at the beginning of the source file */
   SVN_ERR(svn_io_file_open(&proto_index, proto_file_name,
                            APR_READ | APR_CREATE | APR_BUFFERED,
-                           APR_OS_DEFAULT, pool));
+                           APR_OS_DEFAULT, local_pool));
 
   /* process all entries until we fail due to EOF */
   for (entry = 0; !eof; ++entry)
@@ -755,6 +755,9 @@ svn_fs_x__l2p_index_create(svn_fs_t *fs,
         }
     }
 
+  /* we are now done with the source file */
+  SVN_ERR(svn_io_file_close(proto_index, local_pool));
+
   /* create the target file */
   SVN_ERR(svn_io_file_open(&index_file, file_name, APR_WRITE
                            | APR_CREATE | APR_TRUNCATE | APR_BUFFERED,
@@ -1720,7 +1723,7 @@ svn_fs_x__p2l_index_create(svn_fs_t *fs,
   /* start at the beginning of the source file */
   SVN_ERR(svn_io_file_open(&proto_index, proto_file_name,
                            APR_READ | APR_CREATE | APR_BUFFERED,
-                           APR_OS_DEFAULT, pool));
+                           APR_OS_DEFAULT, local_pool));
 
   /* process all entries until we fail due to EOF */
   while (!eof)
@@ -1818,6 +1821,9 @@ svn_fs_x__p2l_index_create(svn_fs_t *fs,
       svn_pool_clear(iter_pool);
     }
 
+  /* we are now done with the source file */
+  SVN_ERR(svn_io_file_close(proto_index, local_pool));
+
   /* store length of last table */
   APR_ARRAY_PUSH(table_sizes, apr_uint64_t)
       = svn_spillbuf__get_size(buffer) - last_buffer_size;



Mime
View raw message