diff options
author | jhb <jhb@FreeBSD.org> | 2008-05-07 19:03:57 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-05-07 19:03:57 +0000 |
commit | fc9a5d3fa5acdeb7e3100c55ce82eea0ebcff097 (patch) | |
tree | 74974eca6b1a1e4d48bf5edf6b205a3e2caf25e0 | |
parent | d67ee9e0f3caddf223f82d077e1f382d13377e1f (diff) | |
download | FreeBSD-src-fc9a5d3fa5acdeb7e3100c55ce82eea0ebcff097.zip FreeBSD-src-fc9a5d3fa5acdeb7e3100c55ce82eea0ebcff097.tar.gz |
Don't explicitly drop Giant around d_open/d_fdopen/d_close for MPSAFE
drivers. Since devfs is already marked MPSAFE it shouldn't be held
anyway.
MFC after: 2 weeks
Discussed with: phk
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 3422986..21d8ba9 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -364,13 +364,7 @@ devfs_close(struct vop_close_args *ap) VOP_UNLOCK(vp, 0); KASSERT(dev->si_refcount > 0, ("devfs_close() on un-referenced struct cdev *(%s)", devtoname(dev))); - if (!(dsw->d_flags & D_NEEDGIANT)) { - DROP_GIANT(); - error = dsw->d_close(dev, ap->a_fflag, S_IFCHR, td); - PICKUP_GIANT(); - } else { - error = dsw->d_close(dev, ap->a_fflag, S_IFCHR, td); - } + error = dsw->d_close(dev, ap->a_fflag, S_IFCHR, td); dev_relthread(dev); vn_lock(vp, vp_locked | LK_RETRY); vdrop(vp); @@ -772,19 +766,10 @@ devfs_open(struct vop_open_args *ap) VOP_UNLOCK(vp, 0); - if(!(dsw->d_flags & D_NEEDGIANT)) { - DROP_GIANT(); - if (dsw->d_fdopen != NULL) - 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, fp); - else - error = dsw->d_open(dev, ap->a_mode, S_IFCHR, td); - } + if (dsw->d_fdopen != NULL) + error = dsw->d_fdopen(dev, ap->a_mode, td, fp); + else + error = dsw->d_open(dev, ap->a_mode, S_IFCHR, td); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); |