From owner-freebsd-current Sun Oct 18 20:33:50 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA09609 for freebsd-current-outgoing; Sun, 18 Oct 1998 20:33:50 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from picnic.mat.net (picnic.mat.net [206.246.122.117]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA09598 for ; Sun, 18 Oct 1998 20:33:39 -0700 (PDT) (envelope-from chuckr@mat.net) Received: from localhost (chuckr@localhost) by picnic.mat.net (8.9.1/8.8.5) with ESMTP id XAA04027; Sun, 18 Oct 1998 23:30:59 -0400 (EDT) Date: Sun, 18 Oct 1998 23:30:58 -0400 (EDT) From: Chuck Robey To: Peter Wemm cc: Nik Clayton , Andy Farkas , freebsd-current@FreeBSD.ORG Subject: Re: mount flags In-Reply-To: <199810190254.KAA03668@spinner.netplex.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 19 Oct 1998, Peter Wemm wrote: > f_fsid is used internally by NFS as part of the network protocol, ignore > that. OK. I don't like the getvfsbytype method because of the far larger amount of work, it seems truly silly. I'd have to step thru all the available fs types, matching on name until I found one that had "nfs", then match the number found to the one from statfs. My first reaction is that it's a lot of work, wasteful. That's probably ridiculous, but let me ask another question, below. > > 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. If I do the getvfsbyname method, I do no pattern-matching at all (FreeBSD does that for me). When I do the lookup, the data is good at that point, isn't it, even in the face of the vfs or KLD loads/unloads, right? And, as long as I do no dismounting (the fs is up) that number can't change on me. The *set* of available numbers and their mappings can change, but not the one I'm sitting on, right? If that's true, for my app, that will do. I'd stop doing that, if I trusted that the statfs f_fstypename was reliably being set. It's too new, and I haven't found where it's getting set, no matter how much I search for it. ----------------------------+----------------------------------------------- Chuck Robey | Interests include any kind of voice or data chuckr@glue.umd.edu | communications topic, C programming, and Unix. 213 Lakeside Drive Apt T-1 | Greenbelt, MD 20770 | I run Journey2 and picnic (FreeBSD-current) (301) 220-2114 | and jaunt (NetBSD). ----------------------------+----------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message