Re: Question on the VFS inode structure.

Malcolm Beattie (mbeattie@sable.ox.ac.uk)
Wed, 27 Oct 1999 18:11:58 +0100 (BST)


Alexander Viro writes:
> On Wed, 27 Oct 1999, T V Govind wrote:
> > I'm new to linux and am currently in the process of trying to
> > understand the kernel source (file system code specifically). i have the
> > following question, the VFS inode structure has a union (shown below)
> > that is a union of the "private data" of all those file systems that are
> > currently supported on linux. Is there any specific reason why this
> > union is maintained within the inode structure itself. i mean the
> > structure is kind of not-specific to any particular file system and is
> > also defined as part of the VFS layer on linux.
>
> The stuff will be switched to external allocation as soon as the pagecache
> changes will settle down.

I don't remember exactly what you proposed for this, but if you are
intending to replace the inode structure with a generic one which has
a pointer to a separately allocated per-fs structure then here's a
warning. Digital UNIX used to that but had to change it exactly the
opposite way for performance reasons. Its vnode structure used to
have a v_data pointer to a separately allocated per-fs "private"
structure. However, performance was bad because of the pointer
following and the extra fragmentation. They ended up reuniting the two
so that they could allocate the whole (generic + private) structure in
one chunk and then made v_data point to directly after the generic
part (i.e. the start of the no-longer-separate private part).

They did the same with their ungodly mixture of BSD and Mach
structures for tasks and threads: they had separate struct task,
struct proc and struct utask which they combined into a single struct
super_task (though still with pointers between the supposedly
"separate" bits) and they had separate struct thread and struct
np_uthread which they combined into struct super_thread.

--Malcolm

-- 
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Unix Systems Programmer
Oxford University Computing Services

- 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/