diff options
Diffstat (limited to 'sys/compat/svr4/svr4_misc.c')
-rw-r--r-- | sys/compat/svr4/svr4_misc.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 8456e10..d6bc4eb 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -241,7 +241,7 @@ svr4_sys_getdents64(td, uap) struct iovec aiov; off_t off; struct svr4_dirent64 svr4_dirent; - int buflen, error, eofflag, nbytes, justone, vfslocked; + int buflen, error, eofflag, nbytes, justone; u_long *cookies = NULL, *cookiep; int ncookies; @@ -258,9 +258,7 @@ svr4_sys_getdents64(td, uap) } vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (EINVAL); } @@ -397,7 +395,6 @@ eof: td->td_retval[0] = nbytes - resid; out: VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); if (cookies) free(cookies, M_TEMP); @@ -422,7 +419,7 @@ svr4_sys_getdents(td, uap) struct iovec aiov; struct svr4_dirent idb; off_t off; /* true file offset */ - int buflen, error, eofflag, vfslocked; + int buflen, error, eofflag; u_long *cookiebuf = NULL, *cookie; int ncookies = 0, *retval = td->td_retval; @@ -439,9 +436,7 @@ svr4_sys_getdents(td, uap) } vp = fp->f_vnode; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type != VDIR) { - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); return (EINVAL); } @@ -534,7 +529,6 @@ eof: *retval = uap->nbytes - resid; out: VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); fdrop(fp, td); if (cookiebuf) free(cookiebuf, M_TEMP); @@ -614,7 +608,7 @@ svr4_sys_fchroot(td, uap) struct filedesc *fdp = td->td_proc->p_fd; struct vnode *vp; struct file *fp; - int error, vfslocked; + int error; if ((error = priv_check(td, PRIV_VFS_FCHROOT)) != 0) return error; @@ -624,7 +618,6 @@ svr4_sys_fchroot(td, uap) vp = fp->f_vnode; VREF(vp); fdrop(fp, td); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = change_dir(vp, td); if (error) @@ -637,11 +630,9 @@ svr4_sys_fchroot(td, uap) VOP_UNLOCK(vp, 0); error = change_root(vp, td); vrele(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); fail: vput(vp); - VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1652,13 +1643,12 @@ svr4_sys_resolvepath(td, uap) int error, *retval = td->td_retval; unsigned int ncopy; - NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME | MPSAFE, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_NO_FREE_PNBUF); - VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); ncopy = min(uap->bufsiz, strlen(nd.ni_cnd.cn_pnbuf) + 1); if ((error = copyout(nd.ni_cnd.cn_pnbuf, uap->buf, ncopy)) != 0) |