- Lock vnode with flags passed in as argument in zfs_vget() and zfs_root().

Pointed out by:	ups
  Also reported by:	kris

- Add comments where I'm not sure if LK_RETRY should be used.
This commit is contained in:
Pawel Jakub Dawidek 2007-05-02 00:09:34 +00:00
parent e6d0ea1022
commit 6de6bff649
2 changed files with 8 additions and 4 deletions

View File

@ -666,7 +666,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp, kthread_t *td)
error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp);
if (error == 0) {
*vpp = ZTOV(rootzp);
error = vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td);
error = vn_lock(*vpp, flags, td);
(*vpp)->v_vflag |= VV_ROOT;
}
@ -766,7 +766,7 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int flags, vnode_t **vpp)
*vpp = NULL;
else {
*vpp = ZTOV(zp);
vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread);
vn_lock(*vpp, flags, curthread);
}
ZFS_EXIT(zfsvfs);
return (0);
@ -832,6 +832,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp)
VN_HOLD(*vpp);
}
ZFS_EXIT(zfsvfs);
/* XXX: LK_RETRY? */
vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td);
return (0);
}
@ -854,6 +855,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp)
}
*vpp = ZTOV(zp);
/* XXX: LK_RETRY? */
vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td);
vnode_create_vobject(*vpp, zp->z_phys->zp_size, td);
ZFS_EXIT(zfsvfs);

View File

@ -666,7 +666,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp, kthread_t *td)
error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp);
if (error == 0) {
*vpp = ZTOV(rootzp);
error = vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td);
error = vn_lock(*vpp, flags, td);
(*vpp)->v_vflag |= VV_ROOT;
}
@ -766,7 +766,7 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int flags, vnode_t **vpp)
*vpp = NULL;
else {
*vpp = ZTOV(zp);
vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread);
vn_lock(*vpp, flags, curthread);
}
ZFS_EXIT(zfsvfs);
return (0);
@ -832,6 +832,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp)
VN_HOLD(*vpp);
}
ZFS_EXIT(zfsvfs);
/* XXX: LK_RETRY? */
vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td);
return (0);
}
@ -854,6 +855,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp)
}
*vpp = ZTOV(zp);
/* XXX: LK_RETRY? */
vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td);
vnode_create_vobject(*vpp, zp->z_phys->zp_size, td);
ZFS_EXIT(zfsvfs);