From nobody Tue May 28 14:11:41 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VpZFZ3fydz5MRtS for ; Tue, 28 May 2024 14:11:46 +0000 (UTC) (envelope-from gray@nxg.name) Received: from mx2.mythic-beasts.com (mx2.mythic-beasts.com [IPv6:2a00:1098:0:82:1000:0:2:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4VpZFY61Nsz414H for ; Tue, 28 May 2024 14:11:45 +0000 (UTC) (envelope-from gray@nxg.name) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=nxg.name header.s=mythic-beasts-k1 header.b=3piGrM40; dmarc=none; spf=pass (mx1.freebsd.org: domain of gray@nxg.name designates 2a00:1098:0:82:1000:0:2:1 as permitted sender) smtp.mailfrom=gray@nxg.name DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nxg.name; s=mythic-beasts-k1; h=Date:Subject:To:From; bh=6SXGTAY8X52uZOduXFOuk+8tcbmhj4ahLfTVvZtvWwI=; b=3piGrM40QpnPfLdSwjyiZk1cn4 f3iZs2wPl/lm4xfdMtkhUFf8vzBwevKSAkBCUPdA6WAbPL9JdVBfzehbqCNSHapZRipbUO4+E7e/3 wdxZZoGkGwxYcIAPrIatCkxjhUtrd4jsDUyewJHyncjN2A+dbz0uiOq7Q0A7kt8xndeeqPaWQtqJ8 AZoxWsHkJI7cG7yipreQzxCOlMut1dC6jxOItlxSrazFrcx6BiQHHC2sBtGGU4jreJdHeGXtVi17B zPjCXu3jjObyZ3rcA6GIoiOyadQzlXAUQEQ4/eoywrRV3CxEatIdVXKoM55GjkH4V1oe36GpCVzbf N47zVVog==; Received: by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sBxYG-00FUqR-32; Tue, 28 May 2024 15:11:45 +0100 From: Norman Gray To: freebsd-hackers@freebsd.org Subject: quotactl(2): units of reported sizes on ZFS Date: Tue, 28 May 2024 15:11:41 +0100 X-Mailer: MailMate (1.14r5964) Message-ID: <3EAE7B9F-C672-4FE1-B28C-42F84685D585@nxg.name> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-BlackCat-Spam-Score: 24 X-Spam-Status: No, score=2.4 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.60 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; R_MISSING_CHARSET(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1098:0:82:1000:0:2:0/112]; R_DKIM_ALLOW(-0.20)[nxg.name:s=mythic-beasts-k1]; RCVD_IN_DNSWL_MED(-0.20)[2a00:1098:0:82:1000:0:2:1:from]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; ASN(0.00)[asn:44684, ipnet:2a00:1098::/32, country:GB]; RCVD_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DMARC_NA(0.00)[nxg.name]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[nxg.name:+] X-Rspamd-Queue-Id: 4VpZFY61Nsz414H 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