From 85674180ac0b414993bec634994ea51b28390306 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 6 Oct 1997 20:23:17 +0000 Subject: back out vfs lite2 till after 2.2 --- sys/dev/ccd.c | 10 +++++----- sys/dev/vnd.c | 20 +++++++++----------- 2 files changed, 14 insertions(+), 16 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c index 044a88194df..e8b8ed87897 100644 --- a/sys/dev/ccd.c +++ b/sys/dev/ccd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ccd.c,v 1.18 1997/10/06 15:07:46 csapuntz Exp $ */ +/* $OpenBSD: ccd.c,v 1.19 1997/10/06 20:19:39 deraadt Exp $ */ /* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */ /*- @@ -1326,7 +1326,7 @@ ccdlookup(path, p, vpp) vp = nd.ni_vp; if (vp->v_usecount > 1) { - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp); (void)vn_close(vp, FREAD|FWRITE, p->p_ucred, p); return (EBUSY); } @@ -1336,14 +1336,14 @@ ccdlookup(path, p, vpp) if (ccddebug & (CCDB_FOLLOW|CCDB_INIT)) printf("ccdlookup: getattr error = %d\n", error); #endif - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp); (void)vn_close(vp, FREAD|FWRITE, p->p_ucred, p); return (error); } /* XXX: eventually we should handle VREG, too. */ if (va.va_type != VBLK) { - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp); (void)vn_close(vp, FREAD|FWRITE, p->p_ucred, p); return (ENOTBLK); } @@ -1353,7 +1353,7 @@ ccdlookup(path, p, vpp) vprint("ccdlookup: vnode info", vp); #endif - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp); *vpp = vp; return (0); } 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); -- cgit v1.2.3