From 9625ebe5961b762ce723a8f920e5a8bd6c6bd1ee Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Mon, 21 Apr 2014 18:23:33 +0400 Subject: [PATCH] mount: move dump_mnt_namespaces in mount.c It will fill mntinfo list and this is internal logic of mount.c Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- mount.c | 23 +++++++++++++++++++++++ namespaces.c | 23 ----------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/mount.c b/mount.c index 3dce3fd5e..1e3a5e8f0 100644 --- a/mount.c +++ b/mount.c @@ -1777,4 +1777,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 8324fe392..41debb430 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;