summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2007-05-31 11:51:53 +0000
committerkib <kib@FreeBSD.org>2007-05-31 11:51:53 +0000
commitf13486a2227b9165fce30aa40d12b728f327a909 (patch)
treed5e88e86417c996e0e901ce9a43de8d9ae3ad44e /sys/fs/devfs
parent7f276f0bff169823b786ea0a9bbdfe936361fcb4 (diff)
downloadFreeBSD-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/devfs')
-rw-r--r--sys/fs/devfs/devfs_vnops.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index 4f7cda2..d6c3232 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -734,7 +734,7 @@ devfs_open(struct vop_open_args *ap)
struct thread *td = ap->a_td;
struct vnode *vp = ap->a_vp;
struct cdev *dev = vp->v_rdev;
- struct file *fp;
+ struct file *fp = ap->a_fp;
int error;
struct cdevsw *dsw;
@@ -761,13 +761,13 @@ devfs_open(struct vop_open_args *ap)
if(!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
if (dsw->d_fdopen != NULL)
- error = dsw->d_fdopen(dev, ap->a_mode, td, ap->a_fdidx);
+ error = dsw->d_fdopen(dev, ap->a_mode, td, fp);
else
error = dsw->d_open(dev, ap->a_mode, S_IFCHR, td);
PICKUP_GIANT();
} else {
if (dsw->d_fdopen != NULL)
- error = dsw->d_fdopen(dev, ap->a_mode, td, ap->a_fdidx);
+ error = dsw->d_fdopen(dev, ap->a_mode, td, fp);
else
error = dsw->d_open(dev, ap->a_mode, S_IFCHR, td);
}
@@ -780,19 +780,12 @@ devfs_open(struct vop_open_args *ap)
return (error);
#if 0 /* /dev/console */
- KASSERT(ap->a_fdidx >= 0,
- ("Could not vnode bypass device on fd %d", ap->a_fdidx));
+ KASSERT(fp != NULL,
+ ("Could not vnode bypass device on NULL fp"));
#else
- if(ap->a_fdidx < 0)
+ if(fp == NULL)
return (error);
#endif
- /*
- * This is a pretty disgustingly long chain, but I am not
- * sure there is any better way. Passing the fdidx into
- * VOP_OPEN() offers us more information than just passing
- * the file *.
- */
- fp = ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx];
FILE_LOCK(fp);
KASSERT(fp->f_ops == &badfileops,
("Could not vnode bypass device on fdops %p", fp->f_ops));
OpenPOWER on IntegriCloud