]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: allow use of offset == -1 to mean file position
authorJens Axboe <axboe@kernel.dk>
Wed, 25 Dec 2019 23:33:42 +0000 (16:33 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 21 Jan 2020 00:03:59 +0000 (17:03 -0700)
commit8b70e8a93bd1875cddf4309ed3fe1fb9f322e1e1
tree398b8455348b4b2a2171554f01447c74ffb9f28e
parent35e245136297c629951d1db1ad922a45aed2b80c
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>
fs/io_uring.c
include/uapi/linux/io_uring.h