mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
FreeBSD: g/c unused zfs_znode_move support
The allocator does not provide the functionality to begin with. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Matt Macy <mmacy@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Closes #11114
This commit is contained in:
parent
4ce728d028
commit
082ff328f2
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user