* [PATCH 1/2] liburing: Change the type of `flags` in `io_uring_prep_renameat()` to `unsigned int`
2022-08-23 11:52 [PATCH liburing 0/2] liburing uapi and manpage update Ammar Faizi
@ 2022-08-23 11:52 ` Ammar Faizi
2022-08-23 11:52 ` [PATCH 2/2] io_uring: uapi: Sync with the kernel Ammar Faizi
2022-08-23 13:23 ` [PATCH liburing 0/2] liburing uapi and manpage update Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Ammar Faizi @ 2022-08-23 11:52 UTC (permalink / raw)
To: Jens Axboe
Cc: Ammar Faizi, io-uring Mailing List, Linux Kernel Mailing List,
GNU/Weeb Mailing List, Bart Van Assche, Dylan Yudaken,
Facebook Kernel Team, Kanna Scarlet
From: Ammar Faizi <[email protected]>
Sync with the declaration of `renameat2()` from the man page.
Closes: https://github.com/axboe/liburing/pull/615
Link: https://man7.org/linux/man-pages/man2/rename.2.html
Signed-off-by: Ammar Faizi <[email protected]>
---
man/io_uring_prep_renameat.3 | 4 ++--
src/include/liburing.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/man/io_uring_prep_renameat.3 b/man/io_uring_prep_renameat.3
index 1fc9e01..08d4a46 100644
--- a/man/io_uring_prep_renameat.3
+++ b/man/io_uring_prep_renameat.3
@@ -16,12 +16,12 @@ io_uring_prep_renameat \- prepare a renameat request
.BI " const char *" oldpath ","
.BI " int " newdirfd ","
.BI " const char *" newpath ","
-.BI " int " flags ");"
+.BI " unsigned int " flags ");"
.PP
.BI "void io_uring_prep_rename(struct io_uring_sqe *" sqe ","
.BI " const char *" oldpath ","
.BI " const char *" newpath ","
-.BI " int " flags ");"
+.BI " unsigned int " flags ");"
.fi
.SH DESCRIPTION
.PP
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 06f4a50..df748aa 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -862,7 +862,7 @@ static inline void io_uring_prep_unlink(struct io_uring_sqe *sqe,
static inline void io_uring_prep_renameat(struct io_uring_sqe *sqe, int olddfd,
const char *oldpath, int newdfd,
- const char *newpath, int flags)
+ const char *newpath, unsigned int flags)
{
io_uring_prep_rw(IORING_OP_RENAMEAT, sqe, olddfd, oldpath,
(__u32) newdfd,
--
Ammar Faizi
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] io_uring: uapi: Sync with the kernel
2022-08-23 11:52 [PATCH liburing 0/2] liburing uapi and manpage update Ammar Faizi
2022-08-23 11:52 ` [PATCH 1/2] liburing: Change the type of `flags` in `io_uring_prep_renameat()` to `unsigned int` Ammar Faizi
@ 2022-08-23 11:52 ` Ammar Faizi
2022-08-23 13:23 ` [PATCH liburing 0/2] liburing uapi and manpage update Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Ammar Faizi @ 2022-08-23 11:52 UTC (permalink / raw)
To: Jens Axboe
Cc: Ammar Faizi, io-uring Mailing List, Linux Kernel Mailing List,
GNU/Weeb Mailing List, Bart Van Assche, Dylan Yudaken,
Facebook Kernel Team, Kanna Scarlet
From: Ammar Faizi <[email protected]>
This is a full copy from the kernel tree without any modifition. Now
this header is fully in sync with the kernel. Next time when changing
this header from the kernel side, just copy the file directly to
liburing, no need manual modification.
Link: https://lore.kernel.org/io-uring/[email protected]
Cc: Bart Van Assche <[email protected]>
Cc: Dylan Yudaken <[email protected]>
Cc: Facebook Kernel Team <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
src/include/liburing/io_uring.h | 66 ++++++++++++++++++++++++---------
1 file changed, 48 insertions(+), 18 deletions(-)
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index c923f5c..9e0b5c8 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -10,6 +10,7 @@
#include <linux/fs.h>
#include <linux/types.h>
+#include <linux/time_types.h>
#ifdef __cplusplus
extern "C" {
@@ -54,6 +55,7 @@ struct io_uring_sqe {
__u32 unlink_flags;
__u32 hardlink_flags;
__u32 xattr_flags;
+ __u32 msg_ring_flags;
};
__u64 user_data; /* data to be passed back at completion time */
/* pack this to avoid bogus arm OABI complaints */
@@ -148,7 +150,6 @@ enum {
* IORING_SQ_TASKRUN in the sq ring flags. Not valid with COOP_TASKRUN.
*/
#define IORING_SETUP_TASKRUN_FLAG (1U << 9)
-
#define IORING_SETUP_SQE128 (1U << 10) /* SQEs are 128 byte */
#define IORING_SETUP_CQE32 (1U << 11) /* CQEs are 32 byte */
/*
@@ -244,10 +245,13 @@ enum io_uring_op {
*
* IORING_POLL_UPDATE Update existing poll request, matching
* sqe->addr as the old user_data field.
+ *
+ * IORING_POLL_LEVEL Level triggered poll.
*/
#define IORING_POLL_ADD_MULTI (1U << 0)
#define IORING_POLL_UPDATE_EVENTS (1U << 1)
#define IORING_POLL_UPDATE_USER_DATA (1U << 2)
+#define IORING_POLL_ADD_LEVEL (1U << 3)
/*
* ASYNC_CANCEL flags.
@@ -256,10 +260,12 @@ enum io_uring_op {
* IORING_ASYNC_CANCEL_FD Key off 'fd' for cancelation rather than the
* request 'user_data'
* IORING_ASYNC_CANCEL_ANY Match any request
+ * IORING_ASYNC_CANCEL_FD_FIXED 'fd' passed in is a fixed descriptor
*/
#define IORING_ASYNC_CANCEL_ALL (1U << 0)
#define IORING_ASYNC_CANCEL_FD (1U << 1)
-#define IORING_ASYNC_CANCEL_ANY (1U << 2)
+#define IORING_ASYNC_CANCEL_ANY (1U << 2)
+#define IORING_ASYNC_CANCEL_FD_FIXED (1U << 3)
/*
* send/sendmsg and recv/recvmsg flags (sqe->ioprio)
@@ -272,6 +278,12 @@ enum io_uring_op {
* IORING_RECV_MULTISHOT Multishot recv. Sets IORING_CQE_F_MORE if
* the handler will continue to report
* CQEs on behalf of the same SQE.
+ *
+ * IORING_RECVSEND_FIXED_BUF Use registered buffers, the index is stored in
+ * the buf_index field.
+ *
+ * IORING_RECVSEND_NOTIF_FLUSH Flush a notification after a successful
+ * successful. Only for zerocopy sends.
*/
#define IORING_RECVSEND_POLL_FIRST (1U << 0)
#define IORING_RECV_MULTISHOT (1U << 1)
@@ -283,6 +295,7 @@ enum io_uring_op {
*/
#define IORING_ACCEPT_MULTISHOT (1U << 0)
+
/*
* IORING_OP_RSRC_UPDATE flags
*/
@@ -291,6 +304,22 @@ enum {
IORING_RSRC_UPDATE_NOTIF,
};
+/*
+ * IORING_OP_MSG_RING command types, stored in sqe->addr
+ */
+enum {
+ IORING_MSG_DATA, /* pass sqe->len as 'res' and off as user_data */
+ IORING_MSG_SEND_FD, /* send a registered fd to another ring */
+};
+
+/*
+ * IORING_OP_MSG_RING flags (sqe->msg_ring_flags)
+ *
+ * IORING_MSG_RING_CQE_SKIP Don't post a CQE to the target ring. Not
+ * applicable for IORING_MSG_DATA, obviously.
+ */
+#define IORING_MSG_RING_CQE_SKIP (1U << 0)
+
/*
* IO completion data structure (Completion Queue Entry)
*/
@@ -456,6 +485,7 @@ enum {
/* register a range of fixed file slots for automatic slot allocation */
IORING_REGISTER_FILE_ALLOC_RANGE = 25,
+ /* zerocopy notification API */
IORING_REGISTER_NOTIFIERS = 26,
IORING_UNREGISTER_NOTIFIERS = 27,
@@ -535,7 +565,7 @@ struct io_uring_probe {
__u8 ops_len; /* length of ops[] array below */
__u16 resv;
__u32 resv2[3];
- struct io_uring_probe_op ops[0];
+ struct io_uring_probe_op ops[];
};
struct io_uring_restriction {
@@ -581,15 +611,6 @@ struct io_uring_buf_reg {
__u64 resv[3];
};
-/* argument for IORING_REGISTER_SYNC_CANCEL */
-struct io_uring_sync_cancel_reg {
- __u64 addr;
- __s32 fd;
- __u32 flags;
- struct __kernel_timespec timeout;
- __u64 pad[4];
-};
-
/*
* io_uring_restriction->opcode values
*/
@@ -616,8 +637,22 @@ struct io_uring_getevents_arg {
__u64 ts;
};
+/*
+ * Argument for IORING_REGISTER_SYNC_CANCEL
+ */
+struct io_uring_sync_cancel_reg {
+ __u64 addr;
+ __s32 fd;
+ __u32 flags;
+ struct __kernel_timespec timeout;
+ __u64 pad[4];
+};
+
+/*
+ * Argument for IORING_REGISTER_FILE_ALLOC_RANGE
+ * The range is specified as [off, off + len)
+ */
struct io_uring_file_index_range {
- /* [off, off + len) */
__u32 off;
__u32 len;
__u64 resv;
@@ -630,11 +665,6 @@ struct io_uring_recvmsg_out {
__u32 flags;
};
-/*
- * accept flags stored in sqe->ioprio
- */
-#define IORING_ACCEPT_MULTISHOT (1U << 0)
-
#ifdef __cplusplus
}
#endif
--
Ammar Faizi
^ permalink raw reply related [flat|nested] 4+ messages in thread