[CRIU] [PATCH 3/4] mnt: Clean up namespaces walking code

Pavel Emelyanov xemul at parallels.com
Thu Oct 9 06:43:19 PDT 2014


Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 mount.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/mount.c b/mount.c
index 4da0d6f..f828ed2 100644
--- a/mount.c
+++ b/mount.c
@@ -2076,7 +2076,7 @@ int mntns_get_root_by_mnt_id(int mnt_id)
 	return mntns_get_root_fd(mntns);
 }
 
-static int walk_mnt_ns(int (*cb)(struct ns_id *, struct mount_info *, void *), void *arg)
+int collect_mnt_namespaces(void)
 {
 	struct mount_info *pms;
 	struct ns_id *ns;
@@ -2114,11 +2114,9 @@ static int walk_mnt_ns(int (*cb)(struct ns_id *, struct mount_info *, void *), v
 		if (pms == NULL)
 			goto err;
 
-		if (cb && cb(ns, pms, arg))
-			goto err;
-
 		mntinfo_add_list(pms);
 	}
+
 	if (collect_shared(mntinfo))
 		goto err;
 	if (validate_mounts(mntinfo, true))
@@ -2129,11 +2127,6 @@ err:
 	return ret;
 }
 
-int collect_mnt_namespaces(void)
-{
-	return walk_mnt_ns(NULL, NULL);
-}
-
 int dump_mnt_namespaces(void)
 {
 	struct ns_id *nsid;
-- 
1.8.4.2




More information about the CRIU mailing list