diff options
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r-- | sys/dev/vnd.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index 715a508aa55..63acb349858 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vnd.c,v 1.17 1997/10/06 15:07:48 csapuntz Exp $ */ +/* $OpenBSD: vnd.c,v 1.18 1997/10/06 20:19:40 deraadt Exp $ */ /* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */ /* @@ -369,7 +369,6 @@ vndstrategy(bp) int sz, flags, error, s; struct iovec aiov; struct uio auio; - struct proc *p = curproc; #ifdef DEBUG if (vnddebug & VDB_FOLLOW) @@ -432,7 +431,7 @@ vndstrategy(bp) auio.uio_segflg = UIO_SYSSPACE; auio.uio_procp = NULL; - vn_lock(vnd->sc_vp, LK_EXCLUSIVE | LK_RETRY, p); + VOP_LOCK(vnd->sc_vp); vnd->sc_flags |= VNF_BUSY; if (bp->b_flags & B_READ) { auio.uio_rw = UIO_READ; @@ -444,7 +443,7 @@ vndstrategy(bp) vnd->sc_cred); } vnd->sc_flags &= ~VNF_BUSY; - VOP_UNLOCK(vnd->sc_vp, 0, p); + VOP_UNLOCK(vnd->sc_vp); if (bp->b_error) bp->b_flags |= B_ERROR; bp->b_resid = auio.uio_resid; @@ -478,9 +477,9 @@ vndstrategy(bp) int off, s, nra; nra = 0; - vn_lock(vnd->sc_vp, LK_RETRY | LK_EXCLUSIVE, p); + VOP_LOCK(vnd->sc_vp); error = VOP_BMAP(vnd->sc_vp, bn / bsize, &vp, &nbn, &nra); - VOP_UNLOCK(vnd->sc_vp, 0, p); + VOP_UNLOCK(vnd->sc_vp); if (error == 0 && (long)nbn == -1) error = EIO; #ifdef DEBUG @@ -733,12 +732,12 @@ vndioctl(dev, cmd, addr, flag, p) } error = VOP_GETATTR(nd.ni_vp, &vattr, p->p_ucred, p); if (error) { - VOP_UNLOCK(nd.ni_vp, 0, p); + VOP_UNLOCK(nd.ni_vp); (void) vn_close(nd.ni_vp, FREAD|FWRITE, p->p_ucred, p); vndunlock(vnd); return(error); } - VOP_UNLOCK(nd.ni_vp, 0, p); + VOP_UNLOCK(nd.ni_vp); vnd->sc_vp = nd.ni_vp; vnd->sc_size = btodb(vattr.va_size); /* note truncation */ if ((error = vndsetcred(vnd, p->p_ucred)) != 0) { @@ -875,7 +874,6 @@ vndsetcred(vnd, cred) struct iovec aiov; char *tmpbuf; int error; - struct proc *p = curproc; vnd->sc_cred = crdup(cred); tmpbuf = malloc(DEV_BSIZE, M_TEMP, M_WAITOK); @@ -889,9 +887,9 @@ vndsetcred(vnd, cred) auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; auio.uio_resid = aiov.iov_len; - vn_lock(vnd->sc_vp, LK_RETRY | LK_EXCLUSIVE, p); + VOP_LOCK(vnd->sc_vp); error = VOP_READ(vnd->sc_vp, &auio, 0, vnd->sc_cred); - VOP_UNLOCK(vnd->sc_vp, 0, p); + VOP_UNLOCK(vnd->sc_vp); free(tmpbuf, M_TEMP); return (error); |