summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-09-26 09:56:15 -0600
committerJens Axboe <axboe@kernel.dk>2021-09-26 09:56:15 -0600
commit712921dc55216b72df559ab7db7832cfca1ff548 (patch)
tree9c2250a5697437c970707d2b8941fd4a5a698c3a
parent0f289c978846862ad4dec29de415e144c5cb05f9 (diff)
parent117cb534abd9773d6f41b35e11311494e7e39be5 (diff)
downloadliburing-712921dc55216b72df559ab7db7832cfca1ff548.tar.gz
liburing-712921dc55216b72df559ab7db7832cfca1ff548.tar.bz2
Merge branch 'master' of https://github.com/CarterLi/liburing
* 'master' of https://github.com/CarterLi/liburing: liburing.h: add io_uring_prep_close_direct
-rw-r--r--src/include/liburing.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 38dbbfe..0c2c5c2 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -501,6 +501,13 @@ static inline void io_uring_prep_close(struct io_uring_sqe *sqe, int fd)
io_uring_prep_rw(IORING_OP_CLOSE, sqe, fd, NULL, 0, 0);
}
+static inline void io_uring_prep_close_direct(struct io_uring_sqe *sqe,
+ unsigned file_index)
+{
+ io_uring_prep_close(sqe, 0);
+ __io_uring_set_target_fixed_file(sqe, file_index);
+}
+
static inline void io_uring_prep_read(struct io_uring_sqe *sqe, int fd,
void *buf, unsigned nbytes, __u64 offset)
{