add mkdirat support
cover add mkdirat support
This series adds support for mkdirat opcode along with a testcase for it to liburing. Heavily based on a series that added unlinkat support (commit: 44db0f437a2b ("io_uring.h: add renameat and unlinkat opcodes") and a couple of subsequent ones).
The kernel side of the change:
https://lore.kernel.org/io-uring/[email protected]/T/
Dmitry Kadashev (3):
io_uring.h: add mkdirat opcode
liburing.h: add mkdirat prep helpers
Add mkdirat test case
.gitignore | 1 + src/include/liburing.h | 6 ++ src/include/liburing/io_uring.h | 1 + test/Makefile | 2 + test/mkdir.c | 106 ++++++++++++++++++++++++++++++++ 5 files changed, 116 insertions(+) create mode 100644 test/mkdir.c
Signature · 1 line
2.29.2
PATCH 1/3 io_uring.h: add mkdirat opcode
Signed-off-by Dmitry Kadashev <[email protected]>
--- src/include/liburing/io_uring.h | 1 + 1 file changed, 1 insertion(+)
src/include/liburing/io_uring.h +1 -0
@@ -141,6 +141,7 @@ enum {IORING_OP_SHUTDOWN ,IORING_OP_RENAMEAT ,IORING_OP_UNLINKAT , +IORING_OP_MKDIRAT ,/* this goes last, obviously */ IORING_OP_LAST,
Signature · 1 line
2.29.2
PATCH 2/3 liburing.h: add mkdirat prep helpers
In reply to Dmitry KadashevSigned-off-by Dmitry Kadashev <[email protected]>
--- src/include/liburing.h | 6 ++++++ 1 file changed, 6 insertions(+)
src/include/liburing.h +6 -0
@@ -486,6 +486,12 @@ static inline void io_uring_prep_renameat(struct io_uring_sqe *sqe, int olddfd, sqe->rename_flags = flags; } +static inline void io_uring_prep_mkdirat (struct io_uring_sqe *sqe,int dfd, +const char *path,mode_t mode) +{ +io_uring_prep_rw (IORING_OP_MKDIRAT , sqe, dfd, path, mode,0 ); +} +/* * Returns number of unconsumed (if SQPOLL) or unsubmitted entries exist in * the SQ ring
Signature · 1 line
2.29.2
PATCH 3/3 Add mkdirat test case
In reply to Dmitry KadashevThe test is relative basic: tests only success, EEXISTS, ENOENT (no parent dir).
Signed-off-by Dmitry Kadashev <[email protected]>
--- .gitignore | 1 + test/Makefile | 2 + test/mkdir.c | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 test/mkdir.c
.gitignore +1 -0
@@ -68,6 +68,7 @@ /test/link-timeout /test/link_drain /test/madvise +/test/mkdir /test/nop /test/nop-all-sizes /test/open-close
test/Makefile +2 -0
@@ -66,6 +66,7 @@ test_targets += \ link-timeout \ link_drain \ madvise \ + mkdir \ nop \ nop-all-sizes \ open-close \
@@ -186,6 +187,7 @@ test_srcs := \ link.c \ link_drain.c \ madvise.c \ + mkdir.c \ nop-all-sizes.c \ nop.c \ open-close.c \
test/mkdir.c new file +105 -0
105 lines not on this page · raw message
Signature · 1 line
2.29.2