Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 2024 15:11:41 +0100
From:      Norman Gray <gray@nxg.name>
To:        freebsd-hackers@freebsd.org
Subject:   quotactl(2): units of reported sizes on ZFS
Message-ID:  <3EAE7B9F-C672-4FE1-B28C-42F84685D585@nxg.name>

next in thread | raw e-mail | index | archive | help

Hello, list.

[I might be asking on the wrong list, but would welcome redirection]

I'm trying to get programmatic access to read ZFS quota information, and =
I'm not finding my questions answered by what seem to be the relevant man=
pages -- specifically quotactl(2) on 14.0.

Though the manpage says that quotactl is supported only on UFS, it (now) =
works on ZFS filesystems, too. The response from a Q_GETQUOTA call produc=
es numbers in units of blocks, according to ufs/ufs/quota.h internal comm=
ents, but without documenting what size those blocks are. I get the right=
 numbers (in the sense of matching the results from zfs userspace) if I a=
ssume a block is 512B, but I can't see that written down anywhere, so don=
't in principle know if that's always true, or if it's something dependen=
t on, for example, the pool's ashift value.

So, questions:

  * I'm presuming quotactl(2) is indeed now supported on ZFS, rather than=
 this just working by accident (this does of course seem vanishingly unli=
kely, but I'd like a manpage to tell me this in words of one syllable).  =
Is that correct?
  * What's the documented way of getting the 'block size' units in which =
quotactl reports its results?

Both of these boil down to:

  * Is there a manpage I'm missing?

I feel sure there's an embarrassing aha! waiting for me here, because I'm=
 looking in completely the wrong place, but I'd welcome being pointed in =
the right direction as tactfully as possible.

I've put in a docbug report (279249, and see also 234413) noting the appa=
rent gap in the quotactl(2) manpage.

I also asked on one of the forums, and was pointed towards libzfs, but I =
can't find any documentation on that, either.  I can see libzfs in the ZF=
S repo [1], but there doesn't seem to be a manpage covering the library, =
nor obviously relevant comments within libzfs.h.

Best wishes,

Norman


[1] https://github.com/openzfs/zfs/tree/master


-- =

Norman Gray  :  https://nxg.me.uk



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EAE7B9F-C672-4FE1-B28C-42F84685D585>