From 60d2f517e82bdbc924ccafa682aabfe710b058fb Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu Date: Thu, 10 May 2007 22:23:00 -0700 Subject: [PATCH] --- yaml --- r: 55917 b: refs/heads/master c: 820e45db2380eb1545fa2bc5d34b8b2f2933faeb h: refs/heads/master i: 55915: e1e1b3aaafbcf282352479d21f50e5dee0740228 v: v3 --- [refs] | 2 +- trunk/include/linux/init_task.h | 27 +++++++++++++++++++++++++++ trunk/include/linux/pid.h | 2 ++ trunk/kernel/pid.c | 2 ++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index cc3f983a95c6..380e606e3994 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e713d0dab21a68500720e222fa02567fc7dfb14b +refs/heads/master: 820e45db2380eb1545fa2bc5d34b8b2f2933faeb diff --git a/trunk/include/linux/init_task.h b/trunk/include/linux/init_task.h index 45170b2fa253..a68835fc8c04 100644 --- a/trunk/include/linux/init_task.h +++ b/trunk/include/linux/init_task.h @@ -88,6 +88,28 @@ extern struct nsproxy init_nsproxy; extern struct group_info init_groups; +#define INIT_STRUCT_PID { \ + .count = ATOMIC_INIT(1), \ + .nr = 0, \ + /* Don't put this struct pid in pid_hash */ \ + .pid_chain = { .next = NULL, .pprev = NULL }, \ + .tasks = { \ + { .first = &init_task.pids[PIDTYPE_PID].node }, \ + { .first = &init_task.pids[PIDTYPE_PGID].node }, \ + { .first = &init_task.pids[PIDTYPE_SID].node }, \ + }, \ + .rcu = RCU_HEAD_INIT, \ +} + +#define INIT_PID_LINK(type) \ +{ \ + .node = { \ + .next = NULL, \ + .pprev = &init_struct_pid.tasks[type].first, \ + }, \ + .pid = &init_struct_pid, \ +} + /* * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) @@ -139,6 +161,11 @@ extern struct group_info init_groups; .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ .fs_excl = ATOMIC_INIT(0), \ .pi_lock = __SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ + .pids = { \ + [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \ + [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ + [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ + }, \ INIT_TRACE_IRQFLAGS \ INIT_LOCKDEP \ } diff --git a/trunk/include/linux/pid.h b/trunk/include/linux/pid.h index 33d343880d89..1e0e4e3423a6 100644 --- a/trunk/include/linux/pid.h +++ b/trunk/include/linux/pid.h @@ -51,6 +51,8 @@ struct pid struct rcu_head rcu; }; +extern struct pid init_struct_pid; + struct pid_link { struct hlist_node node; diff --git a/trunk/kernel/pid.c b/trunk/kernel/pid.c index d76f59326bd4..eb66bd2953ab 100644 --- a/trunk/kernel/pid.c +++ b/trunk/kernel/pid.c @@ -27,11 +27,13 @@ #include #include #include +#include #define pid_hashfn(nr) hash_long((unsigned long)nr, pidhash_shift) static struct hlist_head *pid_hash; static int pidhash_shift; static struct kmem_cache *pid_cachep; +struct pid init_struct_pid = INIT_STRUCT_PID; int pid_max = PID_MAX_DEFAULT;