ns: Remove __rst_new_ns_id

There's only one user of it, so better to reshuffle the arg set.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Pavel Emelyanov 2015-12-09 14:57:49 +03:00 committed by Pavel Emelyanov
parent b8a9122d89
commit a85aeb7fd0
3 changed files with 6 additions and 11 deletions

View file

@ -79,7 +79,7 @@ extern int restore_ns(int rst, struct ns_desc *nd);
extern int dump_task_ns_ids(struct pstree_item *);
extern int predump_task_ns_ids(struct pstree_item *);
extern struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid, struct ns_desc *nd);
extern struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid, struct ns_desc *nd, enum ns_type t);
extern int rst_add_ns_id(unsigned int id, struct pstree_item *, struct ns_desc *nd);
extern struct ns_id *lookup_ns_by_id(unsigned int id, struct ns_desc *nd);

View file

@ -2678,11 +2678,11 @@ out:
return exit_code;
}
static int rst_collect_local_mntns(void)
static int rst_collect_local_mntns(enum ns_type typ)
{
struct ns_id *nsid;
nsid = rst_new_ns_id(0, getpid(), &mnt_ns_desc);
nsid = rst_new_ns_id(0, getpid(), &mnt_ns_desc, typ);
if (!nsid)
return -1;
@ -3104,7 +3104,7 @@ int prepare_mnt_ns(void)
struct ns_id *nsid;
if (!(root_ns_mask & CLONE_NEWNS))
return rst_collect_local_mntns();
return rst_collect_local_mntns(NS_CRIU);
pr_info("Restoring mount namespace\n");

View file

@ -135,7 +135,7 @@ static void nsid_add(struct ns_id *ns, struct ns_desc *nd, unsigned int id, pid_
pr_info("Add %s ns %d pid %d\n", nd->str, ns->id, ns->ns_pid);
}
static struct ns_id *__rst_new_ns_id(unsigned int id, pid_t pid,
struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid,
struct ns_desc *nd, enum ns_type type)
{
struct ns_id *nsid;
@ -150,11 +150,6 @@ static struct ns_id *__rst_new_ns_id(unsigned int id, pid_t pid,
return nsid;
}
struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid, struct ns_desc *nd)
{
return __rst_new_ns_id(id, pid, nd, NS_CRIU);
}
int rst_add_ns_id(unsigned int id, struct pstree_item *i, struct ns_desc *nd)
{
pid_t pid = i->pid.virt;
@ -167,7 +162,7 @@ int rst_add_ns_id(unsigned int id, struct pstree_item *i, struct ns_desc *nd)
return 0;
}
nsid = __rst_new_ns_id(id, pid, nd,
nsid = rst_new_ns_id(id, pid, nd,
i == root_item ? NS_ROOT : NS_OTHER);
if (nsid == NULL)
return -1;