Make dev_ref() require the dev_lock() to be held and use it from

devfs instead of directly frobbing the si_refcount.
This commit is contained in:
Poul-Henning Kamp 2005-02-22 14:41:04 +00:00
parent f5cc6677c1
commit 1a1457d427
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142232
2 changed files with 2 additions and 3 deletions

View File

@ -197,7 +197,7 @@ devfs_allocv(struct devfs_dirent *de, struct mount *mp, struct vnode **vpp, stru
vp->v_type = VCHR;
VI_LOCK(vp);
dev_lock();
dev->si_refcount++;
dev_ref(dev);
vp->v_rdev = dev;
SLIST_INSERT_HEAD(&dev->si_hlist, vp, v_specnext);
dev->si_usecount += vp->v_usecount;

View File

@ -81,9 +81,8 @@ void
dev_ref(struct cdev *dev)
{
dev_lock();
mtx_assert(&devmtx, MA_OWNED);
dev->si_refcount++;
dev_unlock();
}
void