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
This commit is contained in:
Andriy Gapon 2017-09-13 07:09:58 +00:00
parent 83f60cb202
commit 86261a95ed

View File

@ -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;