Whamcloud - gitweb
b=99
authorphil <phil>
Sat, 11 Oct 2003 22:28:23 +0000 (22:28 +0000)
committerphil <phil>
Sat, 11 Oct 2003 22:28:23 +0000 (22:28 +0000)
Andreas's sync patch, with an (almost) related journal cleanup to remove
fsfilt_journal_data; we no longer use this barely-maintained eature,
and our special files don't see normal write()s anyways

lustre/obdclass/simple.c
lustre/tests/multiop.c
lustre/utils/wirecheck.c

index a285fb7..722de4a 100644 (file)
@@ -264,17 +264,3 @@ int lustre_fwrite(struct file *file, const void *buf, int len, loff_t *off)
 }
 EXPORT_SYMBOL(lustre_fwrite);
 
-/*
- * Sync a file from within kernel context.  Prior to calling this
- * function we should already have done a push_ctxt().
- */
-int lustre_fsync(struct file *file)
-{
-        ENTRY;
-        ASSERT_KERNEL_CTXT("kernel doing sync outside kernel context\n");
-        if (!file || !file->f_op || !file->f_op->fsync)
-                RETURN(-ENOSYS);
-
-        RETURN(file->f_op->fsync(file, file->f_dentry, 0));
-}
-EXPORT_SYMBOL(lustre_fsync);
index 6436190..54199de 100755 (executable)
@@ -33,6 +33,8 @@ char usage[] =
 "        T  ftruncate to zero\n"
 "        w  write\n"
 "        W  write entire mmap-ed region\n"
+"        y  fsync\n"
+"        Y  fdatasync\n"
 "        z  seek to zero\n";
 
 void null_handler(int unused) { }
@@ -158,6 +160,17 @@ int main(int argc, char **argv)
                        for (i = 0; i < mmap_len && mmap_ptr; i += 4096)
                                mmap_ptr[i] += junk++;
                        break;
+               case 'y':
+                       if (fsync(fd) == -1) {
+                               perror("fsync");
+                               exit(1);
+                       }
+                       break;
+               case 'Y':
+                       if (fdatasync(fd) == -1) {
+                               perror("fdatasync");
+                               exit(1);
+                       }
                case 'z':
                        if (lseek(fd, 0, SEEK_SET) == -1) {
                                perror("lseek");
index 27c6aab..ae6e217 100644 (file)
@@ -464,7 +464,7 @@ main (int argc, char **argv)
        CHECK_VALUE (OST_STATFS);
        CHECK_VALUE (OST_SAN_READ);
        CHECK_VALUE (OST_SAN_WRITE);
-       CHECK_VALUE (OST_SYNCFS);
+       CHECK_VALUE (OST_SYNC);
        CHECK_VALUE (OST_LAST_OPC);
        CHECK_VALUE (OST_FIRST_OPC);