Author: mjg
Date: Mon Oct 26 08:17:41 2020
New Revision: 367054
URL: https://svnweb.freebsd.org/changeset/base/367054

Log:
  zfs: remove unused support for zfs_znode_move

Modified:
  head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
  head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c

Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
==============================================================================
--- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c Mon Oct 26 
05:22:52 2020        (r367053)
+++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c Mon Oct 26 
08:17:41 2020        (r367054)
@@ -1118,21 +1118,10 @@ 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);
 

Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c
==============================================================================
--- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c  Mon Oct 26 
05:22:52 2020        (r367053)
+++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c  Mon Oct 26 
08:17:41 2020        (r367054)
@@ -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 b
        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 b
        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);
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to