projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2215bed
)
io-wq: improve wq_list_add_tail()
author
Pavel Begunkov
<asml.silence@gmail.com>
Mon, 9 Aug 2021 12:04:07 +0000
(13:04 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 23 Aug 2021 19:07:56 +0000
(13:07 -0600)
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>
fs/io-wq.h
patch
|
blob
|
history
diff --git
a/fs/io-wq.h
b/fs/io-wq.h
index 3999ee58ff26dd968f8a9a00fb98a6a5a59a69a2..308af392842441ea7a064c62765b028fcbf37dcc 100644
(file)
--- 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,