diff options
author | phk <phk@FreeBSD.org> | 2003-10-17 11:56:48 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-10-17 11:56:48 +0000 |
commit | 888092f3177624c3c2e4fefc32d70472e7640a0f (patch) | |
tree | f61450d87949353324c00c3a185607ee4b487eb9 /sys | |
parent | bb5e84f881dada9a7385ad0a1c133b74ea22e679 (diff) | |
download | FreeBSD-src-888092f3177624c3c2e4fefc32d70472e7640a0f.zip FreeBSD-src-888092f3177624c3c2e4fefc32d70472e7640a0f.tar.gz |
Simplify count_dev()
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_subr.c | 10 |
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); } /* |