liburing: add fremovexattr and flistxattr support
PATCH 1/1 liburing: add fremovexattr and flistxattr support
This adds support for the new IORING_OP_FREMOVEXATTR and IORING_OP_FLISTXATTR opcodes:
- Add opcodes to src/include/liburing/io_uring.h
- Register sanitizers in src/sanitize.c (updating static assert)
- Implement inline prep functions in src/include/liburing.h:
- io_uring_prep_fremovexattr()
- io_uring_prep_flistxattr()
- Add full functional and negative failure tests in test/xattr.c
Signed-off-by Aditya Prakash Srivastava <[email protected]>
--- src/include/liburing.h | 17 ++++ src/include/liburing/io_uring.h | 2 + src/sanitize.c | 4 +- test/xattr.c | 173 ++++++++++++++++++++++++++++++++ 4 files changed, 195 insertions(+), 1 deletion(-)
src/include/liburing.h +17 -0
@@ -1513,6 +1513,23 @@ IOURINGINLINE void io_uring_prep_fsetxattr(struct io_uring_sqe *sqe, int fd, sqe->xattr_flags = flags; } +IOURINGINLINE void io_uring_prep_fremovexattr(struct io_uring_sqe *sqe, int fd, +const char *name) +LIBURING_NOEXCEPT +{ +io_uring_prep_rw (IORING_OP_FREMOVEXATTR , sqe, fd, name,0 ,0 ); + sqe->xattr_flags =0 ; +} + +IOURINGINLINE void io_uring_prep_flistxattr(struct io_uring_sqe *sqe, int fd, +char *list,unsigned int len) +LIBURING_NOEXCEPT +{ +io_uring_prep_rw (IORING_OP_FLISTXATTR , sqe, fd,NULL , len, + (__u64 ) (uintptr_t ) list); + sqe->xattr_flags =0 ; +} + IOURINGINLINE void io_uring_prep_socket(struct io_uring_sqe *sqe, int domain,int type,int protocol,unsigned int flags)
src/include/liburing/io_uring.h +2 -0
@@ -312,6 +312,8 @@ enum io_uring_op {IORING_OP_PIPE ,IORING_OP_NOP128 ,IORING_OP_URING_CMD128 , +IORING_OP_FREMOVEXATTR , +IORING_OP_FLISTXATTR ,/* this goes last, obviously */ IORING_OP_LAST,
src/sanitize.c +3 -1
@@ -121,8 +121,10 @@ static const sanitize_sqe_handler sanitize_handlers[IORING_OP_LAST] = { [IORING_OP_PIPE] = sanitize_sqe_addr, [IORING_OP_NOP128] = sanitize_sqe_nop, [IORING_OP_URING_CMD128] = sanitize_sqe_optval, + [IORING_OP_FREMOVEXATTR] = sanitize_sqe_addr, + [IORING_OP_FLISTXATTR ] = sanitize_sqe_addr2, }; -_Static_assert (IORING_OP_URING_CMD128 +1 ==IORING_OP_LAST , +_Static_assert (IORING_OP_FLISTXATTR +1 ==IORING_OP_LAST ,"Need an implementation for all IORING_OP_* codes" );void liburing_sanitize_ring (struct io_uring *ring)
test/xattr.c +173 -0
191 lines not on this page · raw message
Signature · 1 line
2.47.3