aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-12-25 16:33:42 -0700
committerJens Axboe <axboe@kernel.dk>2020-01-20 17:03:59 -0700
commitba04291eb66ed895f194ae5abd3748d72bf8aaea (patch)
tree398b8455348b4b2a2171554f01447c74ffb9f28e /include/uapi
parentio_uring: add non-vectored read/write commands (diff)
downloadlinux-dev-ba04291eb66ed895f194ae5abd3748d72bf8aaea.tar.xz
linux-dev-ba04291eb66ed895f194ae5abd3748d72bf8aaea.zip
io_uring: allow use of offset == -1 to mean file position
This behaves like preadv2/pwritev2 with offset == -1, it'll use (and update) the current file position. This obviously comes with the caveat that if the application has multiple read/writes in flight, then the end result will not be as expected. This is similar to threads sharing a file descriptor and doing IO using the current file position. Since this feature isn't easily detectable by doing a read or write, add a feature flags, IORING_FEAT_RW_CUR_POS, to allow applications to detect presence of this feature. Reported-by: 李通洲 <carter.li@eoitek.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/io_uring.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index 7fdf994f3313..1f96136eb6ee 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -174,6 +174,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)
+#define IORING_FEAT_RW_CUR_POS (1U << 3)
/*
* io_uring_register(2) opcodes and arguments