summaryrefslogtreecommitdiffstats
path: root/sys/fs/fifofs/fifo_vnops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/fifofs/fifo_vnops.c')
-rw-r--r--sys/fs/fifofs/fifo_vnops.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c
index 5fadba2..baddfa4 100644
--- a/sys/fs/fifofs/fifo_vnops.c
+++ b/sys/fs/fifofs/fifo_vnops.c
@@ -41,6 +41,7 @@
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/vnode.h>
+#include <sys/proc.h> /* XXXKSE */
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/filio.h>
@@ -161,26 +162,26 @@ fifo_open(ap)
struct vnode *a_vp;
int a_mode;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
struct fifoinfo *fip;
- struct proc *p = ap->a_p;
+ struct thread *td = ap->a_td;
struct socket *rso, *wso;
int error;
if ((fip = vp->v_fifoinfo) == NULL) {
MALLOC(fip, struct fifoinfo *, sizeof(*fip), M_VNODE, M_WAITOK);
vp->v_fifoinfo = fip;
- error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0, ap->a_p);
+ error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0, ap->a_td);
if (error) {
free(fip, M_VNODE);
vp->v_fifoinfo = NULL;
return (error);
}
fip->fi_readsock = rso;
- error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0, ap->a_p);
+ error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0, ap->a_td);
if (error) {
(void)soclose(rso);
free(fip, M_VNODE);
@@ -222,10 +223,10 @@ fifo_open(ap)
}
if ((ap->a_mode & FREAD) && (ap->a_mode & O_NONBLOCK) == 0) {
while (fip->fi_writers == 0) {
- VOP_UNLOCK(vp, 0, p);
+ VOP_UNLOCK(vp, 0, td);
error = tsleep((caddr_t)&fip->fi_readers,
PCATCH | PSOCK, "fifoor", 0);
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
if (error)
goto bad;
}
@@ -238,10 +239,10 @@ fifo_open(ap)
}
} else {
while (fip->fi_readers == 0) {
- VOP_UNLOCK(vp, 0, p);
+ VOP_UNLOCK(vp, 0, td);
error = tsleep((caddr_t)&fip->fi_writers,
PCATCH | PSOCK, "fifoow", 0);
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
if (error)
goto bad;
}
@@ -249,7 +250,7 @@ fifo_open(ap)
}
return (0);
bad:
- VOP_CLOSE(vp, ap->a_mode, ap->a_cred, p);
+ VOP_CLOSE(vp, ap->a_mode, ap->a_cred, td);
return (error);
}
@@ -268,7 +269,7 @@ fifo_read(ap)
{
struct uio *uio = ap->a_uio;
struct socket *rso = ap->a_vp->v_fifoinfo->fi_readsock;
- struct proc *p = uio->uio_procp;
+ struct thread *td = uio->uio_td;
int error, startresid;
#ifdef DIAGNOSTIC
@@ -280,10 +281,10 @@ fifo_read(ap)
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, 0, td);
error = soreceive(rso, (struct sockaddr **)0, uio, (struct mbuf **)0,
(struct mbuf **)0, (int *)0);
- vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, td);
if (ap->a_ioflag & IO_NDELAY)
rso->so_state &= ~SS_NBIO;
return (error);
@@ -303,7 +304,7 @@ fifo_write(ap)
} */ *ap;
{
struct socket *wso = ap->a_vp->v_fifoinfo->fi_writesock;
- struct proc *p = ap->a_uio->uio_procp;
+ struct thread *td = ap->a_uio->uio_td;
int error;
#ifdef DIAGNOSTIC
@@ -312,10 +313,10 @@ fifo_write(ap)
#endif
if (ap->a_ioflag & IO_NDELAY)
wso->so_state |= SS_NBIO;
- VOP_UNLOCK(ap->a_vp, 0, p);
+ VOP_UNLOCK(ap->a_vp, 0, td);
error = sosend(wso, (struct sockaddr *)0, ap->a_uio, 0,
- (struct mbuf *)0, 0, p);
- vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, p);
+ (struct mbuf *)0, 0, td);
+ vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, td);
if (ap->a_ioflag & IO_NDELAY)
wso->so_state &= ~SS_NBIO;
return (error);
@@ -333,7 +334,7 @@ fifo_ioctl(ap)
caddr_t a_data;
int a_fflag;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
struct file filetmp;
@@ -343,13 +344,13 @@ fifo_ioctl(ap)
return (0);
if (ap->a_fflag & FREAD) {
filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_readsock;
- error = soo_ioctl(&filetmp, ap->a_command, ap->a_data, ap->a_p);
+ error = soo_ioctl(&filetmp, ap->a_command, ap->a_data, ap->a_td);
if (error)
return (error);
}
if (ap->a_fflag & FWRITE) {
filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_writesock;
- error = soo_ioctl(&filetmp, ap->a_command, ap->a_data, ap->a_p);
+ error = soo_ioctl(&filetmp, ap->a_command, ap->a_data, ap->a_td);
if (error)
return (error);
}
@@ -446,7 +447,7 @@ fifo_poll(ap)
struct vnode *a_vp;
int a_events;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
struct file filetmp;
@@ -456,13 +457,13 @@ fifo_poll(ap)
filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_readsock;
if (filetmp.f_data)
revents |= soo_poll(&filetmp, ap->a_events, ap->a_cred,
- ap->a_p);
+ ap->a_td);
}
if (ap->a_events & (POLLOUT | POLLWRNORM | POLLWRBAND)) {
filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_writesock;
if (filetmp.f_data)
revents |= soo_poll(&filetmp, ap->a_events, ap->a_cred,
- ap->a_p);
+ ap->a_td);
}
return (revents);
}
@@ -477,7 +478,7 @@ fifo_close(ap)
struct vnode *a_vp;
int a_fflag;
struct ucred *a_cred;
- struct proc *a_p;
+ struct thread *a_td;
} */ *ap;
{
register struct vnode *vp = ap->a_vp;
OpenPOWER on IntegriCloud