aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/radix-tree.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 2e9bd54beba4..b972dd29289d 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -418,15 +418,16 @@ EXPORT_SYMBOL(radix_tree_tag_clear);
418 418
419#ifndef __KERNEL__ /* Only the test harness uses this at present */ 419#ifndef __KERNEL__ /* Only the test harness uses this at present */
420/** 420/**
421 * radix_tree_tag_get - get a tag on a radix tree node 421 * radix_tree_tag_get - get a tag on a radix tree node
422 * @root: radix tree root 422 * @root: radix tree root
423 * @index: index key 423 * @index: index key
424 * @tag: tag index 424 * @tag: tag index
425 * 425 *
426 * Return the search tag corresponging to @index in the radix tree. 426 * Return values:
427 * 427 *
428 * Returns zero if the tag is unset, or if there is no corresponding item 428 * 0: tag not present
429 * in the tree. 429 * 1: tag present, set
430 * -1: tag present, unset
430 */ 431 */
431int radix_tree_tag_get(struct radix_tree_root *root, 432int radix_tree_tag_get(struct radix_tree_root *root,
432 unsigned long index, int tag) 433 unsigned long index, int tag)
@@ -460,7 +461,7 @@ int radix_tree_tag_get(struct radix_tree_root *root,
460 int ret = tag_get(slot, tag, offset); 461 int ret = tag_get(slot, tag, offset);
461 462
462 BUG_ON(ret && saw_unset_tag); 463 BUG_ON(ret && saw_unset_tag);
463 return ret; 464 return ret ? 1 : -1;
464 } 465 }
465 slot = slot->slots[offset]; 466 slot = slot->slots[offset];
466 shift -= RADIX_TREE_MAP_SHIFT; 467 shift -= RADIX_TREE_MAP_SHIFT;