t/io_uring: only enable sync if we have preadv2
authorJens Axboe <axboe@kernel.dk>
Fri, 11 Mar 2022 02:09:56 +0000 (19:09 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 11 Mar 2022 02:09:56 +0000 (19:09 -0700)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/io_uring.c

index 157eea9e516b56875a1d41d1c613f7f7058eb6f4..100359129cf07bc2f040a7d2037965bb33136da9 100644 (file)
@@ -939,6 +939,7 @@ submit:
        return NULL;
 }
 
+#ifdef CONFIG_PWRITEV2
 static void *submitter_sync_fn(void *data)
 {
        struct submitter *s = data;
@@ -1004,6 +1005,13 @@ static void *submitter_sync_fn(void *data)
        finish = 1;
        return NULL;
 }
+#else
+static void *submitter_sync_fn(void *data)
+{
+       finish = 1;
+       return NULL;
+}
+#endif
 
 static struct submitter *get_submitter(int offset)
 {
@@ -1346,7 +1354,12 @@ int main(int argc, char *argv[])
                        register_ring = !!atoi(optarg);
                        break;
                case 'S':
+#ifdef CONFIG_PWRITEV2
                        use_sync = !!atoi(optarg);
+#else
+                       fprintf(stderr, "preadv2 not supported\n");
+                       exit(1);
+#endif
                        break;
                case 'h':
                case '?':