aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2023-09-16 14:18:05 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2023-09-16 14:18:05 +0000
commit49874af3eca6fbbeb3967c737baa3478d6a4e967 (patch)
tree849cdc80324db263e6fb81ed1c5ed03ff2b882a5 /sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
parentd643925a79caab5c6de62b066e374935b60bcaf1 (diff)
downloadsrc-49874af3eca6fbbeb3967c737baa3478d6a4e967.tar.gz
src-49874af3eca6fbbeb3967c737baa3478d6a4e967.zip
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
Diffstat (limited to 'sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c')
-rw-r--r--sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c8
1 files changed, 3 insertions, 5 deletions
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)