mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
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 <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
cc1fd5760a
commit
9625ebe596
23
mount.c
23
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");
|
||||
|
23
namespaces.c
23
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;
|
||||
|
Reference in New Issue
Block a user