summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-04-20 09:49:15 +0200
committerJim Meyering <meyering@redhat.com>2011-04-20 17:11:15 +0200
commit9bcd045f812a75cf96ba392bc45529422f87c088 (patch)
treeeb353fe148a01aac85c8ad5965e800dc12534283 /src
parent48306b83bececcce14d688e18bd84ee9861e503e (diff)
downloadcoreutils-9bcd045f812a75cf96ba392bc45529422f87c088.tar.xz
copy: always use FIEMAP_FLAG_SYNC, for now
* src/extent-scan.c (extent_need_sync): Always return true, to make the sole caller always use FIEMAP_FLAG_SYNC. This will doubtless have an undesirable performance impact, but we'll mitigate that shortly, by using extent_copy only on files with holes.
Diffstat (limited to 'src')
-rw-r--r--src/extent-scan.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/extent-scan.c b/src/extent-scan.c
index da7eb9d6e..596e7f791 100644
--- a/src/extent-scan.c
+++ b/src/extent-scan.c
@@ -36,6 +36,13 @@
static bool
extent_need_sync (void)
{
+ /* For now always return true, to be on the safe side.
+ If/when FIEMAP semantics are well defined (before SEEK_HOLE support
+ is usable) and kernels implementing them are in use, we may relax
+ this once again. */
+ return true;
+
+#if FIEMAP_BEHAVIOR_IS_DEFINED_AND_USABLE
static int need_sync = -1;
if (need_sync == -1)
@@ -57,6 +64,7 @@ extent_need_sync (void)
}
return need_sync;
+#endif
}
/* Allocate space for struct extent_scan, initialize the entries if