summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-10-17 11:56:48 +0000
committerphk <phk@FreeBSD.org>2003-10-17 11:56:48 +0000
commit888092f3177624c3c2e4fefc32d70472e7640a0f (patch)
treef61450d87949353324c00c3a185607ee4b487eb9 /sys
parentbb5e84f881dada9a7385ad0a1c133b74ea22e679 (diff)
downloadFreeBSD-src-888092f3177624c3c2e4fefc32d70472e7640a0f.zip
FreeBSD-src-888092f3177624c3c2e4fefc32d70472e7640a0f.tar.gz
Simplify count_dev()
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_subr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 77f8fc0..e65ec91 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -2838,12 +2838,12 @@ int
count_dev(dev)
dev_t dev;
{
- struct vnode *vp;
+ int count;
- vp = SLIST_FIRST(&dev->si_hlist);
- if (vp == NULL)
- return (0);
- return(vcount(vp));
+ mtx_lock(&spechash_mtx);
+ count = dev->si_usecount;
+ mtx_unlock(&spechash_mtx);
+ return(count);
}
/*
OpenPOWER on IntegriCloud