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
}
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);
" 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) { }
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");
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);