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
This commit is contained in:
John Baldwin 2008-05-07 19:03:57 +00:00
parent 5e72af30cb
commit 06d0d0e274

View File

@ -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);
}
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);
}
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);