summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1997-10-06 15:08:48 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1997-10-06 15:08:48 +0000
commit486c8e78cbcef0d475b10f58a45c8977765ead46 (patch)
treea4ca5659a570c2e513cd1ae483effe8442c72fdb /sys/dev
parent9edf2581c6553b9af6c80d28f1027b44776020d3 (diff)
VFS Lite2 Changes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ccd.c10
-rw-r--r--sys/dev/vnd.c20
2 files changed, 16 insertions, 14 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index 1049486f517..044a88194df 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccd.c,v 1.17 1997/08/08 21:47:01 niklas Exp $ */
+/* $OpenBSD: ccd.c,v 1.18 1997/10/06 15:07:46 csapuntz 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);
+ VOP_UNLOCK(vp, 0, p);
(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);
+ VOP_UNLOCK(vp, 0, p);
(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);
+ VOP_UNLOCK(vp, 0, p);
(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);
+ VOP_UNLOCK(vp, 0, p);
*vpp = vp;
return (0);
}
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index f87a7e8b182..715a508aa55 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.16 1997/08/08 21:47:01 niklas Exp $ */
+/* $OpenBSD: vnd.c,v 1.17 1997/10/06 15:07:48 csapuntz Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -369,6 +369,7 @@ vndstrategy(bp)
int sz, flags, error, s;
struct iovec aiov;
struct uio auio;
+ struct proc *p = curproc;
#ifdef DEBUG
if (vnddebug & VDB_FOLLOW)
@@ -431,7 +432,7 @@ vndstrategy(bp)
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_procp = NULL;
- VOP_LOCK(vnd->sc_vp);
+ vn_lock(vnd->sc_vp, LK_EXCLUSIVE | LK_RETRY, p);
vnd->sc_flags |= VNF_BUSY;
if (bp->b_flags & B_READ) {
auio.uio_rw = UIO_READ;
@@ -443,7 +444,7 @@ vndstrategy(bp)
vnd->sc_cred);
}
vnd->sc_flags &= ~VNF_BUSY;
- VOP_UNLOCK(vnd->sc_vp);
+ VOP_UNLOCK(vnd->sc_vp, 0, p);
if (bp->b_error)
bp->b_flags |= B_ERROR;
bp->b_resid = auio.uio_resid;
@@ -477,9 +478,9 @@ vndstrategy(bp)
int off, s, nra;
nra = 0;
- VOP_LOCK(vnd->sc_vp);
+ vn_lock(vnd->sc_vp, LK_RETRY | LK_EXCLUSIVE, p);
error = VOP_BMAP(vnd->sc_vp, bn / bsize, &vp, &nbn, &nra);
- VOP_UNLOCK(vnd->sc_vp);
+ VOP_UNLOCK(vnd->sc_vp, 0, p);
if (error == 0 && (long)nbn == -1)
error = EIO;
#ifdef DEBUG
@@ -732,12 +733,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);
+ VOP_UNLOCK(nd.ni_vp, 0, p);
(void) vn_close(nd.ni_vp, FREAD|FWRITE, p->p_ucred, p);
vndunlock(vnd);
return(error);
}
- VOP_UNLOCK(nd.ni_vp);
+ VOP_UNLOCK(nd.ni_vp, 0, p);
vnd->sc_vp = nd.ni_vp;
vnd->sc_size = btodb(vattr.va_size); /* note truncation */
if ((error = vndsetcred(vnd, p->p_ucred)) != 0) {
@@ -874,6 +875,7 @@ 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);
@@ -887,9 +889,9 @@ vndsetcred(vnd, cred)
auio.uio_rw = UIO_READ;
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_resid = aiov.iov_len;
- VOP_LOCK(vnd->sc_vp);
+ vn_lock(vnd->sc_vp, LK_RETRY | LK_EXCLUSIVE, p);
error = VOP_READ(vnd->sc_vp, &auio, 0, vnd->sc_cred);
- VOP_UNLOCK(vnd->sc_vp);
+ VOP_UNLOCK(vnd->sc_vp, 0, p);
free(tmpbuf, M_TEMP);
return (error);