summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_mount.c
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2012-04-20 06:50:44 +0000
committermckusick <mckusick@FreeBSD.org>2012-04-20 06:50:44 +0000
commit5b7b29e35b332608560671cf15919cf03d76f9ca (patch)
tree0b75b6bd0feadd4a7a71deb104b1c2c9f1871dda /sys/kern/vfs_mount.c
parent17ad55bc6eb6ab65042b08f80f22694d8de3571d (diff)
downloadFreeBSD-src-5b7b29e35b332608560671cf15919cf03d76f9ca.zip
FreeBSD-src-5b7b29e35b332608560671cf15919cf03d76f9ca.tar.gz
This change creates a new list of active vnodes associated with
a mount point. Active vnodes are those with a non-zero use or hold count, e.g., those vnodes that are not on the free list. Note that this list is in addition to the list of all the vnodes associated with a mount point. To avoid adding another set of linkage pointers to the vnode structure, the active list uses the existing linkage pointers used by the free list (previously named v_freelist, now renamed v_actfreelist). This update adds the MNT_VNODE_FOREACH_ACTIVE interface that loops over just the active vnodes associated with a mount point (typically less than 1% of the vnodes associated with the mount point). Reviewed by: kib Tested by: Peter Holm MFC after: 2 weeks
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r--sys/kern/vfs_mount.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 6a5dfb0..e9d3abe 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -461,6 +461,8 @@ vfs_mount_alloc(struct vnode *vp, struct vfsconf *vfsp, const char *fspath,
__rangeof(struct mount, mnt_startzero, mnt_endzero));
TAILQ_INIT(&mp->mnt_nvnodelist);
mp->mnt_nvnodelistsize = 0;
+ TAILQ_INIT(&mp->mnt_activevnodelist);
+ mp->mnt_activevnodelistsize = 0;
mp->mnt_ref = 0;
(void) vfs_busy(mp, MBF_NOWAIT);
mp->mnt_op = vfsp->vfc_vfsops;
@@ -514,6 +516,8 @@ vfs_mount_destroy(struct mount *mp)
}
if (mp->mnt_nvnodelistsize != 0)
panic("vfs_mount_destroy: nonzero nvnodelistsize");
+ if (mp->mnt_activevnodelistsize != 0)
+ panic("vfs_mount_destroy: nonzero activevnodelistsize");
if (mp->mnt_lockref != 0)
panic("vfs_mount_destroy: nonzero lock refcount");
MNT_IUNLOCK(mp);
OpenPOWER on IntegriCloud