From owner-freebsd-current Sun Oct 18 20:00:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA06727 for freebsd-current-outgoing; Sun, 18 Oct 1998 20:00:32 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA06716 for ; Sun, 18 Oct 1998 20:00:12 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.9.1/8.9.1/Spinner) with ESMTP id KAA03668; Mon, 19 Oct 1998 10:54:40 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199810190254.KAA03668@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: Chuck Robey cc: Nik Clayton , Andy Farkas , freebsd-current@FreeBSD.ORG Subject: Re: mount flags In-reply-to: Your message of "Sun, 18 Oct 1998 22:17:30 -0400." Date: Mon, 19 Oct 1998 10:54:40 +0800 From: Peter Wemm Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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