Skip to content

Commit cf4ef01

Browse files
Paul E. McKenneyDavid S. Miller
authored andcommitted
[LIST]: Add docbook header comments for hlist_add_{before,after}_rcu()
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 57bf145 commit cf4ef01

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

include/linux/list.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
*/
637652
static 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+
*/
647677
static inline void hlist_add_after_rcu(struct hlist_node *prev,
648678
struct hlist_node *n)
649679
{

0 commit comments

Comments
 (0)