Author: stefan2
Date: Fri Oct 30 10:39:54 2015
New Revision: 1711443
URL: http://svn.apache.org/viewvc?rev=1711443&view=rev
Log:
Re-enable proper fsync'ing in FSX for renames on non-POSIX platforms.
* subversion/libsvn_fs_x/util.c
(svn_fs_x__move_into_place): Use the batching infrastructure on POSIX only.
Modified:
subversion/trunk/subversion/libsvn_fs_x/util.c
Modified: subversion/trunk/subversion/libsvn_fs_x/util.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/util.c?rev=1711443&r1=1711442&r2=1711443&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/util.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/util.c Fri Oct 30 10:39:54 2015
@@ -732,14 +732,24 @@ svn_fs_x__move_into_place(const char *ol
/* Copying permissions is a no-op on WIN32. */
SVN_ERR(svn_io_copy_perms(perms_reference, old_filename, scratch_pool));
- /* TODO: teach svn_fs_x__batch_fsync_t how to properly rename on Win32. */
-
+ /* We use specific 'fsyncing move' Win32 API calls on Windows while the
+ * directory update fsync is POSIX-only. Moreover, there tend to be only
+ * a few moved files (1 or 2) per batch.
+ *
+ * Therefore, we use the platform-optimized "immediate" fsyncs on all
+ * non-POSIX platforms and the "scheduled" fsyncs on POSIX only.
+ */
+#if defined(SVN_ON_POSIX)
/* Move the file into place. */
SVN_ERR(svn_io_file_rename2(old_filename, new_filename, FALSE,
scratch_pool));
/* Schedule for synchronization. */
SVN_ERR(svn_fs_x__batch_fsync_new_path(batch, new_filename, scratch_pool));
+#else
+ SVN_ERR(svn_io_file_rename2(old_filename, new_filename, TRUE,
+ scratch_pool));
+#endif
return SVN_NO_ERROR;
}