Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189672
b: refs/heads/master
c: ce82653
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Apr 9, 2010
1 parent 1a3df50 commit 4717270
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3e06e2b15590b70ea73733fc4612e4741ff46e0
refs/heads/master: ce82653d6cfcc95ba88c25908664878459fb1b8d
7 changes: 7 additions & 0 deletions trunk/include/linux/radix-tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ do { \
* (Note, rcu_assign_pointer and rcu_dereference are not needed to control
* access to data items when inserting into or looking up from the radix tree)
*
* Note that the value returned by radix_tree_tag_get() may not be relied upon
* if only the RCU read lock is held. Functions to set/clear tags and to
* delete nodes running concurrently with it may affect its result such that
* two consecutive reads in the same locked section may return different
* values. If reliability is required, modification functions must also be
* excluded from concurrency.
*
* radix_tree_tagged is able to be called without locking or RCU.
*/

Expand Down
12 changes: 6 additions & 6 deletions trunk/lib/radix-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,10 @@ EXPORT_SYMBOL(radix_tree_tag_clear);
*
* 0: tag not present or not set
* 1: tag set
*
* Note that the return value of this function may not be relied on, even if
* the RCU lock is held, unless tag modification and node deletion are excluded
* from concurrency.
*/
int radix_tree_tag_get(struct radix_tree_root *root,
unsigned long index, unsigned int tag)
Expand Down Expand Up @@ -595,12 +599,8 @@ int radix_tree_tag_get(struct radix_tree_root *root,
*/
if (!tag_get(node, tag, offset))
saw_unset_tag = 1;
if (height == 1) {
int ret = tag_get(node, tag, offset);

BUG_ON(ret && saw_unset_tag);
return !!ret;
}
if (height == 1)
return !!tag_get(node, tag, offset);
node = rcu_dereference_raw(node->slots[offset]);
shift -= RADIX_TREE_MAP_SHIFT;
height--;
Expand Down

0 comments on commit 4717270

Please sign in to comment.