summaryrefslogtreecommitdiff
path: root/include/linux/llist.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2023-09-11 10:39:37 -0400
committerChuck Lever <chuck.lever@oracle.com>2023-10-16 12:44:06 -0400
commit8a3e5975ed11dd16d81dc501b514ab01986db94e (patch)
tree1e14c66306c4e7463ab715a5e1ceed5768cdd438 /include/linux/llist.h
parent9bd4161c591710f152a8cd3ed85ea928c61e26ca (diff)
llist: add llist_del_first_this()
llist_del_first_this() deletes a specific entry from an llist, providing it is at the head of the list. Multiple threads can call this concurrently providing they each offer a different entry. This can be uses for a set of worker threads which are on the llist when they are idle. The head can always be woken, and when it is woken it can remove itself, and possibly wake the next if there is an excess of work to do. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'include/linux/llist.h')
-rw-r--r--include/linux/llist.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/llist.h b/include/linux/llist.h
index dcb91e3bac1c..2c982ff7475a 100644
--- a/include/linux/llist.h
+++ b/include/linux/llist.h
@@ -291,6 +291,10 @@ static inline struct llist_node *llist_del_first_init(struct llist_head *head)
init_llist_node(n);
return n;
}
+
+extern bool llist_del_first_this(struct llist_head *head,
+ struct llist_node *this);
+
struct llist_node *llist_reverse_order(struct llist_node *head);
#endif /* LLIST_H */