How to fill in the fsid for file systems?

Andriy Gapon avg at FreeBSD.org
Tue Oct 30 08:18:11 UTC 2018


On 29/10/2018 17:56, Rick Macklem wrote:
> It seems "fsid=N" does need to set f_fsid.val[1]. I can think of two possibilities:
> 1 - Do what ZFS does and set the low order 8bits to vfc_typenum and the high
>       order 24bits from bits 32->55 of "N".
> or
> 2 - Just fill the 32bits in with the high order (32->63) bits of "N" and forget about
>      vfc_typenum.
> The only reason I can see for using vfc_typenum is to avoid collisions (same fsid value)
> with fsids for mounts of other file system types.

I have come up with an option #3 :-)
Fill f_fsid.val[1] with some constant magic value that signals that val[0] is
manually set.
Some possible magic values: 0x0, 0xffffffff.

-- 
Andriy Gapon


More information about the freebsd-fs mailing list