]> www.infradead.org Git - users/hch/fsqual.git/commitdiff
Merge run_test() and test_concurrent_append()
authorAvi Kivity <avi@scylladb.com>
Tue, 5 Jan 2021 11:10:06 +0000 (13:10 +0200)
committerAvi Kivity <avi@scylladb.com>
Tue, 5 Jan 2021 11:10:06 +0000 (13:10 +0200)
The split no longer makes any sense.

fsqual.cc

index 4638573e58a0f17ecfde7bdd4db5234fb34ea573..7a6d57ced9224d26c8a28d4adc24313d033b9684 100644 (file)
--- a/fsqual.cc
+++ b/fsqual.cc
@@ -41,7 +41,17 @@ with_ctxsw_counting(Counter& counter, Func&& func) {
     return func();
 }
 
-void test_concurrent_append(io_context_t ioctx, int fd, unsigned iodepth, size_t bufsize, bool pretruncate, bool prezero) {
+void run_test(unsigned iodepth, size_t bufsize, bool pretruncate, bool prezero) {
+    io_context_t ioctx = {};
+    io_setup(128, &ioctx);
+    auto fname = "fsqual.tmp";
+    int fd = open(fname, O_CREAT|O_EXCL|O_RDWR|O_DIRECT, 0600);
+    fsxattr attr = {};
+    attr.fsx_xflags |= XFS_XFLAG_EXTSIZE;
+    attr.fsx_extsize = 32 << 20; // 32MB
+    // Ignore error; may be !xfs, and just a hint anyway
+    ::ioctl(fd, XFS_IOC_FSSETXATTR, &attr);
+    unlink(fname);
     if (pretruncate) {
         ftruncate(fd, off_t(1) << 30);
     }
@@ -94,20 +104,6 @@ void test_concurrent_append(io_context_t ioctx, int fd, unsigned iodepth, size_t
     if (std::any_of(incore.begin(), incore.end(), [] (uint8_t m) { return m & 1; })) {
         std::cout << "Seen data in page cache (BAD)\n";
     }
-}
-
-void run_test(unsigned iodepth, size_t bufsize, bool pretruncate, bool prezero) {
-    io_context_t ioctx = {};
-    io_setup(128, &ioctx);
-    auto fname = "fsqual.tmp";
-    int fd = open(fname, O_CREAT|O_EXCL|O_RDWR|O_DIRECT, 0600);
-    fsxattr attr = {};
-    attr.fsx_xflags |= XFS_XFLAG_EXTSIZE;
-    attr.fsx_extsize = 32 << 20; // 32MB
-    // Ignore error; may be !xfs, and just a hint anyway
-    ::ioctl(fd, XFS_IOC_FSSETXATTR, &attr);
-    unlink(fname);
-    test_concurrent_append(ioctx, fd, iodepth, bufsize, pretruncate, prezero);
     close(fd);
     io_destroy(ioctx);
 }