diff --git a/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index ec5e4171974b87fa145693bb336beba080736b63..ec2191573000bca822a37abb21b9a40293d60506 100644 --- a/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -3707,7 +3707,6 @@ int zfs_inactive(vnode_t *vp) { znode_t *zp = VTOZ(vp); - uint32_t saved_z_ref_cnt; zfsvfs_t *zfsvfs; int error; @@ -3772,16 +3771,6 @@ zfs_inactive(vnode_t *vp) } } - /* - * Save the znode refcnt to determine later whether or not the - * underlying object was destroyed by zfs_zinactive. - * Do that by checking if the saved refcnt reaches zero after - * decrementing it once. - * This assignment must be done before the code below given that - * the znode may not exist anymore. - */ - saved_z_ref_cnt = zp->z_ref_cnt; - /* * This might want to be moved into a separate VOP_RECLAIM eventually. */ @@ -3791,16 +3780,7 @@ zfs_inactive(vnode_t *vp) zfs_zinactive(zp); rw_exit(&zfsvfs->z_teardown_inactive_lock); - /* - * The following clause checks for the existence of the znode object, - * if it no longer exists, then let's assign NULL to the v_data field - * of the vnode meaning that it is completely inactive from the zfs - * vnops perspective. - */ - if (--saved_z_ref_cnt == 0) { - vp->v_data = NULL; - } - + vp->v_data = NULL; return 0; } diff --git a/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c b/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c index a85c47bd90dfdd8e4fea8d6eebc4ad73682e42e0..21f38f29c670848d69be45569062f2472a06c02d 100644 --- a/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c +++ b/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c @@ -660,7 +660,6 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, zp->z_seq = 0x7A4653; zp->z_sync_cnt = 0; #ifdef __OSV__ - zp->z_vnode = NULL; zp->z_ref_cnt = 1; #endif diff --git a/fs/vfs/vfs_vnode.c b/fs/vfs/vfs_vnode.c index 6387297e38a3bed9e1ae5ef5d410df8605919c53..7e72aa9e05ecd265012a4090be403f8c7322bbea 100644 --- a/fs/vfs/vfs_vnode.c +++ b/fs/vfs/vfs_vnode.c @@ -270,14 +270,6 @@ vrele(struct vnode *vp) VNODE_LOCK(); DPRINTF(VFSDB_VNODE, ("vrele: ref=%d\n", vp->v_refcnt)); - - /* - * VOP_INACTIVE details: - * Used to release the refcnt of the fs specific vnode data. - * When the refcnt reaches 0, then VOP_INACTIVE itself would - * deallocate the data. - */ - VOP_INACTIVE(vp); vp->v_refcnt--; if (vp->v_refcnt > 0) { VNODE_UNLOCK(); @@ -286,6 +278,10 @@ vrele(struct vnode *vp) LIST_REMOVE(vp, v_link); VNODE_UNLOCK(); + /* + * Deallocate fs specific vnode data + */ + VOP_INACTIVE(vp); vfs_unbusy(vp->v_mount); mutex_destroy(&vp->v_lock); free(vp);