diff options
author | kib <kib@FreeBSD.org> | 2007-05-31 11:51:53 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2007-05-31 11:51:53 +0000 |
commit | f13486a2227b9165fce30aa40d12b728f327a909 (patch) | |
tree | d5e88e86417c996e0e901ce9a43de8d9ae3ad44e /sys/fs/fifofs | |
parent | 7f276f0bff169823b786ea0a9bbdfe936361fcb4 (diff) | |
download | FreeBSD-src-f13486a2227b9165fce30aa40d12b728f327a909.zip FreeBSD-src-f13486a2227b9165fce30aa40d12b728f327a909.tar.gz |
Revert UF_OPENING workaround for CURRENT.
Change the VOP_OPEN(), vn_open() vnode operation and d_fdopen() cdev operation
argument from being file descriptor index into the pointer to struct file.
Proposed and reviewed by: jhb
Reviewed by: daichi (unionfs)
Approved by: re (kensmith)
Diffstat (limited to 'sys/fs/fifofs')
-rw-r--r-- | sys/fs/fifofs/fifo_vnops.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index 0c13c46..7161591 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -175,12 +175,12 @@ fifo_open(ap) struct fifoinfo *fip; struct thread *td = ap->a_td; struct ucred *cred = ap->a_cred; + struct file *fp = ap->a_fp; struct socket *rso, *wso; - struct file *fp; int error; ASSERT_VOP_LOCKED(vp, "fifo_open"); - if (ap->a_fdidx < 0) + if (fp == NULL) return (EINVAL); if ((fip = vp->v_fifoinfo) == NULL) { MALLOC(fip, struct fifoinfo *, sizeof(*fip), M_VNODE, M_WAITOK); @@ -293,8 +293,7 @@ fail1: } } mtx_unlock(&fifo_mtx); - KASSERT(ap->a_fdidx >= 0, ("can't fifo/vnode bypass %d", ap->a_fdidx)); - fp = ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx]; + KASSERT(fp != NULL, ("can't fifo/vnode bypass")); FILE_LOCK(fp); KASSERT(fp->f_ops == &badfileops, ("not badfileops in fifo_open")); fp->f_data = fip; |