summaryrefslogtreecommitdiff
path: root/include/linux/rculist.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2026-06-22 23:10:08 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2026-06-22 23:10:08 -0700
commit7a0e692a0381254b2f77c54dec100cd3325a6fdf (patch)
tree2d2ce96c3471a02166323e88cd7ccab1d43b1cd4 /include/linux/rculist.h
parentfb402386af4cdce108ff991a796386de55439735 (diff)
parenta6ac4e24c1a8a533bb61035184fdcc7eede4cc8d (diff)
Merge branch 'next' into for-linus
Prepare input updates for 7.2 merge window.
Diffstat (limited to 'include/linux/rculist.h')
-rw-r--r--include/linux/rculist.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 2abba7552605..e3bc44225692 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -261,6 +261,35 @@ static inline void list_replace_rcu(struct list_head *old,
old->prev = LIST_POISON2;
}
+static inline void __list_splice_rcu(struct list_head *list,
+ struct list_head *prev,
+ struct list_head *next)
+{
+ struct list_head *first = list->next;
+ struct list_head *last = list->prev;
+
+ last->next = next;
+ first->prev = prev;
+ next->prev = last;
+ rcu_assign_pointer(list_next_rcu(prev), first);
+}
+
+/**
+ * list_splice_rcu - splice a non-RCU list into an RCU-protected list,
+ * designed for stacks.
+ * @list: the non RCU-protected list to splice
+ * @head: the place in the existing RCU-protected list to splice
+ *
+ * The list pointed to by @head can be RCU-read traversed concurrently with
+ * this function.
+ */
+static inline void list_splice_rcu(struct list_head *list,
+ struct list_head *head)
+{
+ if (!list_empty(list))
+ __list_splice_rcu(list, head, head->next);
+}
+
/**
* __list_splice_init_rcu - join an RCU-protected list into an existing list.
* @list: the RCU-protected list to splice