diff options
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 23 | ||||
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c | 7 |
2 files changed, 7 insertions, 23 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index 17c702a..aad7a12 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -5976,26 +5976,17 @@ zfs_lock(ap) int line; } */ *ap; { - zfsvfs_t *zfsvfs; - znode_t *zp; vnode_t *vp; - int flags; + znode_t *zp; int err; - vp = ap->a_vp; - flags = ap->a_flags; - if ((flags & LK_INTERLOCK) == 0 && (flags & LK_NOWAIT) == 0 && - (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL && - (zp->z_pflags & ZFS_XATTR) == 0) { - zfsvfs = zp->z_zfsvfs; - VERIFY(!RRM_LOCK_HELD(&zfsvfs->z_teardown_lock)); - } err = vop_stdlock(ap); - if ((flags & LK_INTERLOCK) != 0 && (flags & LK_NOWAIT) == 0 && - (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL && - (zp->z_pflags & ZFS_XATTR) == 0) { - zfsvfs = zp->z_zfsvfs; - VERIFY(!RRM_LOCK_HELD(&zfsvfs->z_teardown_lock)); + if (err == 0 && (ap->a_flags & LK_NOWAIT) == 0) { + vp = ap->a_vp; + zp = vp->v_data; + if (vp->v_mount != NULL && (vp->v_iflag & VI_DOOMED) == 0 && + zp != NULL && (zp->z_pflags & ZFS_XATTR) == 0) + VERIFY(!RRM_LOCK_HELD(&zp->z_zfsvfs->z_teardown_lock)); } return (err); } diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c index 224e829..1ad0d83 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c @@ -727,14 +727,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz, /* * Acquire vnode lock before making it available to the world. */ -#ifdef DIAGNOSTIC - vop_lock1_t *orig_lock = vp->v_op->vop_lock1; - vp->v_op->vop_lock1 = vop_stdlock; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - vp->v_op->vop_lock1 = orig_lock; -#else - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); -#endif VN_LOCK_AREC(vp); if (vp->v_type != VFIFO) VN_LOCK_ASHARE(vp); |