diff options
author | Kent Overstreet <koverstreet@google.com> | 2013-06-28 13:34:54 -0700 |
---|---|---|
committer | Kent Overstreet <koverstreet@google.com> | 2013-06-28 13:34:54 -0700 |
commit | d356fcd69117a03ea7d35150a3499986ee437b76 (patch) | |
tree | dfa52c81cf9ae492e13a255f4d7359c63e21690e | |
parent | 79b506457edc60d0b34fadefc0c84176b18b09b1 (diff) |
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | aio-cancel.c | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -4,3 +4,4 @@ aio-cancel-old cscope.* tags *.o +*.d diff --git a/aio-cancel.c b/aio-cancel.c index f5936cc..846fe6a 100644 --- a/aio-cancel.c +++ b/aio-cancel.c @@ -137,7 +137,7 @@ int main(int argc, char const *argv[]) exit(EXIT_FAILURE); } - blocks -= iosize / 512; + blocks -= iosize / 512; /* avoid reading past the end of the file */ printf("Doing %lu random reads to %s with iodepth %lu, iosize %lu\n", nr_ios, argv[1], iodepth, iosize); @@ -153,7 +153,7 @@ int main(int argc, char const *argv[]) iocb = malloc(sizeof(struct iocb)); io_prep_pread(iocb, fd, buffer, iosize, - (random() % blocks) * 512); + (random() % (blocks + 1)) * 512); ret = io_submit(io_ctx, 1, &iocb); if (ret != 1) |