Date: Mon, 19 Oct 1998 10:54:40 +0800 From: Peter Wemm <peter@netplex.com.au> To: Chuck Robey <chuckr@mat.net> Cc: Nik Clayton <nik@nothing-going-on.demon.co.uk>, Andy Farkas <andyf@speednet.com.au>, freebsd-current@FreeBSD.ORG Subject: Re: mount flags Message-ID: <199810190254.KAA03668@spinner.netplex.com.au> In-Reply-To: Your message of "Sun, 18 Oct 1998 22:17:30 -0400." <Pine.BSF.4.05.9810182207500.348-100000@picnic.mat.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Chuck Robey wrote:
> On Mon, 19 Oct 1998, Peter Wemm wrote:
>
> > > Bruce can presumably shed some more light.
> > >
> > > N
> >
> > The FS type numbers are essentially random numbers, so it's no good
> > trying to match them to a MOUNT_* constant.
>
> I was hoping you wouldn't say that. Murphy was telling me you would.
It's been that way for a while, sorry.
> Mike commented that both the old and new methods should be working ...
> I agree, at least until the new method doesn't resemble keystone kops so
> well.
The "old" method is to use getvfsbytype based on the f_type field, that
still works across the board, but requires you to know that "nfs" is nfs
etc.
> > NetBSD had them #defined to strings, ie: #define MOUNT_NFS "nfs" so that
> > you had some idea what you could expect from the kernel on a known
> > filesystem. There can be no such thing as a canonical list since of
> > fstypenames because new ones can be loaded on the fly.
>
> OK. Can the field in struct statfs, f_fsid, be mapped to something,
> like say the struct vfsconf that comes back from a getvfsbyname(), the
> vfc_typenum field?
f_fsid is used internally by NFS as part of the network protocol, ignore
that.
vfc_typenum is the same as the statfs.f_type field. That's how you match
them.
You can, however, do a getvfsbyname("nfs") and get the magic number from
the returned vfc_typenum and use that instead of the old MOUNT_NFS
constant if that's more convenient. Beware that this isn't guaranteed to
remain constant in the face of vfs loads and unloads via the lkm or kld
mechanism.
> Geeze, that nfs code is impenetrable.
You said it. :-)
Cheers,
-Peter
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810190254.KAA03668>
