ZFS quotactl(2): units of reported sizes

I'm trying to get programmatic access to ZFS quotas, and I'm not finding my questions answered by what seem to be the relevant manpages -- 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 produces numbers in units of blocks, according to ufs/ufs/quota.h internal comments, 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 assume 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 dependent on, for example, the pool's ashift value.

Is there a manpage I'm missing?

I've put in a docbug report, and I did previously ask on a userland programming forum, but if there's a better place to ask than here, I'd welcome being pointed towards it.
 
ZFS does not have one block size, but many at the same time. ✨ While the size of management data is fixed, the size of payload blocks (in ZFS terminology records) is variable.
As a matter principle do not use something that is not documented. 🌋 A feature may be gone or altered in the next version, and discovering the bugs it causes can be a nightmare. 🏖️ Do yourself a favor and use the libzfs interface instead.
: In theory could be prevented/disabled.
 
As a matter principle do not use something that is not documented.
Of course, that's precisely why I'm asking -- if something isn't documented, it doesn't exist.

libzfs sounds useful (thanks for the suggestion) but I'm having difficulty finding more about it. man libzfs doesn't produce anything nor are there any likely-looking see-alsos at the end of zfs(8); and though I can see /usr/include/libzfs.h, that doesn't really count as documentation. There isn't an obvious mention of it in the handbook, either.
 
Back
Top