mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 22:32:43 -04:00
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
This commit is contained in:
parent
d643925a79
commit
49874af3ec
3 changed files with 3 additions and 8 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue