aboutsummaryrefslogtreecommitdiffstats
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)
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 {
412 unsigned int flags; 412 unsigned int flags;
413 413
414 /* 414 /*
415 * The subsys this file belongs to. Initialized automatically 415 * Fields used for internal bookkeeping. Initialized automatically
416 * during registration. NULL for cgroup core files. 416 * during registration.
417 */ 417 */
418 struct cgroup_subsys *ss; 418 struct cgroup_subsys *ss; /* NULL for cgroup core files */
419 419 struct list_head node; /* anchored at ss->cfts */
420 /* kernfs_ops to use, initialized automatically during registration */
421 struct kernfs_ops *kf_ops; 420 struct kernfs_ops *kf_ops;
422 421
423 /* 422 /*
@@ -472,16 +471,6 @@ struct cftype {
472}; 471};
473 472
474/* 473/*
475 * cftype_sets describe cftypes belonging to a subsystem and are chained at
476 * cgroup_subsys->cftsets. Each cftset points to an array of cftypes
477 * terminated by zero length name.
478 */
479struct cftype_set {
480 struct list_head node; /* chained at subsys->cftsets */
481 struct cftype *cfts;
482};
483
484/*
485 * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This 474 * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This
486 * function can be called as long as @cgrp is accessible. 475 * function can be called as long as @cgrp is accessible.
487 */ 476 */
@@ -597,8 +586,11 @@ struct cgroup_subsys {
597 /* link to parent, protected by cgroup_lock() */ 586 /* link to parent, protected by cgroup_lock() */
598 struct cgroupfs_root *root; 587 struct cgroupfs_root *root;
599 588
600 /* list of cftype_sets */ 589 /*
601 struct list_head cftsets; 590 * List of cftypes. Each entry is the first entry of an array
591 * terminated by zero length name.
592 */
593 struct list_head cfts;
602 594
603 /* base cftypes, automatically registered with subsys itself */ 595 /* base cftypes, automatically registered with subsys itself */
604 struct cftype *base_cftypes; 596 struct cftype *base_cftypes;