io_uring: mark us with IORING_FEAT_SUBMIT_STABLE
authorJens Axboe <axboe@kernel.dk>
Tue, 3 Dec 2019 01:51:26 +0000 (18:51 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 3 Dec 2019 14:04:32 +0000 (07:04 -0700)
If this flag is set, applications can be certain that any data for
async offload has been consumed when the kernel has consumed the
SQE.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/uapi/linux/io_uring.h

index 5fcd89c..c47a08a 100644 (file)
@@ -5077,7 +5077,8 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p)
        if (ret < 0)
                goto err;
 
-       p->features = IORING_FEAT_SINGLE_MMAP | IORING_FEAT_NODROP;
+       p->features = IORING_FEAT_SINGLE_MMAP | IORING_FEAT_NODROP |
+                       IORING_FEAT_SUBMIT_STABLE;
        trace_io_uring_create(ret, ctx, p->sq_entries, p->cq_entries, p->flags);
        return ret;
 err:
index 4637ed1..eabccb4 100644 (file)
@@ -157,6 +157,7 @@ struct io_uring_params {
  */
 #define IORING_FEAT_SINGLE_MMAP                (1U << 0)
 #define IORING_FEAT_NODROP             (1U << 1)
+#define IORING_FEAT_SUBMIT_STABLE      (1U << 2)
 
 /*
  * io_uring_register(2) opcodes and arguments