mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
[PATCH] to nsproxy
Add the pid namespace framework to the nsproxy object. The copy of the pid namespace only increases the refcount on the global pid namespace, init_pid_ns, and unshare is not implemented. There is no configuration option to activate or deactivate this feature because this not relevant for the moment. Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Cc: Kirill Korotaev <dev@openvz.org> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
61a58c6c23
commit
9a575a92db
5 changed files with 64 additions and 9 deletions
|
@ -5,6 +5,8 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/threads.h>
|
||||
#include <linux/pid.h>
|
||||
#include <linux/nsproxy.h>
|
||||
#include <linux/kref.h>
|
||||
|
||||
struct pidmap {
|
||||
atomic_t nr_free;
|
||||
|
@ -14,10 +16,24 @@ struct pidmap {
|
|||
#define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
|
||||
|
||||
struct pid_namespace {
|
||||
struct pidmap pidmap[PIDMAP_ENTRIES];
|
||||
int last_pid;
|
||||
struct kref kref;
|
||||
struct pidmap pidmap[PIDMAP_ENTRIES];
|
||||
int last_pid;
|
||||
};
|
||||
|
||||
extern struct pid_namespace init_pid_ns;
|
||||
|
||||
static inline void get_pid_ns(struct pid_namespace *ns)
|
||||
{
|
||||
kref_get(&ns->kref);
|
||||
}
|
||||
|
||||
extern int copy_pid_ns(int flags, struct task_struct *tsk);
|
||||
extern void free_pid_ns(struct kref *kref);
|
||||
|
||||
static inline void put_pid_ns(struct pid_namespace *ns)
|
||||
{
|
||||
kref_put(&ns->kref, free_pid_ns);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_PID_NS_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue