summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author李通洲 <carter.li@eoitek.com>2021-09-26 07:42:56 +0000
committer李通洲 <carter.li@eoitek.com>2021-09-26 07:44:35 +0000
commit117cb534abd9773d6f41b35e11311494e7e39be5 (patch)
tree9c2250a5697437c970707d2b8941fd4a5a698c3a
parent0f289c978846862ad4dec29de415e144c5cb05f9 (diff)
downloadliburing-117cb534abd9773d6f41b35e11311494e7e39be5.tar.gz
liburing-117cb534abd9773d6f41b35e11311494e7e39be5.tar.bz2
liburing.h: add io_uring_prep_close_direct
Signed-off-by: 李通洲 <carter.li@eoitek.com>
-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)
{