diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2024-10-18 18:07:31 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-10-29 20:43:27 +0100 |
commit | 1e6e7602cc9fdeaf7e2593755409e8d50545ed69 (patch) | |
tree | e75318ca17f85ce0c24a51320812a2a3d7cd9591 /io_uring/io_uring.c | |
parent | io_uring: move cancel hash tables to kvmalloc/kvfree (diff) | |
download | linux-1e6e7602cc9fdeaf7e2593755409e8d50545ed69.tar.xz linux-1e6e7602cc9fdeaf7e2593755409e8d50545ed69.zip |
io_uring: kill io_llist_xchg
io_llist_xchg is only used to set the list to NULL, which can also be
done with llist_del_all(). Use the latter and kill io_llist_xchg.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d6765112680d2e86a58b76166b7513391ff4e5d7.1729264960.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.c')
-rw-r--r-- | io_uring/io_uring.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index d7ad4ea5f40b..c0358a8d85d2 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1081,20 +1081,6 @@ struct llist_node *io_handle_tw_list(struct llist_node *node, return node; } -/** - * io_llist_xchg - swap all entries in a lock-less list - * @head: the head of lock-less list to delete all entries - * @new: new entry as the head of the list - * - * If list is empty, return NULL, otherwise, return the pointer to the first entry. - * The order of entries returned is from the newest to the oldest added one. - */ -static inline struct llist_node *io_llist_xchg(struct llist_head *head, - struct llist_node *new) -{ - return xchg(&head->first, new); -} - static __cold void io_fallback_tw(struct io_uring_task *tctx, bool sync) { struct llist_node *node = llist_del_all(&tctx->task_list); @@ -1316,7 +1302,7 @@ again: * llists are in reverse order, flip it back the right way before * running the pending items. */ - node = llist_reverse_order(io_llist_xchg(&ctx->work_llist, NULL)); + node = llist_reverse_order(llist_del_all(&ctx->work_llist)); while (node) { struct llist_node *next = node->next; struct io_kiocb *req = container_of(node, struct io_kiocb, |