From: Marcelo Tosatti Simple patch to radix_tree_tag_get() to return different values for non present node and tag unset. The function is not used by any in-kernel callers (yet), but this information is definitely useful. Signed-off-by: Andrew Morton --- lib/radix-tree.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff -puN lib/radix-tree.c~radix_tag_get-differentiate-between-no-present-node-and-tag-unset-cases lib/radix-tree.c --- devel/lib/radix-tree.c~radix_tag_get-differentiate-between-no-present-node-and-tag-unset-cases 2005-07-27 12:18:39.000000000 -0700 +++ devel-akpm/lib/radix-tree.c 2005-07-27 12:20:14.000000000 -0700 @@ -422,8 +422,8 @@ EXPORT_SYMBOL(radix_tree_tag_clear); * * Return the search tag corresponging to @index in the radix tree. * - * Returns zero if the tag is unset, or if there is no corresponding item - * in the tree. + * Returns -1 if the tag is unset, or zero if there is no corresponding + * item in the tree. */ int radix_tree_tag_get(struct radix_tree_root *root, unsigned long index, int tag) @@ -457,7 +457,7 @@ int radix_tree_tag_get(struct radix_tree int ret = tag_get(*slot, tag, offset); BUG_ON(ret && saw_unset_tag); - return ret; + return ret ? 1 : -1; } slot = (struct radix_tree_node **)((*slot)->slots + offset); shift -= RADIX_TREE_MAP_SHIFT; _