aboutsummaryrefslogtreecommitdiffstats
path: root/fs/io-wq.h
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-08-09 13:04:07 +0100
committerJens Axboe <axboe@kernel.dk>2021-08-23 13:07:56 -0600
commit8724dd8c833832c398c3578340374f45d6d9dd0d (patch)
tree63b552b11d5811e47615329dad0075978f827df5 /fs/io-wq.h
parentio_uring: remove unnecessary PF_EXITING check (diff)
downloadlinux-dev-8724dd8c833832c398c3578340374f45d6d9dd0d.tar.xz
linux-dev-8724dd8c833832c398c3578340374f45d6d9dd0d.zip
io-wq: improve wq_list_add_tail()
Prepare nodes that we're going to add before actually linking them, it's always safer and costs us nothing. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/f7e53f0c84c02ed6748c488ed0789b98f8cc6185.1628471125.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io-wq.h')
-rw-r--r--fs/io-wq.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io-wq.h b/fs/io-wq.h
index 3999ee58ff26..308af3928424 100644
--- a/fs/io-wq.h
+++ b/fs/io-wq.h
@@ -44,6 +44,7 @@ static inline void wq_list_add_after(struct io_wq_work_node *node,
static inline void wq_list_add_tail(struct io_wq_work_node *node,
struct io_wq_work_list *list)
{
+ node->next = NULL;
if (!list->first) {
list->last = node;
WRITE_ONCE(list->first, node);
@@ -51,7 +52,6 @@ static inline void wq_list_add_tail(struct io_wq_work_node *node,
list->last->next = node;
list->last = node;
}
- node->next = NULL;
}
static inline void wq_list_cut(struct io_wq_work_list *list,