t/io_uring: don't require a file for do_nop runs
authorJens Axboe <axboe@kernel.dk>
Mon, 13 Sep 2021 19:14:29 +0000 (13:14 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 13 Sep 2021 19:14:29 +0000 (13:14 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/io_uring.c

index c9ca3e9d23d6f2638b08b146e707a1527de152b5..ff0dc609d45597999af4a962c1902ed9d25eb88f 100644 (file)
@@ -626,16 +626,18 @@ int main(int argc, char *argv[])
        j = 0;
        i = optind;
        nfiles = argc - i;
-       if (!nfiles) {
-               printf("No files specified\n");
-               usage(argv[0], 1);
-       }
-       threads_per_f = nthreads / nfiles;
-       /* make sure each thread gets assigned files */
-       if (threads_per_f == 0) {
-               threads_per_f = 1;
-       } else {
-               threads_rem = nthreads - threads_per_f * nfiles;
+       if (!do_nop) {
+               if (!nfiles) {
+                       printf("No files specified\n");
+                       usage(argv[0], 1);
+               }
+               threads_per_f = nthreads / nfiles;
+               /* make sure each thread gets assigned files */
+               if (threads_per_f == 0) {
+                       threads_per_f = 1;
+               } else {
+                       threads_rem = nthreads - threads_per_f * nfiles;
+               }
        }
        while (!do_nop && i < argc) {
                int k, limit;