From 86261a95ed3170214901a4cd93da5405c6cf080e Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Wed, 13 Sep 2017 07:09:58 +0000 Subject: [PATCH] slightly simplify zfs_vptocnp It's not necessary to look up the parent's ID to check if the node is the root node of the filesystem. MFC after: 2 weeks --- .../contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 9 +-------- 1 file changed, 1 insertion(+), 8 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 1dfe1cf4d74..05d79c2fa91 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 @@ -5925,7 +5925,6 @@ zfs_vptocnp(struct vop_vptocnp_args *ap) vnode_t *vp = ap->a_vp;; zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data; znode_t *zp = VTOZ(vp); - uint64_t parent; int ltype; int error; @@ -5936,13 +5935,7 @@ zfs_vptocnp(struct vop_vptocnp_args *ap) * If we are a snapshot mounted under .zfs, run the operation * on the covered vnode. */ - if ((error = sa_lookup(zp->z_sa_hdl, - SA_ZPL_PARENT(zfsvfs), &parent, sizeof (parent))) != 0) { - ZFS_EXIT(zfsvfs); - return (error); - } - - if (zp->z_id != parent || zfsvfs->z_parent == zfsvfs) { + if (zp->z_id != zfsvfs->z_root || zfsvfs->z_parent == zfsvfs) { char name[MAXNAMLEN + 1]; znode_t *dzp; size_t len;