Call change_dir() instead of duplicating the code in fchdir().

This commit is contained in:
John Baldwin 2006-07-19 18:30:33 +00:00
parent b33887ea31
commit 2f198e899a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160507
2 changed files with 2 additions and 16 deletions

View File

@ -697,14 +697,7 @@ fchdir(td, uap)
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
AUDIT_ARG(vnode, vp, ARG_VNODE1);
if (vp->v_type != VDIR)
error = ENOTDIR;
#ifdef MAC
else if ((error = mac_check_vnode_chdir(td->td_ucred, vp)) != 0) {
}
#endif
else
error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td);
error = change_dir(vp, td);
while (!error && (mp = vp->v_mountedhere) != NULL) {
int tvfslocked;
if (vfs_busy(mp, 0, 0, td))

View File

@ -697,14 +697,7 @@ fchdir(td, uap)
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
AUDIT_ARG(vnode, vp, ARG_VNODE1);
if (vp->v_type != VDIR)
error = ENOTDIR;
#ifdef MAC
else if ((error = mac_check_vnode_chdir(td->td_ucred, vp)) != 0) {
}
#endif
else
error = VOP_ACCESS(vp, VEXEC, td->td_ucred, td);
error = change_dir(vp, td);
while (!error && (mp = vp->v_mountedhere) != NULL) {
int tvfslocked;
if (vfs_busy(mp, 0, 0, td))