Subject: Re: Exports list management, take 3
To: Julio M. Merino Vidal <jmmv84@gmail.com>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 09/18/2005 14:21:52
On Sun, Sep 18, 2005 at 12:36:15AM +0200, Julio M. Merino Vidal wrote:
> On 9/17/05, Julio M. Merino Vidal <jmmv84@gmail.com> wrote:
> [...]
> > - Change the mount_* commands to not deal with NFS stuff; done
> >   internally by the kernel when initializing the NFS support for each
> >   file system.
> 
> Just to let you know: I've just done some further improvements and
> updated the patch.  Basically, I tried to push more NFS specific details
> into nfs/ rather than leaving them in kern/ intermixed with unrelated
> stuff (and adding bloat even when the kernel is built without NFS
> server support).
> 
> That is:
> - Avoid defining a netexport field in 'struct mount'.  Instead, keep a
>   mount<->netexport map in the NFS code that can be accessed to do
>   the conversion.
> - Drop the 'features' flags so that file systems do not need to tell the
>   upper layer about their "NFS support" (which in fact is not "real" in
>   the sense that there is no such thing in file systems).  Assume that
>   a file system is NFS exportable if its vfs_vptofh and vfs_fhtovp
>   operations are not NULL.  (Otherwise return EOPNOTSUPP where
>   appropriate.)  As a side effect, many file systems will see their size
>   reduced, as the stubs for these two functions will go away.
> - Move netcred and netexport structures into nfs' code, instead of
>   having them in mount.h.  (They don't even need to be in a header
>   file now.)

excellent, I was going to suggest most of this stuff but you beat me to it.
separating out the NFS stuff from the rest of the system is a good cleanup.
the NFS code has always been way more intrusive than it had any right to be.

-Chuck


> I have the feeling that, after all these changes, we will see a reduction
> in kernel size (specially when !NFSSERVER), and maybe also in other
> situations :-)
> 
> -- 
> Julio M. Merino Vidal <jmmv84@gmail.com>
> http://www.livejournal.com/users/jmmv/
> The NetBSD Project - http://www.NetBSD.org/