From nobody Wed Oct 25 16:56:44 2023 X-Original-To: dev-commits-src-all@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 4SFw7d1jkjz4xlGl; Wed, 25 Oct 2023 16:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SFw7d0rZdz4c2h; Wed, 25 Oct 2023 16:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698253005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B+KFGZ4wghfBy6tlLoykZc5JZn++JiuWpmkbSXEqR8Q=; b=AGP3V4jKcIFdbehLivazQDxY+UtpN0veCYD4+lnMhTpBMx/ygebJJwqWnxkxiG+FW3/eZ5 y3Bj6MwCLDN2vUU5r9HeFvvNAXxqEixc3lGeXqNpT8TxHjIXHnHss5C4QMHwwguyPRjsYI 6NOQh5BcOFLTc0I0hrf4PNsICA9s/eTYSdvwATUR7T1xkEKTUeto4SUmmOQmBH51keahoF kzXQLP689KVjpMjYq2zkbp4bU6V72YYNv7SF+Z4oTxwl47FL668ziXn/ci8nZv0rmNwG2V VPaEPw2apONAjv81df4jGD5lyuAdahxDqgOOorzFRqqHCmob5MvzNyGpl/yF0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698253005; a=rsa-sha256; cv=none; b=FCVWd0InTpmxK0LYaz5ZtF/ZLU2H/m5iMV1Z5iXBWlmAGVmj4bh8CWY4TtRO0qpizp330h Iex2s0dSLg/kTAyGAjiIEP3iHz9lDqqhRK0Eq/m6iUCI/eOfWlimNPRQtVH+e0BocfstZw AKvBWMOjg4d8pahIU+2Blfk6pNPd/djdfu1k3WuXvXmYP5AoMb4u4EGJO9olMHYeXZae/I TwRLqJDGM7nvkFHTt+IyzbERuVNd8ki447WHU5LVfLHiT3Y0TRddigWmXeBWx+JAht6QdN VLT6huQRiuG+3Pj+ydvZkyfdJamj8Z1aXOsLHVyyhvwRcrJZoQYCGu02v8gWPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698253005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B+KFGZ4wghfBy6tlLoykZc5JZn++JiuWpmkbSXEqR8Q=; b=BP6eXtkCh1bqlT52ay5FTpkwiiZ4N9bomnZ9yCStku1EdwwPR3ZxZEHsHYbNRI4dY4YfS9 9+MzvSQeYy2cmiTBT5vhkiBY7NpZmxbn242O4bom4jHve+zO89SCQqRzTnhlNGUO/0pW0E ePUKw/5DgGgQIk8l7IqoaKK/VXya8qBoz+4PEYjwHtAo6QmAgn+N0TUwGRHkdBq7n03yKI NuhIKN7hVaul+UFDCC/zAlQdhsOwbvdGGMlrXSE3BDzSimCRRRlOYX0AFx+yiklaw7fdje kMNsJ930Ap647n+xQwO8bTdd4+8WoiDpffny4z9ckOdk3u7iYZi7hx36YdlQqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SFw7c6vf6z1BcS; Wed, 25 Oct 2023 16:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39PGuibB022064; Wed, 25 Oct 2023 16:56:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39PGuiKM022061; Wed, 25 Oct 2023 16:56:44 GMT (envelope-from git) Date: Wed, 25 Oct 2023 16:56:44 GMT Message-Id: <202310251656.39PGuiKM022061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 60bc03c9c36a - releng/14.0 - makefs/zfs: Fill out dd_used_breakdown fields in DSL directories List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 60bc03c9c36aa38204e862269f13bf79ded72119 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=60bc03c9c36aa38204e862269f13bf79ded72119 commit 60bc03c9c36aa38204e862269f13bf79ded72119 Author: Mark Johnston AuthorDate: 2023-10-23 15:08:04 +0000 Commit: Mark Johnston CommitDate: 2023-10-25 16:55:52 +0000 makefs/zfs: Fill out dd_used_breakdown fields in DSL directories This is required for the "used", "usedds" and "usedchild" dataset properties to be displayed. Approved by: re (gjb) PR: 274613 Reported by: Mike Tancsa MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit eb5cbd793e31f9d656999033be54dac1a1107294) --- usr.sbin/makefs/zfs/dsl.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/usr.sbin/makefs/zfs/dsl.c b/usr.sbin/makefs/zfs/dsl.c index a9ab93a90c38..f7abebe2e245 100644 --- a/usr.sbin/makefs/zfs/dsl.c +++ b/usr.sbin/makefs/zfs/dsl.c @@ -482,7 +482,7 @@ dsl_dir_finalize(zfs_opt_t *zfs, zfs_dsl_dir_t *dir, void *arg __unused) dnode_phys_t *snapnames; zfs_dsl_dataset_t *headds; zfs_objset_t *os; - uint64_t bytes, snapnamesid; + uint64_t bytes, childbytes, snapnamesid; dsl_dir_finalize_props(dir); zap_write(zfs, dir->propszap); @@ -514,6 +514,7 @@ dsl_dir_finalize(zfs_opt_t *zfs, zfs_dsl_dir_t *dir, void *arg __unused) headds->phys->ds_uncompressed_bytes = bytes; headds->phys->ds_compressed_bytes = bytes; + childbytes = 0; STAILQ_FOREACH(cdir, &dir->children, next) { /* * The root directory needs a special case: the amount of @@ -523,9 +524,13 @@ dsl_dir_finalize(zfs_opt_t *zfs, zfs_dsl_dir_t *dir, void *arg __unused) */ if (dir == zfs->rootdsldir && cdir == zfs->mosdsldir) continue; - bytes += cdir->phys->dd_used_bytes; + childbytes += cdir->phys->dd_used_bytes; } - dsl_dir_size_add(dir, bytes); + dsl_dir_size_add(dir, bytes + childbytes); + + dir->phys->dd_flags |= DD_FLAG_USED_BREAKDOWN; + dir->phys->dd_used_breakdown[DD_USED_HEAD] = bytes; + dir->phys->dd_used_breakdown[DD_USED_CHILD] = childbytes; } void