On Wednesday 27 June 2001 23:22, Linus Torvalds wrote:
> we could _easily_ have the setup
>
> struct ext2_inode {
> struct inode inode; /* Generic fields */
> specific-ext2 struct; /* specific fields */
> };
>
> and then when ext2 calls down to the generic VFS layer it just passes
>
> &ext2_inode->inode
>
> down, and when it gets a "struct inode *" it uses "inode_to_ext2()" to
> convert it to an ext2 inode pointer.
>
> This is what the "struct list_head" thing does, and it works remarkably
> well. It allows for embedding a list (or a hundred) into any object. The
> above would take the same approach, and allow embedding an inode (and
> maybe several) into any object.
>
> Advantages: no extra memory use, no indirection, no memory allocation
> overhead.
An advantage you overlooked: clean up fs.h so it doesn't have to include
every filesystem in the known universe.
All of this also applies to struct super_block.
> Disadvantages: ??
--
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]