@@ -634,6 +634,21 @@ static inline void hlist_add_after(struct hlist_node *n,
634634 next -> next -> pprev = & next -> next ;
635635}
636636
637+ /**
638+ * hlist_add_before_rcu - adds the specified element to the specified hlist
639+ * before the specified node while permitting racing traversals.
640+ * @n: the new element to add to the hash list.
641+ * @next: the existing element to add the new element before.
642+ *
643+ * The caller must take whatever precautions are necessary
644+ * (such as holding appropriate locks) to avoid racing
645+ * with another list-mutation primitive, such as hlist_add_head_rcu()
646+ * or hlist_del_rcu(), running on this same list.
647+ * However, it is perfectly legal to run concurrently with
648+ * the _rcu list-traversal primitives, such as
649+ * hlist_for_each_rcu(), used to prevent memory-consistency
650+ * problems on Alpha CPUs.
651+ */
637652static inline void hlist_add_before_rcu (struct hlist_node * n ,
638653 struct hlist_node * next )
639654{
@@ -644,6 +659,21 @@ static inline void hlist_add_before_rcu(struct hlist_node *n,
644659 * (n -> pprev ) = n ;
645660}
646661
662+ /**
663+ * hlist_add_after_rcu - adds the specified element to the specified hlist
664+ * after the specified node while permitting racing traversals.
665+ * @prev: the existing element to add the new element after.
666+ * @n: the new element to add to the hash list.
667+ *
668+ * The caller must take whatever precautions are necessary
669+ * (such as holding appropriate locks) to avoid racing
670+ * with another list-mutation primitive, such as hlist_add_head_rcu()
671+ * or hlist_del_rcu(), running on this same list.
672+ * However, it is perfectly legal to run concurrently with
673+ * the _rcu list-traversal primitives, such as
674+ * hlist_for_each_rcu(), used to prevent memory-consistency
675+ * problems on Alpha CPUs.
676+ */
647677static inline void hlist_add_after_rcu (struct hlist_node * prev ,
648678 struct hlist_node * n )
649679{
0 commit comments