Simplify count_dev()

This commit is contained in:
Poul-Henning Kamp 2003-10-17 11:56:48 +00:00
parent a96bd7843f
commit 3da2d6a453

View File

@ -2838,12 +2838,12 @@ int
count_dev(dev) count_dev(dev)
dev_t dev; dev_t dev;
{ {
struct vnode *vp; int count;
vp = SLIST_FIRST(&dev->si_hlist); mtx_lock(&spechash_mtx);
if (vp == NULL) count = dev->si_usecount;
return (0); mtx_unlock(&spechash_mtx);
return(vcount(vp)); return(count);
} }
/* /*