Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4c3f2ead5a3dff9069a45560ba4d007c8ae2e2ee
Commit:     4c3f2ead5a3dff9069a45560ba4d007c8ae2e2ee
Parent:     60347f6716aa49831ac311e04d77ccdc50dc024a
Author:     Sukadev Bhattiprolu <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 18 23:40:03 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Oct 19 11:53:38 2007 -0700

    pid namespaces: introduce struct upid
    
    Since task will be visible from different pid namespaces each of them have 
to
    be addressed by multiple pids.  struct upid is to store the information 
about
    which id refers to which namespace.
    
    The constuciton looks like this.  Each struct pid carried the reference
    counter and the list of tasks attached to this pid.  At its end it has a
    variable length array of struct upid-s.  Each struct upid has a numerical id
    (pid itself), pointer to the namespace, this ID is valid in and is hashed 
into
    a pid_hash for searching the pids.
    
    The nr and pid_chain fields are kept in struct pid for a while to make 
kernel
    still work (no patch initialize the upids yet), but it will be removed at 
the
    end of this series when we switch to upids completely.
    
    Signed-off-by: Sukadev Bhattiprolu <[EMAIL PROTECTED]>
    Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
    Cc: Oleg Nesterov <[EMAIL PROTECTED]>
    Cc: Paul Menage <[EMAIL PROTECTED]>
    Cc: "Eric W. Biederman" <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/init_task.h |    6 ++++++
 include/linux/pid.h       |   16 ++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d4b2f1c..243e287 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -103,6 +103,12 @@ extern struct group_info init_groups;
                { .first = &init_task.pids[PIDTYPE_SID].node },         \
        },                                                              \
        .rcu            = RCU_HEAD_INIT,                                \
+       .level          = 0,                                            \
+       .numbers        = { {                                           \
+               .nr             = 0,                                    \
+               .ns             = &init_pid_ns,                         \
+               .pid_chain      = { .next = NULL, .pprev = NULL },      \
+       }, }                                                            \
 }
 
 #define INIT_PID_LINK(type)                                    \
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 1e0e4e3..e5865a9 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -40,6 +40,20 @@ enum pid_type
  * processes.
  */
 
+
+/*
+ * struct upid is used to get the id of the struct pid, as it is
+ * seen in particular namespace. Later the struct pid is found with
+ * find_pid_ns() using the int nr and struct pid_namespace *ns.
+ */
+
+struct upid {
+       /* Try to keep pid_chain in the same cacheline as nr for find_pid */
+       int nr;
+       struct pid_namespace *ns;
+       struct hlist_node pid_chain;
+};
+
 struct pid
 {
        atomic_t count;
@@ -49,6 +63,8 @@ struct pid
        /* lists of tasks that use this pid */
        struct hlist_head tasks[PIDTYPE_MAX];
        struct rcu_head rcu;
+       int level;
+       struct upid numbers[1];
 };
 
 extern struct pid init_struct_pid;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to