Re: [Final call for testers][PATCH] superblock handling changes

Linus Torvalds (torvalds@transmeta.com)
Fri, 15 Jun 2001 12:12:02 -0700 (PDT)


On Fri, 15 Jun 2001, Alexander Viro wrote:
> > > + list_add (&s->s_list, super_blocks.prev);
> >
> > I'd use list_add_tail(&s->s_list, super_blocks);
>
> Umm... Why?

I have to agree with Matthew - "list_add_tail()" more clearly says what
the code is trying to do.

Aside from that, I will bet you a dollar that you'll see that using
"list_add_tail()" generating better code. Why? Simply because that way one
of the pointers is a constant, instead of being through indirection. Try
it and see.

And if order is arbitrary, please just use

list_add(&s->s_list, super_blocks);

because otherwise why use the ".prev" at all?

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/