From nobody Mon Oct 23 15:17:59 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 4SDf2b4WNdz4yB2B; Mon, 23 Oct 2023 15:17:59 +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 4SDf2b3ck2z4LJn; Mon, 23 Oct 2023 15:17:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698074279; 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=Rdenbc3yS8Zu09S4PDopni5zKXVQmly9l4LoxQksnQA=; b=ZnjiOSWUsjt7EbpTXmFjpTHDj4OnepfG+2FaKp2Ju6zRpyYYOgOUwGkTIaDyW86nPxqu35 bZtD0UJQf9BsrwEpx2YIeo44ePfo7RzbQIhHfPI+NpgWfrfxay2jQ5iqOg2gygIRadWV0S UJhvNwLmwbD+MOYdDufZBY3mBUtqa5sodDrPomes4qbbpHA5nREwMgs6TUn9f5XmiP4Kcg d++uKhl4VPpJkdd4c4g80u2vdpUBRfsMUwUilRExUmMhA5FrGTsH/lo6i4i14j1/G80eoz 4p80UsjPIyf+iFJXV6lcqG+ciy9Z057jJFgSVYuBqYFxe+GzH8IH2/x0UpT1Jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698074279; a=rsa-sha256; cv=none; b=BUpTo4oVc9Nd54sQlskVuHYwYP1L5UPpHnCFl5nkL7vAixXqxoiAiIF1eufiwk1b4XvC47 qQQImaCh/Xnr/EC25lkW6kl3fdmA9/YvsF5HMtQm9w3wiQxigB9Ea9qBNbxcvbtotpTmML jit0UqWHalD/o5qYnFl5j6tdUm9cROJC+19hjD1IacDJeAl7C/GvchibmYY+Rn2SIjsqu0 gE10el6s16e+xtfD+tF/bMIsvXwuAw2OaqyIlyY79IdBTpCYjlojjcb1IvAx+L4nyj/108 UiyKqABKgXqIr1iGkY1ekog3eaDfcNaNtqRlaqloCLeAFMge58KJarwM/J0wtQ== 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=1698074279; 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=Rdenbc3yS8Zu09S4PDopni5zKXVQmly9l4LoxQksnQA=; b=xnyU7LPc39pGU77hyU/5qweL/jnIDawCqjbtrsKthkcBKWELpurGXuYaYaQVP0SC3FYXYq bxNkzLV+aFZVTvNnabE0FBMU31/xN5/lbwLX91kxw1FKgHsc2Ksu7f2AwOfasxZYr0Tcr6 D5uSchYXIX0Vj8MK3t7qnTeUJfBfB6nwfeQCU+5bYfGbxTeFC78/n7cnAr1dFwx+sKruxR OALe/eClNTD1qbPVRXY2m32n8/ONpPYxYXN4pp+RX16+ulyViOGr+f/TjgunUexv+hwVwv oMU1jYfBIsb3Xfga2MvzE5RADB+b+tk7kmYeBHdtmFBh0U/J9fBnbQgfmV3tAQ== 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 4SDf2b2dlYzl2y; Mon, 23 Oct 2023 15:17:59 +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 39NFHxil046073; Mon, 23 Oct 2023 15:17:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39NFHxgt046070; Mon, 23 Oct 2023 15:17:59 GMT (envelope-from git) Date: Mon, 23 Oct 2023 15:17:59 GMT Message-Id: <202310231517.39NFHxgt046070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 96092bf9108c - main - 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/main X-Git-Reftype: branch X-Git-Commit: 96092bf9108c97b45d18fd26fbe91f2d1c7799b8 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=96092bf9108c97b45d18fd26fbe91f2d1c7799b8 commit 96092bf9108c97b45d18fd26fbe91f2d1c7799b8 Author: Mark Johnston AuthorDate: 2023-10-23 15:08:04 +0000 Commit: Mark Johnston CommitDate: 2023-10-23 15:12:14 +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. PR: 274613 Reported by: Mike Tancsa MFC after: 1 week Sponsored by: The FreeBSD Foundation --- 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