Commit 9625ebe5 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

mount: move dump_mnt_namespaces in mount.c

It will fill mntinfo list and this is internal logic of mount.c
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent cc1fd576
...@@ -1777,4 +1777,27 @@ set_root: ...@@ -1777,4 +1777,27 @@ set_root:
return ret; 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"); struct ns_desc mnt_ns_desc = NS_DESC_ENTRY(CLONE_NEWNS, "mnt");
...@@ -446,29 +446,6 @@ static int do_dump_namespaces(struct ns_id *ns) ...@@ -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) int dump_namespaces(struct pstree_item *item, unsigned int ns_flags)
{ {
struct pid *ns_pid = &item->pid; struct pid *ns_pid = &item->pid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment