From c5f019381fe66734e75af64733d7f0d00a69ef70 Mon Sep 17 00:00:00 2001 From: phil Date: Sat, 11 Oct 2003 22:28:23 +0000 Subject: [PATCH] b=99 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 | 14 -------------- lustre/tests/multiop.c | 13 +++++++++++++ lustre/utils/wirecheck.c | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lustre/obdclass/simple.c b/lustre/obdclass/simple.c index a285fb7..722de4a 100644 --- a/lustre/obdclass/simple.c +++ b/lustre/obdclass/simple.c @@ -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); diff --git a/lustre/tests/multiop.c b/lustre/tests/multiop.c index 6436190..54199de 100755 --- a/lustre/tests/multiop.c +++ b/lustre/tests/multiop.c @@ -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"); diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 27c6aab..ae6e217 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -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); -- 1.8.3.1