summaryrefslogtreecommitdiff
path: root/sys/miscfs/fifofs/fifo_vnops.c
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1997-10-06 15:19:19 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1997-10-06 15:19:19 +0000
commitba753b42bdeef75b997ea377a0fc9217fbd5ab67 (patch)
tree819e678f4385a925ffd8437c8e2ffbc74951134e /sys/miscfs/fifofs/fifo_vnops.c
parent97c5ddeb58fe74c2ee3670b3c129249a2de4775e (diff)
VFS Lite2 Changes
Diffstat (limited to 'sys/miscfs/fifofs/fifo_vnops.c')
-rw-r--r--sys/miscfs/fifofs/fifo_vnops.c59
1 files changed, 29 insertions, 30 deletions
diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c
index 8b45763c8c3..e3fd6689055 100644
--- a/sys/miscfs/fifofs/fifo_vnops.c
+++ b/sys/miscfs/fifofs/fifo_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fifo_vnops.c,v 1.4 1996/11/04 03:31:54 tholo Exp $ */
+/* $OpenBSD: fifo_vnops.c,v 1.5 1997/10/06 15:19:03 csapuntz Exp $ */
/* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */
/*
@@ -38,13 +38,13 @@
#include <sys/param.h>
#include <sys/proc.h>
+#include <sys/systm.h>
#include <sys/time.h>
#include <sys/namei.h>
#include <sys/vnode.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/stat.h>
-#include <sys/systm.h>
#include <sys/ioctl.h>
#include <sys/file.h>
#include <sys/errno.h>
@@ -79,6 +79,7 @@ struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
{ &vop_lease_desc, fifo_lease_check }, /* lease */
{ &vop_ioctl_desc, fifo_ioctl }, /* ioctl */
{ &vop_select_desc, fifo_select }, /* select */
+ { &vop_revoke_desc, fifo_revoke }, /* revoke */
{ &vop_mmap_desc, fifo_mmap }, /* mmap */
{ &vop_fsync_desc, fifo_fsync }, /* fsync */
{ &vop_seek_desc, fifo_seek }, /* seek */
@@ -147,6 +148,7 @@ fifo_open(v)
} */ *ap = v;
register struct vnode *vp = ap->a_vp;
register struct fifoinfo *fip;
+ struct proc *p = ap->a_p;
struct socket *rso, *wso;
int error;
static char openstr[] = "fifo";
@@ -196,10 +198,10 @@ fifo_open(v)
if (ap->a_mode & O_NONBLOCK) {
} else {
while (fip->fi_writers == 0) {
- VOP_UNLOCK(vp);
+ VOP_UNLOCK(vp, 0, p);
error = tsleep((caddr_t)&fip->fi_readers,
PCATCH | PSOCK, openstr, 0);
- VOP_LOCK(vp);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
if (error)
goto bad;
}
@@ -213,10 +215,10 @@ fifo_open(v)
}
} else {
while (fip->fi_readers == 0) {
- VOP_UNLOCK(vp);
+ VOP_UNLOCK(vp, 0, p);
error = tsleep((caddr_t)&fip->fi_writers,
PCATCH | PSOCK, openstr, 0);
- VOP_LOCK(vp);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
if (error)
goto bad;
}
@@ -244,6 +246,7 @@ fifo_read(v)
} */ *ap = v;
register struct uio *uio = ap->a_uio;
register struct socket *rso = ap->a_vp->v_fifoinfo->fi_readsock;
+ struct proc *p = uio->uio_procp;
int error, startresid;
#ifdef DIAGNOSTIC
@@ -255,10 +258,10 @@ fifo_read(v)
if (ap->a_ioflag & IO_NDELAY)
rso->so_state |= SS_NBIO;
startresid = uio->uio_resid;
- VOP_UNLOCK(ap->a_vp);
+ VOP_UNLOCK(ap->a_vp, 0, p);
error = soreceive(rso, (struct mbuf **)0, uio, (struct mbuf **)0,
(struct mbuf **)0, (int *)0);
- VOP_LOCK(ap->a_vp);
+ vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, p);
/*
* Clear EOF indication after first such return.
*/
@@ -287,6 +290,7 @@ fifo_write(v)
struct ucred *a_cred;
} */ *ap = v;
struct socket *wso = ap->a_vp->v_fifoinfo->fi_writesock;
+ struct proc *p = ap->a_uio->uio_procp;
int error;
#ifdef DIAGNOSTIC
@@ -295,9 +299,9 @@ fifo_write(v)
#endif
if (ap->a_ioflag & IO_NDELAY)
wso->so_state |= SS_NBIO;
- VOP_UNLOCK(ap->a_vp);
+ VOP_UNLOCK(ap->a_vp, 0, p);
error = sosend(wso, (struct mbuf *)0, ap->a_uio, 0, (struct mbuf *)0, 0);
- VOP_LOCK(ap->a_vp);
+ vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, p);
if (ap->a_ioflag & IO_NDELAY)
wso->so_state &= ~SS_NBIO;
return (error);
@@ -369,6 +373,19 @@ fifo_select(v)
return (0);
}
+int
+fifo_inactive(v)
+ void *v;
+{
+ struct vop_inactive_args /* {
+ struct vnode *a_vp;
+ struct proc *a_p;
+ } */ *ap = v;
+
+ VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
+ return (0);
+}
+
/*
* This is a noop, simply returning what one has been given.
*/
@@ -381,6 +398,7 @@ fifo_bmap(v)
daddr_t a_bn;
struct vnode **a_vpp;
daddr_t *a_bnp;
+ int *a_runp;
} */ *ap = v;
if (ap->a_vpp != NULL)
@@ -391,26 +409,6 @@ fifo_bmap(v)
}
/*
- * At the moment we do not do any locking.
- */
-/* ARGSUSED */
-int
-fifo_lock(v)
- void *v;
-{
- return (0);
-}
-
-/* ARGSUSED */
-int
-fifo_unlock(v)
- void *v;
-{
-
- return (0);
-}
-
-/*
* Device close routine
*/
/* ARGSUSED */
@@ -540,4 +538,5 @@ fifo_badop(v)
panic("fifo_badop called");
/* NOTREACHED */
+ return(0);
}