aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-01-30 22:51:25 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2010-03-03 14:07:57 -0500
commit1f707137b55764740981d022d29c622832a61880 (patch)
treeaf5f72ea7df1afbc1f3b5bb53a3ab3d8ebaae1e0 /fs
parent462d60577a997aa87c935ae4521bd303733a9f2b (diff)
new helper: iterate_mounts()
apply function to vfsmounts in set returned by collect_mounts(), stop if it returns non-zero. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index d25d4602ab50..d5906c19e08e 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1246,6 +1246,21 @@ void drop_collected_mounts(struct vfsmount *mnt)
1246 release_mounts(&umount_list); 1246 release_mounts(&umount_list);
1247} 1247}
1248 1248
1249int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
1250 struct vfsmount *root)
1251{
1252 struct vfsmount *mnt;
1253 int res = f(root, arg);
1254 if (res)
1255 return res;
1256 list_for_each_entry(mnt, &root->mnt_list, mnt_list) {
1257 res = f(mnt, arg);
1258 if (res)
1259 return res;
1260 }
1261 return 0;
1262}
1263
1249static void cleanup_group_ids(struct vfsmount *mnt, struct vfsmount *end) 1264static void cleanup_group_ids(struct vfsmount *mnt, struct vfsmount *end)
1250{ 1265{
1251 struct vfsmount *p; 1266 struct vfsmount *p;