On Mon, Dec 05, 2005 at 09:24:18AM -0800, Christoph Lameter wrote:
> On Mon, 5 Dec 2005, Wu Fengguang wrote:
>
> > return slot;
> >
> > It should be
> >
> > return &slot;
>
> That wont work. slot is a local variable. Drop this patch please.
Thanks. Sorry for the careless mistake.
But your patch do fit well in my patch :)
void *radix_tree_lookup_node(struct radix_tree_root *root,
unsigned long index, unsigned int level)
{
unsigned int height, shift;
struct radix_tree_node *slot;
height = root->height;
if (index > radix_tree_maxindex(height))
return NULL;
shift = (height-1) * RADIX_TREE_MAP_SHIFT;
slot = root->rnode;
while (height > level) {
if (slot == NULL)
return NULL;
slot = slot->slots[(index >> shift) & RADIX_TREE_MAP_MASK];
shift -= RADIX_TREE_MAP_SHIFT;
height--;
}
return slot;
}
void **radix_tree_lookup_slot(struct radix_tree_root *root, unsigned long index)
{
struct radix_tree_node *node;
node = radix_tree_lookup_node(root, index, 1);
return node->slots + (index & RADIX_TREE_MAP_MASK);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]