diff options
Diffstat (limited to 'sys/miscfs/fifofs/fifo_vnops.c')
-rw-r--r-- | sys/miscfs/fifofs/fifo_vnops.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index e3fd6689055..9b74f82384c 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.5 1997/10/06 15:19:03 csapuntz Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.6 1997/10/06 20:20:23 deraadt 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,7 +79,6 @@ 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 */ @@ -148,7 +147,6 @@ 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"; @@ -198,10 +196,10 @@ fifo_open(v) if (ap->a_mode & O_NONBLOCK) { } else { while (fip->fi_writers == 0) { - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp); error = tsleep((caddr_t)&fip->fi_readers, PCATCH | PSOCK, openstr, 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); + VOP_LOCK(vp); if (error) goto bad; } @@ -215,10 +213,10 @@ fifo_open(v) } } else { while (fip->fi_readers == 0) { - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp); error = tsleep((caddr_t)&fip->fi_writers, PCATCH | PSOCK, openstr, 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); + VOP_LOCK(vp); if (error) goto bad; } @@ -246,7 +244,6 @@ 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 @@ -258,10 +255,10 @@ fifo_read(v) if (ap->a_ioflag & IO_NDELAY) rso->so_state |= SS_NBIO; startresid = uio->uio_resid; - VOP_UNLOCK(ap->a_vp, 0, p); + VOP_UNLOCK(ap->a_vp); error = soreceive(rso, (struct mbuf **)0, uio, (struct mbuf **)0, (struct mbuf **)0, (int *)0); - vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, p); + VOP_LOCK(ap->a_vp); /* * Clear EOF indication after first such return. */ @@ -290,7 +287,6 @@ 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 @@ -299,9 +295,9 @@ fifo_write(v) #endif if (ap->a_ioflag & IO_NDELAY) wso->so_state |= SS_NBIO; - VOP_UNLOCK(ap->a_vp, 0, p); + VOP_UNLOCK(ap->a_vp); error = sosend(wso, (struct mbuf *)0, ap->a_uio, 0, (struct mbuf *)0, 0); - vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, p); + VOP_LOCK(ap->a_vp); if (ap->a_ioflag & IO_NDELAY) wso->so_state &= ~SS_NBIO; return (error); @@ -373,19 +369,6 @@ 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. */ @@ -398,7 +381,6 @@ 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) @@ -409,6 +391,26 @@ 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 */ @@ -538,5 +540,4 @@ fifo_badop(v) panic("fifo_badop called"); /* NOTREACHED */ - return(0); } |