Date: Sun, 18 Oct 1998 23:30:58 -0400 (EDT) From: Chuck Robey <chuckr@mat.net> To: Peter Wemm <peter@netplex.com.au> 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: <Pine.BSF.4.05.9810182323290.348-100000@picnic.mat.net> In-Reply-To: <199810190254.KAA03668@spinner.netplex.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9810182323290.348-100000>
