fs specific union in struct buffer head? Optimal implementation of

Hans Reiser (reiser@idiom.com)
Fri, 15 Oct 1999 23:22:23 +0400


Vladimir and I are discussing how to implement allocate on flush in our next
major version (not for 2.4) of reiserfs.

> If you are going to reallocate on flush unformatted nodes you must be able
> to:
> a) figure out, that this is unformatted node;
> b) find parent of this unformatted node;
> c) find neighbors of it.
>
> All this are hard without having b_child, b_parent, b_left_neighbor,
> b_right_neighbor fields in buffer_head.
>
> Volodya

Do you need b_child? I think no. All you really need is b_parent, but
b_left_neighbor and b_right_neighbor might make the code faster.

I think it is entirely appropriate for us to put an fs specific union in struct
buffer_head. I think avoiding one leads to ugly code.
So as to not waste bytes, we should put #ifdef CONFIG_REISERFS in the
u.reiserfs_bh definition so that it uses 0 bytes if reiserfs is not configured.

Does everyone disagree with me?

I suppose as an alternative we could implement a left neighbor hash, and a right
neighbor hash, and a parent hash, but it would be uglier I think.

Hans

--
Get Linux (http://www.kernel.org) plus ReiserFS
 (http://devlinux.org/namesys).  If you sell an OS or
internet appliance, buy a port of ReiserFS!  If you
need customizations and industrial grade support, we sell them.

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