summaryrefslogtreecommitdiffstats
path: root/test-file-zero-alloc-speed.c
diff options
context:
space:
mode:
Diffstat (limited to 'test-file-zero-alloc-speed.c')
-rw-r--r--test-file-zero-alloc-speed.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test-file-zero-alloc-speed.c b/test-file-zero-alloc-speed.c
index fbd8a03..dacb1c2 100644
--- a/test-file-zero-alloc-speed.c
+++ b/test-file-zero-alloc-speed.c
@@ -50,6 +50,18 @@ int pre_test_setup(char *source, char *target, char *fstype,
perror("open");
return -1;
}
+
+ /* Flush out all other data that might be pending writing to
+ * the disk. We don't want to count the time we wait for the
+ * buffers of other apps to clear. (Ideally, this test would
+ * be run in single user mode with nothing else running on the
+ * system.)
+ */
+ sync();
+ sync();
+ /* Just to be sure - http://lwn.net/Articles/325420/ */
+ sync();
+
return 0;
}