From nobody Sat Sep 16 14:20:17 2023 X-Original-To: dev-commits-src-main@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 4RntW56m4Dz4t8nr; Sat, 16 Sep 2023 14:20:17 +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 4RntW56Jxwz4PPl; Sat, 16 Sep 2023 14:20:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694874017; 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=5ydENEVRKFXXfb7xGkMRlQ0T5MG20VKyt7T2Cn41+PY=; b=Kf6IaXzVBYhx4rLEzTyEocuJzRECYiro5l9aB3V8nwsM1Hs59oXB8W1kmNc1d+4j8f5FzJ cTObbsiZAeSWILppuZS08RNZ4KrTRhr7RB9jA1n3FhTb4rnRquT0m7qfoSeggqyA2G42pr qmNtoelPFYcHYHJxNCFEHdtqc6MCsAjgxMLnx4Httt6tFNqcEJMAjhbMTzjZZJwQ8/wIPJ TTY5H1r4Qetmop7mhlgsz1/WszlcjMyh9muF+lbuqyMTT/Nzq3C7bJK0fJKeLfKrRwvNXL P/fqQ50wRFzUbOXH4wGXNg0iwujJI7BYMgK5SP1yEgNGYTyyQKO75MhC5UOmDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694874017; a=rsa-sha256; cv=none; b=INTS7p2HW8fiO5Ch5Y43YfDHC20MBeK/nhyZ3VCqvIYdV7nUQ4YfYd9p+4+xmgNlRDD0AV EiqJSOPkDSihqPY/G2PP5+rdDy6JEaOCrucluL8nOyIRGJ4nl+v0Awn2OrkWXOyz+AOVNV zKzex9DDyVAo1ao6EktIcwwW/uyu3eJ/WwEMCAbnn6MBospDywRlgqqtv9EvC7YkK8+o5+ UEoeEw07uG2iYErP54nBbncrtaQDZ7mHsajtRr3qgDzdyadLM4IyW8R6ERL6dPnqO4l1qt U557+8LlzKOAgJlNE7SVCi8RbtnW9LzXxwt11dp8eMm41JdYbxV2z30Lr3HfIw== 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=1694874017; 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=5ydENEVRKFXXfb7xGkMRlQ0T5MG20VKyt7T2Cn41+PY=; b=TJUjaVq31iHi7DIU7QOdQxygtcjG/XDhw3hOke8aiZhMcLrUgyH0VBXJ3GO3MI7CVwqd+a lxZ3t36kOgXGblIF/II89PHFHClCxe2mx3em+wOopW87PvTshMgSnZk52g6Yl02Z2/h4ia OH7aQqTa1jI9Hvyd64w9YR8aLROyqU5LSLMzpX60Z/+bCtVdXmp/feVqw+jZiHeLMTe0Xf wkt1ZDaHzeAyBzV4ORMi37kOEUFcMyqCIBiGm/GT81TT6CCSNdERlazFi6MtLNEfDepihZ ddid4DgwmSl6aflAS1SYcyr2LMmlGSbu+8osChIR3PD3SHx1kEJTzmKz+9ByCQ== 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 4RntW55NcVz18mm; Sat, 16 Sep 2023 14:20:17 +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 38GEKHca008294; Sat, 16 Sep 2023 14:20:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38GEKHrZ008283; Sat, 16 Sep 2023 14:20:17 GMT (envelope-from git) Date: Sat, 16 Sep 2023 14:20:17 GMT Message-Id: <202309161420.38GEKHrZ008283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 49874af3eca6 - main - zfs: retire z_nr_znodes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49874af3eca6fbbeb3967c737baa3478d6a4e967 Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=49874af3eca6fbbeb3967c737baa3478d6a4e967 commit 49874af3eca6fbbeb3967c737baa3478d6a4e967 Author: Mateusz Guzik AuthorDate: 2023-09-16 14:18:05 +0000 Commit: Mateusz Guzik CommitDate: 2023-09-16 14:18:05 +0000 zfs: retire z_nr_znodes It is not needed and is going away soon(tm), facilitating other changes. See https://github.com/openzfs/zfs/pull/15274 --- sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h | 1 - sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 8 +++----- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c | 2 -- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h b/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h index 5948e44daab1..56a0ac96ac19 100644 --- a/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h +++ b/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h @@ -93,7 +93,6 @@ struct zfsvfs { zfs_teardown_lock_t z_teardown_lock; zfs_teardown_inactive_lock_t z_teardown_inactive_lock; list_t z_all_znodes; /* all vnodes in the fs */ - uint64_t z_nr_znodes; /* number of znodes in the fs */ kmutex_t z_znodes_lock; /* lock for z_all_znodes */ struct zfsctl_root *z_ctldir; /* .zfs directory pointer */ boolean_t z_show_ctldir; /* expose .zfs in the root dir */ diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c index 49b97ae8f590..8969fd6a54bd 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c @@ -1158,7 +1158,6 @@ zfsvfs_free(zfsvfs_t *zfsvfs) mutex_destroy(&zfsvfs->z_znodes_lock); mutex_destroy(&zfsvfs->z_lock); - ASSERT3U(zfsvfs->z_nr_znodes, ==, 0); list_destroy(&zfsvfs->z_all_znodes); ZFS_TEARDOWN_DESTROY(zfsvfs); ZFS_TEARDOWN_INACTIVE_DESTROY(zfsvfs); @@ -1562,12 +1561,11 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting) * may add the parents of dir-based xattrs to the taskq * so we want to wait for these. * - * We can safely read z_nr_znodes without locking because the - * VFS has already blocked operations which add to the - * z_all_znodes list and thus increment z_nr_znodes. + * We can safely check z_all_znodes for being empty because the + * VFS has already blocked operations which add to it. */ int round = 0; - while (zfsvfs->z_nr_znodes > 0) { + while (!list_is_empty(&zfsvfs->z_all_znodes)) { taskq_wait_outstanding(dsl_pool_zrele_taskq( dmu_objset_pool(zfsvfs->z_os)), 0); if (++round > 1 && !unmounting) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c index c4f2b722ef4e..0d4c94555c6b 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c @@ -537,7 +537,6 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, mutex_enter(&zfsvfs->z_znodes_lock); list_insert_tail(&zfsvfs->z_all_znodes, zp); - zfsvfs->z_nr_znodes++; zp->z_zfsvfs = zfsvfs; mutex_exit(&zfsvfs->z_znodes_lock); @@ -1286,7 +1285,6 @@ zfs_znode_free(znode_t *zp) mutex_enter(&zfsvfs->z_znodes_lock); POINTER_INVALIDATE(&zp->z_zfsvfs); list_remove(&zfsvfs->z_all_znodes, zp); - zfsvfs->z_nr_znodes--; mutex_exit(&zfsvfs->z_znodes_lock); #if __FreeBSD_version >= 1300139