[CRIU] [PATCH 03/14] mount: move dump_mnt_namespaces in mount.c
Andrey Vagin
avagin at openvz.org
Thu Apr 17 12:23:57 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 cb6b963..5787b47 100644
--- a/mount.c
+++ b/mount.c
@@ -1765,4 +1765,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