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: refactor io_tx_ubuf_complete()

Flip the dec_and_test "if", that makes the function extension easier in
the future.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/43939e2b04dff03bff5d7227c98afedf951227b3.1713185320.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
7e58d0af 686b56cb

+5 -4
+5 -4
io_uring/notif.c
··· 37 37 WRITE_ONCE(nd->zc_copied, true); 38 38 } 39 39 40 - if (refcount_dec_and_test(&uarg->refcnt)) { 41 - notif->io_task_work.func = io_notif_tw_complete; 42 - __io_req_task_work_add(notif, IOU_F_TWQ_LAZY_WAKE); 43 - } 40 + if (!refcount_dec_and_test(&uarg->refcnt)) 41 + return; 42 + 43 + notif->io_task_work.func = io_notif_tw_complete; 44 + __io_req_task_work_add(notif, IOU_F_TWQ_LAZY_WAKE); 44 45 } 45 46 46 47 struct io_kiocb *io_alloc_notif(struct io_ring_ctx *ctx)