From: Linus Torvalds Date: Mon, 23 May 2022 19:30:30 +0000 (-0700) Subject: Merge tag 'for-5.19/io_uring-xattr-2022-05-22' of git://git.kernel.dk/linux-block X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=09beaff75e4c4cee590b0e547c7587ff6cadb5db;p=linux.git Merge tag 'for-5.19/io_uring-xattr-2022-05-22' of git://git.kernel.dk/linux-block Pull io_uring xattr support from Jens Axboe: "Support for the xattr variants" * tag 'for-5.19/io_uring-xattr-2022-05-22' of git://git.kernel.dk/linux-block: io_uring: cleanup error-handling around io_req_complete io_uring: fix trace for reduced sqe padding io_uring: add fgetxattr and getxattr support io_uring: add fsetxattr and setxattr support fs: split off do_getxattr from getxattr fs: split off setxattr_copy and do_setxattr function from setxattr --- 09beaff75e4c4cee590b0e547c7587ff6cadb5db diff --cc fs/io_uring.c index 0c6a142761866,fdd497f92a6ec..e4c9f776919b5 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@@ -1279,8 -1218,15 +1287,16 @@@ static const struct io_op_def io_op_def [IORING_OP_LINKAT] = {}, [IORING_OP_MSG_RING] = { .needs_file = 1, + .iopoll = 1, }, + [IORING_OP_FSETXATTR] = { + .needs_file = 1 + }, + [IORING_OP_SETXATTR] = {}, + [IORING_OP_FGETXATTR] = { + .needs_file = 1 + }, + [IORING_OP_GETXATTR] = {}, }; /* requests with any of those set should undergo io_disarm_next() */ diff --cc include/uapi/linux/io_uring.h index ddf969ae5a79a,8ca1d9ae56d69..199bbf73a7527 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@@ -60,18 -61,10 +61,19 @@@ struct io_uring_sqe __s32 splice_fd_in; __u32 file_index; }; - __u64 __pad2[2]; + __u64 addr3; + __u64 __pad2[1]; }; +/* + * If sqe->file_index is set to this for opcodes that instantiate a new + * direct descriptor (like openat/openat2/accept), then io_uring will allocate + * an available direct descriptor instead of having the application pass one + * in. The picked direct descriptor will be returned in cqe->res, or -ENFILE + * if the space is full. + */ +#define IORING_FILE_INDEX_ALLOC (~0U) + enum { IOSQE_FIXED_FILE_BIT, IOSQE_IO_DRAIN_BIT,