mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 15:25:21 +00:00
pid: Add ns::pid::rb_root
Add a per-ns rb tree to link pids. Should replace global pid_root_rb. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
74cc3a4f5d
commit
65fe92b94c
@@ -149,6 +149,9 @@ struct ns_id {
|
|||||||
UsernsEntry *e;
|
UsernsEntry *e;
|
||||||
int nsfd_id;
|
int nsfd_id;
|
||||||
} user;
|
} user;
|
||||||
|
struct {
|
||||||
|
struct rb_root rb_root;
|
||||||
|
} pid;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
extern struct ns_id *ns_ids;
|
extern struct ns_id *ns_ids;
|
||||||
|
@@ -309,7 +309,8 @@ struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid,
|
|||||||
INIT_LIST_HEAD(&nsid->net.ids);
|
INIT_LIST_HEAD(&nsid->net.ids);
|
||||||
INIT_LIST_HEAD(&nsid->net.links);
|
INIT_LIST_HEAD(&nsid->net.links);
|
||||||
nsid->net.netns = NULL;
|
nsid->net.netns = NULL;
|
||||||
}
|
} else if (nd == &pid_ns_desc)
|
||||||
|
nsid->pid.rb_root = RB_ROOT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsid;
|
return nsid;
|
||||||
@@ -435,6 +436,7 @@ static unsigned int generate_ns_id(int pid, unsigned int kid, struct ns_desc *nd
|
|||||||
INIT_LIST_HEAD(&nsid->net.ids);
|
INIT_LIST_HEAD(&nsid->net.ids);
|
||||||
INIT_LIST_HEAD(&nsid->net.links);
|
INIT_LIST_HEAD(&nsid->net.links);
|
||||||
} else if (nd == &pid_ns_desc) {
|
} else if (nd == &pid_ns_desc) {
|
||||||
|
nsid->pid.rb_root = RB_ROOT;
|
||||||
if (type == NS_ROOT || (type == NS_CRIU && !top_pid_ns))
|
if (type == NS_ROOT || (type == NS_CRIU && !top_pid_ns))
|
||||||
top_pid_ns = nsid;
|
top_pid_ns = nsid;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user