From owner-freebsd-current Sun Oct 18 21:19:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA12582 for freebsd-current-outgoing; Sun, 18 Oct 1998 21:19:14 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA12577 for ; Sun, 18 Oct 1998 21:19:11 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id OAA15377; Mon, 19 Oct 1998 14:18:36 +1000 Date: Mon, 19 Oct 1998 14:18:36 +1000 From: Bruce Evans Message-Id: <199810190418.OAA15377@godzilla.zeta.org.au> To: chuckr@mat.net, peter@netplex.com.au Subject: Re: mount flags Cc: freebsd-current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> > What's wrong with the f_fstypename[] field in struct statfs? It'll >> > contain a string "nfs" or "ufs" etc.. >> >> I looked in the statfs man page and couldn't see any kind of definition >> of what went in that field (so as to use it to choose from). I took a >> quick look at the code, nothing immediately jumps out at me ... for an >> external system interface, it's certainly obscurely set up, isn't it? >> >> Do you know where the derivation of the f_fstypename values comes from? >> I just can't find it. > >Hmm.. Now that you mention it... I don't see where it's being set >either. I'm not sure that it is being set at all... :-( Er, it's set by a strncpy() in kern/vfs_syscalls.c:mount(). This is as simple as possible. The only complication is that the definitions of type names are distributed, so it is hard to see all the names at once (lsvfs only gives the names of the loadeded ones). >Short term hack: look at f_type in the statfs struct, and use the >getvfsent() routines to map that back into a type name. >According to : >/usr/include/sys/mount.h:struct ovfsconf *getvfsbytype __P((int)); Don't. Interfaces that use ovfsconf are obsolescent. Only lsvfs really needs them. I didn't manage to remove them for 3.0, sigh. The only "correct" use for f_type is to call vfs ioctls by number. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message