From: Jens Axboe <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>
Subject: [PATCH 3/6] io_uring/slist: add list-to-list list splice helper
Date: Fri, 22 Nov 2024 09:12:41 -0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Add a helper to splice a source list to a destination list.
Signed-off-by: Jens Axboe <[email protected]>
---
io_uring/slist.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/io_uring/slist.h b/io_uring/slist.h
index 0eb194817242..7ac7c136b702 100644
--- a/io_uring/slist.h
+++ b/io_uring/slist.h
@@ -85,6 +85,22 @@ static inline bool wq_list_splice(struct io_wq_work_list *list,
return false;
}
+static inline bool wq_list_splice_list(struct io_wq_work_list *src,
+ struct io_wq_work_list *dst)
+{
+ bool ret = false;
+
+ if (wq_list_empty(dst)) {
+ *dst = *src;
+ } else {
+ dst->last->next = src->first;
+ dst->last = src->last;
+ ret = true;
+ }
+ INIT_WQ_LIST(src);
+ return false;
+}
+
static inline void wq_stack_add_head(struct io_wq_work_node *node,
struct io_wq_work_node *stack)
{
--
2.45.2
next prev parent reply other threads:[~2024-11-22 16:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 16:12 [PATCHSET for-next 0/6] task work cleanups Jens Axboe
2024-11-22 16:12 ` [PATCH 1/6] io_uring: make task_work pending check dependent on ring type Jens Axboe
2024-11-22 16:12 ` [PATCH 2/6] io_uring: replace defer task_work llist with io_wq_work_list Jens Axboe
2024-11-22 17:07 ` Pavel Begunkov
2024-11-22 17:11 ` Jens Axboe
2024-11-22 17:25 ` Pavel Begunkov
2024-11-22 17:44 ` Jens Axboe
2024-11-23 0:36 ` Pavel Begunkov
2024-11-22 16:12 ` Jens Axboe [this message]
2024-11-22 16:12 ` [PATCH 4/6] io_uring: switch non-defer task_work to io_wq_work_list Jens Axboe
2024-11-22 16:12 ` [PATCH 5/6] io_uring: add __tctx_task_work_run() helper Jens Axboe
2024-11-22 16:12 ` [PATCH 6/6] io_uring: make __tctx_task_work_run() take an io_wq_work_list 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 \
[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