Skip to content

Commit 227685e

Browse files
Hao Xuaxboe
authored andcommitted
io_uring: add REQ_F_APOLL_MULTISHOT for requests
Add a flag to indicate multishot mode for fast poll. currently only accept use it, but there may be more operations leveraging it in the future. Also add a mask IO_APOLL_MULTI_POLLED which stands for REQ_F_APOLL_MULTI | REQ_F_POLLED, to make the code short and cleaner. Signed-off-by: Hao Xu <howeyxu@tencent.com> Link: https://lore.kernel.org/r/20220514142046.58072-3-haoxu.linux@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 390ed29 commit 227685e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/io_uring.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@
116116
#define IO_REQ_CLEAN_SLOW_FLAGS (REQ_F_REFCOUNT | REQ_F_LINK | REQ_F_HARDLINK |\
117117
IO_REQ_CLEAN_FLAGS)
118118

119+
#define IO_APOLL_MULTI_POLLED (REQ_F_APOLL_MULTISHOT | REQ_F_POLLED)
120+
119121
#define IO_TCTX_REFS_CACHE_NR (1U << 10)
120122

121123
struct io_uring {
@@ -812,6 +814,7 @@ enum {
812814
REQ_F_SINGLE_POLL_BIT,
813815
REQ_F_DOUBLE_POLL_BIT,
814816
REQ_F_PARTIAL_IO_BIT,
817+
REQ_F_APOLL_MULTISHOT_BIT,
815818
/* keep async read/write and isreg together and in order */
816819
REQ_F_SUPPORT_NOWAIT_BIT,
817820
REQ_F_ISREG_BIT,
@@ -876,6 +879,8 @@ enum {
876879
REQ_F_DOUBLE_POLL = BIT(REQ_F_DOUBLE_POLL_BIT),
877880
/* request has already done partial IO */
878881
REQ_F_PARTIAL_IO = BIT(REQ_F_PARTIAL_IO_BIT),
882+
/* fast poll multishot mode */
883+
REQ_F_APOLL_MULTISHOT = BIT(REQ_F_APOLL_MULTISHOT_BIT),
879884
};
880885

881886
struct async_poll {

0 commit comments

Comments
 (0)