lib: do code optimization for radix_tree_lookup() and radix_tree_lookup_slot()
authorHuang Shijie <shijie8@gmail.com>
Tue, 16 Jun 2009 22:33:42 +0000 (15:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 17 Jun 2009 02:47:49 +0000 (19:47 -0700)
commitb72b71c6cb6ecc564d4d5f9c512a7df269837846
tree9923a6e1d59f92825df87cfd2bbd613d0f47a5f7
parent30639b6af85a92491b22dd14c17b14ca11da60e6
lib: do code optimization for radix_tree_lookup() and radix_tree_lookup_slot()

radix_tree_lookup() and radix_tree_lookup_slot() have much the
same code except for the return value.

Introduce radix_tree_lookup_element() to do the real work.

/*
 * is_slot == 1 : search for the slot.
 * is_slot == 0 : search for the node.
 */
static void * radix_tree_lookup_element(struct radix_tree_root *root,
unsigned long index, int is_slot);

Signed-off-by: Huang Shijie <shijie8@gmail.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/radix-tree.c