X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fdirectio.c;h=1108cba9bdcf897aa3eb07d3329bb6e1146de7e4;hb=ed4405b2419b5e819ea9d5d37ea1dab7c6a63a57;hp=ebcedb2c781063e69a3716234228b480efd27622;hpb=d2d56f38da01001c92a09afc6b52b5acbd9bc13c;p=fs%2Flustre-release.git diff --git a/lustre/tests/directio.c b/lustre/tests/directio.c index ebcedb2..1108cba 100644 --- a/lustre/tests/directio.c +++ b/lustre/tests/directio.c @@ -23,11 +23,12 @@ int main(int argc, char **argv) long len; off64_t seek; struct stat64 st; + char pad = 0xba; int action; int rc; if (argc < 5 || argc > 6) { - printf("Usage: %s file seek nr_blocks [blocksize]\n", argv[0]); + printf("Usage: %s file seek nr_blocks [blocksize]\n", argv[0]); return 1; } @@ -37,7 +38,10 @@ int main(int argc, char **argv) action = O_WRONLY; else if (!strcmp(argv[1], "rdwr")) action = O_RDWR; - else { + else if (!strcmp(argv[1], "readhole")) { + action = O_RDONLY; + pad = 0; + } else { printf("Usage: %s file seek nr_blocks [blocksize]\n", argv[0]); return 1; } @@ -74,7 +78,7 @@ int main(int argc, char **argv) printf("No memory %s\n", strerror(errno)); return 1; } - memset(wbuf, 0xba, len); + memset(wbuf, pad, len); if (action == O_WRONLY || action == O_RDWR) { if (lseek64(fd, seek, SEEK_SET) < 0) {