Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106927
b: refs/heads/master
c: 6beeac7
h: refs/heads/master
i:
  106925: 7a8a4f5
  106923: d90ad19
  106919: 9b8f456
  106911: d9d666b
v: v3
  • Loading branch information
Andrea Arcangeli authored and Linus Torvalds committed Jul 28, 2008
1 parent 7ae857b commit aee26dd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 93686ae8357c1b1e37e8dfc96547f807e7a93b4b
refs/heads/master: 6beeac76f5f96590fb751af5e138fbc3f62e8460
28 changes: 28 additions & 0 deletions trunk/include/linux/rculist.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,34 @@ static inline void list_del_rcu(struct list_head *entry)
entry->prev = LIST_POISON2;
}

/**
* hlist_del_init_rcu - deletes entry from hash list with re-initialization
* @n: the element to delete from the hash list.
*
* Note: list_unhashed() on the node return true after this. It is
* useful for RCU based read lockfree traversal if the writer side
* must know if the list entry is still hashed or already unhashed.
*
* In particular, it means that we can not poison the forward pointers
* that may still be used for walking the hash list and we can only
* zero the pprev pointer so list_unhashed() will return true after
* this.
*
* The caller must take whatever precautions are necessary (such as
* holding appropriate locks) to avoid racing with another
* list-mutation primitive, such as hlist_add_head_rcu() or
* hlist_del_rcu(), running on this same list. However, it is
* perfectly legal to run concurrently with the _rcu list-traversal
* primitives, such as hlist_for_each_entry_rcu().
*/
static inline void hlist_del_init_rcu(struct hlist_node *n)
{
if (!hlist_unhashed(n)) {
__hlist_del(n);
n->pprev = NULL;
}
}

/**
* list_replace_rcu - replace old entry by new one
* @old : the element to be replaced
Expand Down

0 comments on commit aee26dd

Please sign in to comment.