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:
parent
f5cc6677c1
commit
1a1457d427
@ -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;
|
||||
|
@ -81,9 +81,8 @@ void
|
||||
dev_ref(struct cdev *dev)
|
||||
{
|
||||
|
||||
dev_lock();
|
||||
mtx_assert(&devmtx, MA_OWNED);
|
||||
dev->si_refcount++;
|
||||
dev_unlock();
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user