From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [for-next 1/3] io_uring/notif: refactor io_tx_ubuf_complete()
Date: Mon, 15 Apr 2024 13:50:11 +0100 [thread overview]
Message-ID: <43939e2b04dff03bff5d7227c98afedf951227b3.1713185320.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
Flip the dec_and_test "if", that makes the function extension easier in
the future.
Signed-off-by: Pavel Begunkov <[email protected]>
---
io_uring/notif.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/io_uring/notif.c b/io_uring/notif.c
index b561bd763435..452c255de04a 100644
--- a/io_uring/notif.c
+++ b/io_uring/notif.c
@@ -37,10 +37,11 @@ static void io_tx_ubuf_callback(struct sk_buff *skb, struct ubuf_info *uarg,
WRITE_ONCE(nd->zc_copied, true);
}
- if (refcount_dec_and_test(&uarg->refcnt)) {
- notif->io_task_work.func = io_notif_tw_complete;
- __io_req_task_work_add(notif, IOU_F_TWQ_LAZY_WAKE);
- }
+ if (!refcount_dec_and_test(&uarg->refcnt))
+ return;
+
+ notif->io_task_work.func = io_notif_tw_complete;
+ __io_req_task_work_add(notif, IOU_F_TWQ_LAZY_WAKE);
}
struct io_kiocb *io_alloc_notif(struct io_ring_ctx *ctx)
--
2.44.0
next prev parent reply other threads:[~2024-04-15 12:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 12:50 [for-next 0/3] simple sendzc cleanups Pavel Begunkov
2024-04-15 12:50 ` Pavel Begunkov [this message]
2024-04-15 12:50 ` [for-next 2/3] io_uring/notif: remove ctx var from io_notif_tw_complete Pavel Begunkov
2024-04-15 12:50 ` [for-next 3/3] io_uring/notif: shrink account_pages to u32 Pavel Begunkov
2024-04-15 14:11 ` [for-next 0/3] simple sendzc cleanups Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43939e2b04dff03bff5d7227c98afedf951227b3.1713185320.git.asml.silence@gmail.com \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox