Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Oct 1998 14:18:36 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        chuckr@mat.net, peter@netplex.com.au
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: mount flags
Message-ID:  <199810190418.OAA15377@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> > 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 <sys/mount.h>:
>/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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810190418.OAA15377>