aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2012-01-19 22:58:43 -0500
committerTejun Heo <tj@kernel.org>2012-01-20 12:30:08 -0500
commit245282557c49754af3dbcc732316e814340d6bce (patch)
treee790dad8b26f273a3509d0a86fb4eec9589e54e7 /kernel/cgroup.c
parenta63b9072ea4e32c1fde8b783ccf6e4288414660b (diff)
cgroup: move struct cgroup_pidlist out from the header file
It's internally used only. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index a5d3b5325f77..6ca7acad7c55 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -3043,6 +3043,38 @@ int cgroup_scan_tasks(struct cgroup_scanner *scan)
3043 * 3043 *
3044 */ 3044 */
3045 3045
3046/* which pidlist file are we talking about? */
3047enum cgroup_filetype {
3048 CGROUP_FILE_PROCS,
3049 CGROUP_FILE_TASKS,
3050};
3051
3052/*
3053 * A pidlist is a list of pids that virtually represents the contents of one
3054 * of the cgroup files ("procs" or "tasks"). We keep a list of such pidlists,
3055 * a pair (one each for procs, tasks) for each pid namespace that's relevant
3056 * to the cgroup.
3057 */
3058struct cgroup_pidlist {
3059 /*
3060 * used to find which pidlist is wanted. doesn't change as long as
3061 * this particular list stays in the list.
3062 */
3063 struct { enum cgroup_filetype type; struct pid_namespace *ns; } key;
3064 /* array of xids */
3065 pid_t *list;
3066 /* how many elements the above list has */
3067 int length;
3068 /* how many files are using the current array */
3069 int use_count;
3070 /* each of these stored in a list by its cgroup */
3071 struct list_head links;
3072 /* pointer to the cgroup we belong to, for list removal purposes */
3073 struct cgroup *owner;
3074 /* protects the other fields */
3075 struct rw_semaphore mutex;
3076};
3077
3046/* 3078/*
3047 * The following two functions "fix" the issue where there are more pids 3079 * The following two functions "fix" the issue where there are more pids
3048 * than kmalloc will give memory for; in such cases, we use vmalloc/vfree. 3080 * than kmalloc will give memory for; in such cases, we use vmalloc/vfree.