signalfd simplification
[sfrench/cifs-2.6.git] / include / linux / init_task.h
index a2d95ff50e9bd71eb741d5ef9a293574245ab244..f8abfa349ef924344a11b1fd9739e68bd4d72b24 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/lockdep.h>
 #include <linux/ipc.h>
 #include <linux/pid_namespace.h>
+#include <linux/user_namespace.h>
 
 #define INIT_FDTABLE \
 {                                                      \
@@ -65,9 +66,9 @@
        .posix_timers    = LIST_HEAD_INIT(sig.posix_timers),            \
        .cpu_timers     = INIT_CPU_TIMERS(sig.cpu_timers),              \
        .rlim           = INIT_RLIMITS,                                 \
-       .pgrp           = 1,                                            \
+       .pgrp           = 0,                                            \
        .tty_old_pgrp   = NULL,                                         \
-       { .__session      = 1},                                         \
+       { .__session      = 0},                                         \
 }
 
 extern struct nsproxy init_nsproxy;
@@ -78,16 +79,40 @@ extern struct nsproxy init_nsproxy;
        .uts_ns         = &init_uts_ns,                                 \
        .mnt_ns         = NULL,                                         \
        INIT_IPC_NS(ipc_ns)                                             \
+       .user_ns        = &init_user_ns,                                \
 }
 
 #define INIT_SIGHAND(sighand) {                                                \
        .count          = ATOMIC_INIT(1),                               \
        .action         = { { { .sa_handler = NULL, } }, },             \
        .siglock        = __SPIN_LOCK_UNLOCKED(sighand.siglock),        \
+       .signalfd_wqh   = __WAIT_QUEUE_HEAD_INITIALIZER(sighand.signalfd_wqh),  \
 }
 
 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)
@@ -95,7 +120,7 @@ extern struct group_info init_groups;
 #define INIT_TASK(tsk) \
 {                                                                      \
        .state          = 0,                                            \
-       .thread_info    = &init_thread_info,                            \
+       .stack          = &init_thread_info,                            \
        .usage          = ATOMIC_INIT(2),                               \
        .flags          = 0,                                            \
        .lock_depth     = -1,                                           \
@@ -138,7 +163,12 @@ extern struct group_info init_groups;
        .journal_info   = NULL,                                         \
        .cpu_timers     = INIT_CPU_TIMERS(tsk.cpu_timers),              \
        .fs_excl        = ATOMIC_INIT(0),                               \
-       .pi_lock        = SPIN_LOCK_UNLOCKED,                           \
+       .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                                                    \
 }