Commit a85aeb7f authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Pavel Emelyanov

ns: Remove __rst_new_ns_id

There's only one user of it, so better to reshuffle the arg set.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent b8a9122d
......@@ -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);
......
......@@ -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");
......
......@@ -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;
......
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