diff options
author | Mateusz Guzik <[email protected]> | 2020-10-29 17:52:50 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-29 09:52:50 -0700 |
commit | 082ff328f2582ac32b74e40328c89fe7a74f4dbf (patch) | |
tree | 674fd4c6c6cf763009a006d63d66817de12e1bc7 /module | |
parent | 4ce728d028bc8bc32dfeced2a590edec12be565d (diff) |
FreeBSD: g/c unused zfs_znode_move support
The allocator does not provide the functionality to begin with.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Matt Macy <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Mateusz Guzik <[email protected]>
Closes #11114
Diffstat (limited to 'module')
-rw-r--r-- | module/os/freebsd/zfs/zfs_vfsops.c | 11 | ||||
-rw-r--r-- | module/os/freebsd/zfs/zfs_znode.c | 21 |
2 files changed, 1 insertions, 31 deletions
diff --git a/module/os/freebsd/zfs/zfs_vfsops.c b/module/os/freebsd/zfs/zfs_vfsops.c index 4e437f5ba..671b939b5 100644 --- a/module/os/freebsd/zfs/zfs_vfsops.c +++ b/module/os/freebsd/zfs/zfs_vfsops.c @@ -1118,22 +1118,11 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t mounting) return (0); } -extern krwlock_t zfsvfs_lock; /* in zfs_znode.c */ - void zfsvfs_free(zfsvfs_t *zfsvfs) { int i; - /* - * This is a barrier to prevent the filesystem from going away in - * zfs_znode_move() until we can safely ensure that the filesystem is - * not unmounted. We consider the filesystem valid before the barrier - * and invalid after the barrier. - */ - rw_enter(&zfsvfs_lock, RW_READER); - rw_exit(&zfsvfs_lock); - zfs_fuid_destroy(zfsvfs); mutex_destroy(&zfsvfs->z_znodes_lock); diff --git a/module/os/freebsd/zfs/zfs_znode.c b/module/os/freebsd/zfs/zfs_znode.c index 50fb6a5fe..5a0297383 100644 --- a/module/os/freebsd/zfs/zfs_znode.c +++ b/module/os/freebsd/zfs/zfs_znode.c @@ -91,14 +91,7 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, znode, CTLFLAG_RD, * (such as VFS logic) that will not compile easily in userland. */ #ifdef _KERNEL -/* - * Needed to close a small window in zfs_znode_move() that allows the zfsvfs to - * be freed before it can be safely accessed. - */ -krwlock_t zfsvfs_lock; - -#if defined(_KERNEL) && !defined(KMEM_DEBUG) && \ - __FreeBSD_version >= 1300102 +#if !defined(KMEM_DEBUG) && __FreeBSD_version >= 1300102 #define _ZFS_USE_SMR static uma_zone_t znode_uma_zone; #else @@ -200,7 +193,6 @@ zfs_znode_init(void) /* * Initialize zcache */ - rw_init(&zfsvfs_lock, NULL, RW_DEFAULT, NULL); ASSERT(znode_uma_zone == NULL); znode_uma_zone = uma_zcreate("zfs_znode_cache", sizeof (znode_t), zfs_znode_cache_constructor_smr, @@ -228,7 +220,6 @@ zfs_znode_init(void) /* * Initialize zcache */ - rw_init(&zfsvfs_lock, NULL, RW_DEFAULT, NULL); ASSERT(znode_cache == NULL); znode_cache = kmem_cache_create("zfs_znode_cache", sizeof (znode_t), 0, zfs_znode_cache_constructor, @@ -267,7 +258,6 @@ zfs_znode_fini(void) znode_cache = NULL; } #endif - rw_destroy(&zfsvfs_lock); } @@ -449,10 +439,6 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); zp->z_moved = 0; - /* - * Defer setting z_zfsvfs until the znode is ready to be a candidate for - * the zfs_znode_move() callback. - */ zp->z_sa_hdl = NULL; zp->z_unlinked = 0; zp->z_atime_dirty = 0; @@ -529,11 +515,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++; - membar_producer(); - /* - * Everything else must be valid before assigning z_zfsvfs makes the - * znode eligible for zfs_znode_move(). - */ zp->z_zfsvfs = zfsvfs; mutex_exit(&zfsvfs->z_znodes_lock); |