Author: avg
Date: Wed Sep 13 07:09:58 2017
New Revision: 323522
URL: https://svnweb.freebsd.org/changeset/base/323522

Log:
  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

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c     Wed Sep 
13 06:57:52 2017        (r323521)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c     Wed Sep 
13 07:09:58 2017        (r323522)
@@ -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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to