diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1997-11-06 05:59:40 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1997-11-06 05:59:40 +0000 |
commit | 4e165724f1631d1deee6fd89b941fabdbcc855d4 (patch) | |
tree | 3aca36af68e90377984b00e9f0050674b0763db5 /sys/miscfs/fifofs | |
parent | fec1be888534eb37405f6bf7a195f28670e1392b (diff) |
Updates for VFS Lite 2 + soft update.
Diffstat (limited to 'sys/miscfs/fifofs')
-rw-r--r-- | sys/miscfs/fifofs/fifo.h | 11 | ||||
-rw-r--r-- | sys/miscfs/fifofs/fifo_vnops.c | 59 |
2 files changed, 35 insertions, 35 deletions
diff --git a/sys/miscfs/fifofs/fifo.h b/sys/miscfs/fifofs/fifo.h index a8c3b7f4091..8a1f5ed33ba 100644 --- a/sys/miscfs/fifofs/fifo.h +++ b/sys/miscfs/fifofs/fifo.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo.h,v 1.4 1997/10/06 20:20:22 deraadt Exp $ */ +/* $OpenBSD: fifo.h,v 1.5 1997/11/06 05:58:33 csapuntz Exp $ */ /* $NetBSD: fifo.h,v 1.10 1996/02/09 22:40:15 christos Exp $ */ /* @@ -60,6 +60,7 @@ int fifo_select __P((void *)); #define fifo_fsync nullop #define fifo_seek fifo_badop #define fifo_remove fifo_badop +#define fifo_revoke vop_revoke #define fifo_link fifo_badop #define fifo_rename fifo_badop #define fifo_mkdir fifo_badop @@ -68,14 +69,14 @@ int fifo_select __P((void *)); #define fifo_readdir fifo_badop #define fifo_readlink fifo_badop #define fifo_abortop fifo_badop -#define fifo_inactive nullop +int fifo_inactive __P((void *)); #define fifo_reclaim nullop -int fifo_lock __P((void *)); -int fifo_unlock __P((void *)); +#define fifo_lock vop_nolock +#define fifo_unlock vop_nounlock int fifo_bmap __P((void *)); #define fifo_strategy fifo_badop int fifo_print __P((void *)); -#define fifo_islocked nullop +#define fifo_islocked vop_noislocked int fifo_pathconf __P((void *)); int fifo_advlock __P((void *)); #define fifo_blkatoff fifo_badop diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index 9b74f82384c..412f0bd6dc2 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.6 1997/10/06 20:20:23 deraadt Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.7 1997/11/06 05:58:34 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); } |