From f69876e558782eb770955aa0b1344a5a8262548b Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Wed, 30 Mar 2011 22:50:05 +0100 Subject: copy: with fiemap copy, only sync when needed * src/extent-scan.h (struct extent_scan): Add the fm_flags member to pass to the fiemap scan. * src/extent-scan.c (extent_need_sync): A new function used to detect Linux kernels before 2.6.38. (extent_scan_init): Add FIEMAP_FLAG_SYNC when needed. * tests/cp/sparse-fiemap: Adjust comment. * NEWS: Mention the change in behavior. Indirectly suggested by Mike Frysinger --- tests/cp/sparse-fiemap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap index 73448ecfa..bac289093 100755 --- a/tests/cp/sparse-fiemap +++ b/tests/cp/sparse-fiemap @@ -69,8 +69,8 @@ for i in $(seq 1 2 21); do -e 'for (1..'$j') { sysseek (*F, $n, 1)' \ -e '&& syswrite (*F, chr($_)x$n) or die "$!"}' > j1 || fail=1 - # Note there is an implicit sync performed by cp to - # work around bugs in EXT4 and BTRFS before Linux 2.6.38 + # Note there is an implicit sync performed by cp on Linux kernels + # before 2.6.38 to work around bugs in EXT4 and BTRFS. # Note also the -s parameter to the filefrag commands below # for the same reasons. cp --sparse=always j1 j2 || fail=1 -- cgit v1.2.3-54-g00ecf