Using fstatfs on a ZFS disk
Andriy Gapon
avg at FreeBSD.org
Mon Feb 19 21:20:50 UTC 2018
On 19/02/2018 20:33, Rodney W. Grimes wrote:
>> Hi,
>>
>>> On 19 Feb 2018, at 15:50, Willem Jan Withagen <wjw at digiware.nl> wrote:
>>> Now 0xde != 27, so the question is, where is this 0xde specified.
>>> And more important is this f_type constant over all FreeBSD ZFS filesystems?
>>
>> You got me. And a quick look at sys/kern/vfs_syscalls.c doesn?t help except to imply that the type is set when the filesystem is mounted. I have no idea where 0xde comes from.
>
> Could that 0xde be the start of 0xdeadcode?
>
> 0xde is 222 decimal, that does not ring a bell for me either.
This is simpler, I think.
It is a hash value (calculated using a specific algorithm) of a filesystem type
name. See vfs_register().
There are no magic predefined constants for the types.
BTW, lsvfs(1) and its source code could be of interest to the original poster.
E.g., getvfsbyname(3).
--
Andriy Gapon
More information about the freebsd-hackers
mailing list