summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_mount.c
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2012-04-17 16:28:22 +0000
committermckusick <mckusick@FreeBSD.org>2012-04-17 16:28:22 +0000
commitffee40eeff5500634fb5111e387f11dee781d197 (patch)
tree0e74691cb191897ed22ab84b20109f1b4147b16d /sys/kern/vfs_mount.c
parent7f09aee7a12feb487299902e6c6ec4c3ae44cdf3 (diff)
downloadFreeBSD-src-ffee40eeff5500634fb5111e387f11dee781d197.zip
FreeBSD-src-ffee40eeff5500634fb5111e387f11dee781d197.tar.gz
Replace the MNT_VNODE_FOREACH interface with MNT_VNODE_FOREACH_ALL.
The primary changes are that the user of the interface no longer needs to manage the mount-mutex locking and that the vnode that is returned has its mutex locked (thus avoiding the need to check to see if its is DOOMED or other possible end of life senarios). To minimize compatibility issues for third-party developers, the old MNT_VNODE_FOREACH interface will remain available so that this change can be MFC'ed to 9. Following the MFC to 9, MNT_VNODE_FOREACH will be removed in head. The reason for this update is to prepare for the addition of the MNT_VNODE_FOREACH_ACTIVE interface that will loop 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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 657fa92..6a5dfb0 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -81,7 +81,6 @@ SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0,
"Unprivileged users may mount and unmount file systems");
MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure");
-static MALLOC_DEFINE(M_VNODE_MARKER, "vnodemarker", "vnode marker");
static uma_zone_t mount_zone;
/* List of mounted filesystems. */
@@ -1720,10 +1719,14 @@ vfs_copyopt(opts, name, dest, len)
}
/*
- * This is a helper function for filesystems to traverse their
- * vnodes. See MNT_VNODE_FOREACH() in sys/mount.h
+ * These are helper functions for filesystems to traverse all
+ * their vnodes. See MNT_VNODE_FOREACH() in sys/mount.h.
+ *
+ * This interface has been deprecated in favor of MNT_VNODE_FOREACH_ALL.
*/
+MALLOC_DECLARE(M_VNODE_MARKER);
+
struct vnode *
__mnt_vnode_next(struct vnode **mvp, struct mount *mp)
{
@@ -1812,7 +1815,6 @@ __mnt_vnode_markerfree(struct vnode **mvp, struct mount *mp)
MNT_REL(mp);
}
-
int
__vfs_statfs(struct mount *mp, struct statfs *sbp)
{
OpenPOWER on IntegriCloud