Whamcloud - gitweb
LU-14499 lnet: Revert "LU-13368 lnet: discard the callback"
[fs/lustre-release.git] / lustre / tests / rwv.c
index 331586d..bc10d3f 100644 (file)
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/tests/rwv.c
  */
 #define ACT_VERIFY      16
 #define ACT_OUTPUT     32
 
-void usage()
+static void usage(void)
 {
        printf("usage: rwv -f filename <-r|-w> [-a] [-z] [-d] [-v]");
        printf(" [-s offset] [-o[outf]] -n iovcnt SIZE1 SIZE2 SIZE3...\n");
        printf("-a  append IO (O_APPEND)\n");
        printf("-r  file read (O_RDONLY)\n");
        printf("-w  file write (O_WRONLY)\n");
+       printf("-D  open file with (O_DIRECT)\n");
        printf("-s  set the start pos of the read/write test\n");
        printf("-z  test for read hitting hole\n");
        printf("-d  create flags (O_LOV_DELAY_CREATE)\n");
@@ -67,7 +67,7 @@ void usage()
        printf("-o  write the file content of read to an optional file\n");
 }
 
-int data_verify(struct iovec *iov, int iovcnt, char c)
+static int data_verify(struct iovec *iov, int iovcnt, char c)
 {
        int i;
 
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
        struct iovec *iov;
        off64_t offset = 0;
 
-       while ((c = getopt(argc, argv, "f:n:s:rwahvdzo::")) != -1) {
+       while ((c = getopt(argc, argv, "f:n:s:rwahvdDzo::")) != -1) {
                switch (c) {
                case 'f':
                        fname = optarg;
@@ -139,6 +139,9 @@ int main(int argc, char **argv)
                case 'd':
                        flags |= O_LOV_DELAY_CREATE;
                        break;
+               case 'D':
+                       flags |= O_DIRECT;
+                       break;
                case 'z':
                        pad = 0;
                        act |= ACT_READHOLE;