Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/notif: simplify io_notif_flush()

io_notif_flush() is partially duplicating io_tx_ubuf_complete(), so
instead of duplicating it, make the flush call io_tx_ubuf_complete.

Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/19e41652c16718b946a5c80d2ad409df7682e47e.1713369317.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
5a569469 3830fff3

+6 -9
+3 -3
io_uring/notif.c
··· 9 9 #include "notif.h" 10 10 #include "rsrc.h" 11 11 12 - void io_notif_tw_complete(struct io_kiocb *notif, struct io_tw_state *ts) 12 + static void io_notif_tw_complete(struct io_kiocb *notif, struct io_tw_state *ts) 13 13 { 14 14 struct io_notif_data *nd = io_notif_to_data(notif); 15 15 ··· 23 23 io_req_task_complete(notif, ts); 24 24 } 25 25 26 - static void io_tx_ubuf_complete(struct sk_buff *skb, struct ubuf_info *uarg, 27 - bool success) 26 + void io_tx_ubuf_complete(struct sk_buff *skb, struct ubuf_info *uarg, 27 + bool success) 28 28 { 29 29 struct io_notif_data *nd = container_of(uarg, struct io_notif_data, uarg); 30 30 struct io_kiocb *notif = cmd_to_io_kiocb(nd);
+3 -6
io_uring/notif.h
··· 21 21 }; 22 22 23 23 struct io_kiocb *io_alloc_notif(struct io_ring_ctx *ctx); 24 - void io_notif_tw_complete(struct io_kiocb *notif, struct io_tw_state *ts); 24 + void io_tx_ubuf_complete(struct sk_buff *skb, struct ubuf_info *uarg, 25 + bool success); 25 26 26 27 static inline struct io_notif_data *io_notif_to_data(struct io_kiocb *notif) 27 28 { ··· 34 33 { 35 34 struct io_notif_data *nd = io_notif_to_data(notif); 36 35 37 - /* drop slot's master ref */ 38 - if (refcount_dec_and_test(&nd->uarg.refcnt)) { 39 - notif->io_task_work.func = io_notif_tw_complete; 40 - __io_req_task_work_add(notif, IOU_F_TWQ_LAZY_WAKE); 41 - } 36 + io_tx_ubuf_complete(NULL, &nd->uarg, true); 42 37 } 43 38 44 39 static inline int io_notif_account_mem(struct io_kiocb *notif, unsigned len)