io_uring: add IORING_OP_MADVISE

This adds support for doing madvise(2) through io_uring. We assume that
any operation can block, and hence punt everything async. This could be
improved, but hard to make bullet proof. The async punt ensures it's
safe.

Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2019-12-25 22:18:28 -07:00
parent db08ca2525
commit c1ca757bd6
2 changed files with 60 additions and 0 deletions

View File

@@ -88,6 +88,7 @@ enum {
IORING_OP_READ,
IORING_OP_WRITE,
IORING_OP_FADVISE,
IORING_OP_MADVISE,
/* this goes last, obviously */
IORING_OP_LAST,