On Wed, 27 Jun 2001, Ben LaHaise wrote:
> On Wed, 27 Jun 2001, Linus Torvalds wrote:
>
> > If we're going to do this for a major filesystem, then I'd really just
> > rather see this being done generically during 2.5.x, making "u" be a
> > pointer only, and having the generic "iput()" just always free the dang
> > thing.
>
> Are you certain that adding yet another level of pointer indirection here
> is a good idea?  The whole cache miss and indirection issue is exactly why
> almost all systems in the world make use of a VNODE style interface.

Oh, I'm not. But if we do this for NFS, then we'd better think hard about
whether we should (a) do it at all or (b) do it for everything.

The alternative, of course, is to just have different allocation-pools for
different filesystems. There's nothing that says that we should be able to
re-use an inode allocation done for one filesystem for another filesystem.
This would be my favourite approach, in fact. Instead of having

        struct inode {
                generic fields
                union {
                        specific-ext2 struct
                        specific-nfs struct
                        ...
                }
        }

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.

Disadvantages: ??

                Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]

Reply via email to