[CRIU] [PATCH 20/37] mount: move dump_mnt_namespaces in mount.c

Andrey Vagin avagin at openvz.org
Fri Apr 18 07:42:58 PDT 2014


It will fill mntinfo list and this is internal logic of mount.c

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 mount.c      | 23 +++++++++++++++++++++++
 namespaces.c | 23 -----------------------
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/mount.c b/mount.c
index 039b569..d3cd20b 100644
--- a/mount.c
+++ b/mount.c
@@ -1762,4 +1762,27 @@ set_root:
 	return ret;
 }
 
+int dump_mnt_namespaces(void)
+{
+	struct ns_id *ns;
+	int ret = 0;
+
+	for (ns = ns_ids; ns; ns = ns->next) {
+		/* Skip current namespaces, which are in the list too  */
+		if (ns->pid == getpid())
+			continue;
+
+		if (!(ns->nd->cflag & CLONE_NEWNS))
+			continue;
+
+		pr_info("Dump MNT namespace (mountpoints) %d via %d\n",
+				ns->id, ns->pid);
+		ret = dump_mnt_ns(ns);
+		if (ret)
+			break;
+	}
+
+	return ret;
+}
+
 struct ns_desc mnt_ns_desc = NS_DESC_ENTRY(CLONE_NEWNS, "mnt");
diff --git a/namespaces.c b/namespaces.c
index 1332a66..c335765 100644
--- a/namespaces.c
+++ b/namespaces.c
@@ -446,29 +446,6 @@ static int do_dump_namespaces(struct ns_id *ns)
 
 }
 
-int dump_mnt_namespaces(void)
-{
-	struct ns_id *ns;
-	int ret = 0;
-
-	for (ns = ns_ids; ns; ns = ns->next) {
-		/* Skip current namespaces, which are in the list too  */
-		if (ns->pid == getpid())
-			continue;
-
-		if (!(ns->nd->cflag & CLONE_NEWNS))
-			continue;
-
-		pr_info("Dump MNT namespace (mountpoints) %d via %d\n",
-				ns->id, ns->pid);
-		ret = dump_mnt_ns(ns);
-		if (ret)
-			break;
-	}
-
-	return ret;
-}
-
 int dump_namespaces(struct pstree_item *item, unsigned int ns_flags)
 {
 	struct pid *ns_pid = &item->pid;
-- 
1.8.5.3



More information about the CRIU mailing list