summaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-02-12 09:29:48 -0500
committerTejun Heo <tj@kernel.org>2014-02-12 09:29:48 -0500
commit0adb070426dde2fd0b84e7f4f5cefcd8f0b24410 (patch)
treed6acf3d7e39fa838998af178ef340f1d159d2fb2 /include/linux/cgroup.h
parent80b13586997d8e584caa772bd99e2a3e55ac6abe (diff)
downloadtalos-obmc-linux-0adb070426dde2fd0b84e7f4f5cefcd8f0b24410.tar.gz
talos-obmc-linux-0adb070426dde2fd0b84e7f4f5cefcd8f0b24410.zip
cgroup: remove cftype_set
cftype_set was added primarily to allow registering the same cftype array more than once for different subsystems. Nobody uses or needs such thing and it's already broken because each cftype has ->ss pointer which is initialized during registration. Let's add list_head ->node to cftype and use the first cftype entry in the array to link them instead of allocating separate cftype_set. While at it, trigger WARN if cft seems previously initialized during registration. This simplifies cftype handling a bit. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h26
1 files changed, 9 insertions, 17 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 305e94ee17f5..b42251a23129 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -412,12 +412,11 @@ struct cftype {
unsigned int flags;
/*
- * The subsys this file belongs to. Initialized automatically
- * during registration. NULL for cgroup core files.
+ * Fields used for internal bookkeeping. Initialized automatically
+ * during registration.
*/
- struct cgroup_subsys *ss;
-
- /* kernfs_ops to use, initialized automatically during registration */
+ struct cgroup_subsys *ss; /* NULL for cgroup core files */
+ struct list_head node; /* anchored at ss->cfts */
struct kernfs_ops *kf_ops;
/*
@@ -472,16 +471,6 @@ struct cftype {
};
/*
- * cftype_sets describe cftypes belonging to a subsystem and are chained at
- * cgroup_subsys->cftsets. Each cftset points to an array of cftypes
- * terminated by zero length name.
- */
-struct cftype_set {
- struct list_head node; /* chained at subsys->cftsets */
- struct cftype *cfts;
-};
-
-/*
* See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This
* function can be called as long as @cgrp is accessible.
*/
@@ -597,8 +586,11 @@ struct cgroup_subsys {
/* link to parent, protected by cgroup_lock() */
struct cgroupfs_root *root;
- /* list of cftype_sets */
- struct list_head cftsets;
+ /*
+ * List of cftypes. Each entry is the first entry of an array
+ * terminated by zero length name.
+ */
+ struct list_head cfts;
/* base cftypes, automatically registered with subsys itself */
struct cftype *base_cftypes;
OpenPOWER on IntegriCloud