aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-08-08 20:11:22 -0400
committerTejun Heo <tj@kernel.org>2013-08-08 20:11:22 -0400
commit8af01f56a03e9cbd91a55d688fce1315021efba8 (patch)
tree05c051bd8b188073bb4bf695c3a46c6592e86794
parent61584e3f4964995e575618f76ff7197123796e75 (diff)
cgroup: s/cgroup_subsys_state/cgroup_css/ s/task_subsys_state/task_css/
The names of the two struct cgroup_subsys_state accessors - cgroup_subsys_state() and task_subsys_state() - are somewhat awkward. The former clashes with the type name and the latter doesn't even indicate it's somehow related to cgroup. We're about to revamp large portion of cgroup API, so, let's rename them so that they're less awkward. Most per-controller usages of the accessors are localized in accessor wrappers and given the amount of scheduled changes, this isn't gonna add any noticeable headache. Rename cgroup_subsys_state() to cgroup_css() and task_subsys_state() to task_css(). This patch is pure rename. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
-rw-r--r--block/blk-cgroup.h5
-rw-r--r--fs/bio.c2
-rw-r--r--include/linux/cgroup.h31
-rw-r--r--include/net/cls_cgroup.h4
-rw-r--r--include/net/netprio_cgroup.h4
-rw-r--r--kernel/cgroup.c2
-rw-r--r--kernel/cgroup_freezer.c4
-rw-r--r--kernel/cpuset.c6
-rw-r--r--kernel/events/core.c6
-rw-r--r--kernel/sched/core.c4
-rw-r--r--kernel/sched/cpuacct.c4
-rw-r--r--kernel/sched/sched.h6
-rw-r--r--mm/hugetlb_cgroup.c6
-rw-r--r--mm/memcontrol.c5
-rw-r--r--mm/vmpressure.c2
-rw-r--r--net/core/netprio_cgroup.c2
-rw-r--r--net/sched/cls_cgroup.c4
-rw-r--r--security/device_cgroup.c4
18 files changed, 52 insertions, 49 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 8056c03a3382..628e50f6f8a8 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -181,14 +181,13 @@ void blkg_conf_finish(struct blkg_conf_ctx *ctx);
181 181
182static inline struct blkcg *cgroup_to_blkcg(struct cgroup *cgroup) 182static inline struct blkcg *cgroup_to_blkcg(struct cgroup *cgroup)
183{ 183{
184 return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id), 184 return container_of(cgroup_css(cgroup, blkio_subsys_id),
185 struct blkcg, css); 185 struct blkcg, css);
186} 186}
187 187
188static inline struct blkcg *task_blkcg(struct task_struct *tsk) 188static inline struct blkcg *task_blkcg(struct task_struct *tsk)
189{ 189{
190 return container_of(task_subsys_state(tsk, blkio_subsys_id), 190 return container_of(task_css(tsk, blkio_subsys_id), struct blkcg, css);
191 struct blkcg, css);
192} 191}
193 192
194static inline struct blkcg *bio_blkcg(struct bio *bio) 193static inline struct blkcg *bio_blkcg(struct bio *bio)
diff --git a/fs/bio.c b/fs/bio.c
index 94bbc04dba77..8e0348f6e5bd 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1946,7 +1946,7 @@ int bio_associate_current(struct bio *bio)
1946 1946
1947 /* associate blkcg if exists */ 1947 /* associate blkcg if exists */
1948 rcu_read_lock(); 1948 rcu_read_lock();
1949 css = task_subsys_state(current, blkio_subsys_id); 1949 css = task_css(current, blkio_subsys_id);
1950 if (css && css_tryget(css)) 1950 if (css && css_tryget(css))
1951 bio->bi_css = css; 1951 bio->bi_css = css;
1952 rcu_read_unlock(); 1952 rcu_read_unlock();
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 44dd422d7e9b..552c5feef733 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -647,8 +647,15 @@ struct cgroup_subsys {
647#undef IS_SUBSYS_ENABLED 647#undef IS_SUBSYS_ENABLED
648#undef SUBSYS 648#undef SUBSYS
649 649
650static inline struct cgroup_subsys_state *cgroup_subsys_state( 650/**
651 struct cgroup *cgrp, int subsys_id) 651 * cgroup_css - obtain a cgroup's css for the specified subsystem
652 * @cgrp: the cgroup of interest
653 * @subsys_id: the subsystem of interest
654 *
655 * Return @cgrp's css (cgroup_subsys_state) associated with @subsys_id.
656 */
657static inline struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp,
658 int subsys_id)
652{ 659{
653 return cgrp->subsys[subsys_id]; 660 return cgrp->subsys[subsys_id];
654} 661}
@@ -678,7 +685,7 @@ extern struct mutex cgroup_mutex;
678#endif 685#endif
679 686
680/** 687/**
681 * task_subsys_state_check - obtain css for (task, subsys) w/ extra access conds 688 * task_css_check - obtain css for (task, subsys) w/ extra access conds
682 * @task: the target task 689 * @task: the target task
683 * @subsys_id: the target subsystem ID 690 * @subsys_id: the target subsystem ID
684 * @__c: extra condition expression to be passed to rcu_dereference_check() 691 * @__c: extra condition expression to be passed to rcu_dereference_check()
@@ -686,7 +693,7 @@ extern struct mutex cgroup_mutex;
686 * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The 693 * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The
687 * synchronization rules are the same as task_css_set_check(). 694 * synchronization rules are the same as task_css_set_check().
688 */ 695 */
689#define task_subsys_state_check(task, subsys_id, __c) \ 696#define task_css_check(task, subsys_id, __c) \
690 task_css_set_check((task), (__c))->subsys[(subsys_id)] 697 task_css_set_check((task), (__c))->subsys[(subsys_id)]
691 698
692/** 699/**
@@ -701,22 +708,22 @@ static inline struct css_set *task_css_set(struct task_struct *task)
701} 708}
702 709
703/** 710/**
704 * task_subsys_state - obtain css for (task, subsys) 711 * task_css - obtain css for (task, subsys)
705 * @task: the target task 712 * @task: the target task
706 * @subsys_id: the target subsystem ID 713 * @subsys_id: the target subsystem ID
707 * 714 *
708 * See task_subsys_state_check(). 715 * See task_css_check().
709 */ 716 */
710static inline struct cgroup_subsys_state * 717static inline struct cgroup_subsys_state *task_css(struct task_struct *task,
711task_subsys_state(struct task_struct *task, int subsys_id) 718 int subsys_id)
712{ 719{
713 return task_subsys_state_check(task, subsys_id, false); 720 return task_css_check(task, subsys_id, false);
714} 721}
715 722
716static inline struct cgroup* task_cgroup(struct task_struct *task, 723static inline struct cgroup *task_cgroup(struct task_struct *task,
717 int subsys_id) 724 int subsys_id)
718{ 725{
719 return task_subsys_state(task, subsys_id)->cgroup; 726 return task_css(task, subsys_id)->cgroup;
720} 727}
721 728
722/** 729/**
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 0fee0617fb7d..52adaa75dac9 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -35,7 +35,7 @@ static inline u32 task_cls_classid(struct task_struct *p)
35 return 0; 35 return 0;
36 36
37 rcu_read_lock(); 37 rcu_read_lock();
38 classid = container_of(task_subsys_state(p, net_cls_subsys_id), 38 classid = container_of(task_css(p, net_cls_subsys_id),
39 struct cgroup_cls_state, css)->classid; 39 struct cgroup_cls_state, css)->classid;
40 rcu_read_unlock(); 40 rcu_read_unlock();
41 41
@@ -51,7 +51,7 @@ static inline u32 task_cls_classid(struct task_struct *p)
51 return 0; 51 return 0;
52 52
53 rcu_read_lock(); 53 rcu_read_lock();
54 css = task_subsys_state(p, net_cls_subsys_id); 54 css = task_css(p, net_cls_subsys_id);
55 if (css) 55 if (css)
56 classid = container_of(css, 56 classid = container_of(css,
57 struct cgroup_cls_state, css)->classid; 57 struct cgroup_cls_state, css)->classid;
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 50ab8c26ab59..8110fa7ae60a 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -39,7 +39,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
39 u32 idx; 39 u32 idx;
40 40
41 rcu_read_lock(); 41 rcu_read_lock();
42 css = task_subsys_state(p, net_prio_subsys_id); 42 css = task_css(p, net_prio_subsys_id);
43 idx = css->cgroup->id; 43 idx = css->cgroup->id;
44 rcu_read_unlock(); 44 rcu_read_unlock();
45 return idx; 45 return idx;
@@ -53,7 +53,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
53 u32 idx = 0; 53 u32 idx = 0;
54 54
55 rcu_read_lock(); 55 rcu_read_lock();
56 css = task_subsys_state(p, net_prio_subsys_id); 56 css = task_css(p, net_prio_subsys_id);
57 if (css) 57 if (css)
58 idx = css->cgroup->id; 58 idx = css->cgroup->id;
59 rcu_read_unlock(); 59 rcu_read_unlock();
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index ae4c46834633..0b3caa3220cb 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -81,7 +81,7 @@
81 */ 81 */
82#ifdef CONFIG_PROVE_RCU 82#ifdef CONFIG_PROVE_RCU
83DEFINE_MUTEX(cgroup_mutex); 83DEFINE_MUTEX(cgroup_mutex);
84EXPORT_SYMBOL_GPL(cgroup_mutex); /* only for task_subsys_state_check() */ 84EXPORT_SYMBOL_GPL(cgroup_mutex); /* only for lockdep */
85#else 85#else
86static DEFINE_MUTEX(cgroup_mutex); 86static DEFINE_MUTEX(cgroup_mutex);
87#endif 87#endif
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 75dda1ea5026..9d3f61566fec 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -47,13 +47,13 @@ struct freezer {
47 47
48static inline struct freezer *cgroup_freezer(struct cgroup *cgroup) 48static inline struct freezer *cgroup_freezer(struct cgroup *cgroup)
49{ 49{
50 return container_of(cgroup_subsys_state(cgroup, freezer_subsys_id), 50 return container_of(cgroup_css(cgroup, freezer_subsys_id),
51 struct freezer, css); 51 struct freezer, css);
52} 52}
53 53
54static inline struct freezer *task_freezer(struct task_struct *task) 54static inline struct freezer *task_freezer(struct task_struct *task)
55{ 55{
56 return container_of(task_subsys_state(task, freezer_subsys_id), 56 return container_of(task_css(task, freezer_subsys_id),
57 struct freezer, css); 57 struct freezer, css);
58} 58}
59 59
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 1b9c31549797..be4512ba2c0c 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -117,14 +117,14 @@ struct cpuset {
117/* Retrieve the cpuset for a cgroup */ 117/* Retrieve the cpuset for a cgroup */
118static inline struct cpuset *cgroup_cs(struct cgroup *cgrp) 118static inline struct cpuset *cgroup_cs(struct cgroup *cgrp)
119{ 119{
120 return container_of(cgroup_subsys_state(cgrp, cpuset_subsys_id), 120 return container_of(cgroup_css(cgrp, cpuset_subsys_id),
121 struct cpuset, css); 121 struct cpuset, css);
122} 122}
123 123
124/* Retrieve the cpuset for a task */ 124/* Retrieve the cpuset for a task */
125static inline struct cpuset *task_cs(struct task_struct *task) 125static inline struct cpuset *task_cs(struct task_struct *task)
126{ 126{
127 return container_of(task_subsys_state(task, cpuset_subsys_id), 127 return container_of(task_css(task, cpuset_subsys_id),
128 struct cpuset, css); 128 struct cpuset, css);
129} 129}
130 130
@@ -2724,7 +2724,7 @@ int proc_cpuset_show(struct seq_file *m, void *unused_v)
2724 goto out_free; 2724 goto out_free;
2725 2725
2726 rcu_read_lock(); 2726 rcu_read_lock();
2727 css = task_subsys_state(tsk, cpuset_subsys_id); 2727 css = task_css(tsk, cpuset_subsys_id);
2728 retval = cgroup_path(css->cgroup, buf, PAGE_SIZE); 2728 retval = cgroup_path(css->cgroup, buf, PAGE_SIZE);
2729 rcu_read_unlock(); 2729 rcu_read_unlock();
2730 if (retval < 0) 2730 if (retval < 0)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 1833bc5a84a7..414c61f4d776 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -340,8 +340,8 @@ struct perf_cgroup {
340static inline struct perf_cgroup * 340static inline struct perf_cgroup *
341perf_cgroup_from_task(struct task_struct *task) 341perf_cgroup_from_task(struct task_struct *task)
342{ 342{
343 return container_of(task_subsys_state(task, perf_subsys_id), 343 return container_of(task_css(task, perf_subsys_id),
344 struct perf_cgroup, css); 344 struct perf_cgroup, css);
345} 345}
346 346
347static inline bool 347static inline bool
@@ -7798,7 +7798,7 @@ static struct cgroup_subsys_state *perf_cgroup_css_alloc(struct cgroup *cont)
7798static void perf_cgroup_css_free(struct cgroup *cont) 7798static void perf_cgroup_css_free(struct cgroup *cont)
7799{ 7799{
7800 struct perf_cgroup *jc; 7800 struct perf_cgroup *jc;
7801 jc = container_of(cgroup_subsys_state(cont, perf_subsys_id), 7801 jc = container_of(cgroup_css(cont, perf_subsys_id),
7802 struct perf_cgroup, css); 7802 struct perf_cgroup, css);
7803 free_percpu(jc->info); 7803 free_percpu(jc->info);
7804 kfree(jc); 7804 kfree(jc);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 9b1f2e533b95..323d907eac1a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6761,7 +6761,7 @@ void sched_move_task(struct task_struct *tsk)
6761 if (unlikely(running)) 6761 if (unlikely(running))
6762 tsk->sched_class->put_prev_task(rq, tsk); 6762 tsk->sched_class->put_prev_task(rq, tsk);
6763 6763
6764 tg = container_of(task_subsys_state_check(tsk, cpu_cgroup_subsys_id, 6764 tg = container_of(task_css_check(tsk, cpu_cgroup_subsys_id,
6765 lockdep_is_held(&tsk->sighand->siglock)), 6765 lockdep_is_held(&tsk->sighand->siglock)),
6766 struct task_group, css); 6766 struct task_group, css);
6767 tg = autogroup_task_group(tsk, tg); 6767 tg = autogroup_task_group(tsk, tg);
@@ -7086,7 +7086,7 @@ int sched_rt_handler(struct ctl_table *table, int write,
7086/* return corresponding task_group object of a cgroup */ 7086/* return corresponding task_group object of a cgroup */
7087static inline struct task_group *cgroup_tg(struct cgroup *cgrp) 7087static inline struct task_group *cgroup_tg(struct cgroup *cgrp)
7088{ 7088{
7089 return container_of(cgroup_subsys_state(cgrp, cpu_cgroup_subsys_id), 7089 return container_of(cgroup_css(cgrp, cpu_cgroup_subsys_id),
7090 struct task_group, css); 7090 struct task_group, css);
7091} 7091}
7092 7092
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index dbb7e2cd95eb..4a210faaab77 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -36,14 +36,14 @@ struct cpuacct {
36/* return cpu accounting group corresponding to this container */ 36/* return cpu accounting group corresponding to this container */
37static inline struct cpuacct *cgroup_ca(struct cgroup *cgrp) 37static inline struct cpuacct *cgroup_ca(struct cgroup *cgrp)
38{ 38{
39 return container_of(cgroup_subsys_state(cgrp, cpuacct_subsys_id), 39 return container_of(cgroup_css(cgrp, cpuacct_subsys_id),
40 struct cpuacct, css); 40 struct cpuacct, css);
41} 41}
42 42
43/* return cpu accounting group to which this task belongs */ 43/* return cpu accounting group to which this task belongs */
44static inline struct cpuacct *task_ca(struct task_struct *tsk) 44static inline struct cpuacct *task_ca(struct task_struct *tsk)
45{ 45{
46 return container_of(task_subsys_state(tsk, cpuacct_subsys_id), 46 return container_of(task_css(tsk, cpuacct_subsys_id),
47 struct cpuacct, css); 47 struct cpuacct, css);
48} 48}
49 49
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index ef0a7b2439dd..471a56db05ea 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -665,9 +665,9 @@ extern int group_balance_cpu(struct sched_group *sg);
665/* 665/*
666 * Return the group to which this tasks belongs. 666 * Return the group to which this tasks belongs.
667 * 667 *
668 * We cannot use task_subsys_state() and friends because the cgroup 668 * We cannot use task_css() and friends because the cgroup subsystem
669 * subsystem changes that value before the cgroup_subsys::attach() method 669 * changes that value before the cgroup_subsys::attach() method is called,
670 * is called, therefore we cannot pin it and might observe the wrong value. 670 * therefore we cannot pin it and might observe the wrong value.
671 * 671 *
672 * The same is true for autogroup's p->signal->autogroup->tg, the autogroup 672 * The same is true for autogroup's p->signal->autogroup->tg, the autogroup
673 * core changes this before calling sched_move_task(). 673 * core changes this before calling sched_move_task().
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index 9cea7de22ffb..50f213fc52c7 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -42,15 +42,13 @@ struct hugetlb_cgroup *hugetlb_cgroup_from_css(struct cgroup_subsys_state *s)
42static inline 42static inline
43struct hugetlb_cgroup *hugetlb_cgroup_from_cgroup(struct cgroup *cgroup) 43struct hugetlb_cgroup *hugetlb_cgroup_from_cgroup(struct cgroup *cgroup)
44{ 44{
45 return hugetlb_cgroup_from_css(cgroup_subsys_state(cgroup, 45 return hugetlb_cgroup_from_css(cgroup_css(cgroup, hugetlb_subsys_id));
46 hugetlb_subsys_id));
47} 46}
48 47
49static inline 48static inline
50struct hugetlb_cgroup *hugetlb_cgroup_from_task(struct task_struct *task) 49struct hugetlb_cgroup *hugetlb_cgroup_from_task(struct task_struct *task)
51{ 50{
52 return hugetlb_cgroup_from_css(task_subsys_state(task, 51 return hugetlb_cgroup_from_css(task_css(task, hugetlb_subsys_id));
53 hugetlb_subsys_id));
54} 52}
55 53
56static inline bool hugetlb_cgroup_is_root(struct hugetlb_cgroup *h_cg) 54static inline bool hugetlb_cgroup_is_root(struct hugetlb_cgroup *h_cg)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d12ca6f3c293..b47bd3ad3c2b 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1037,8 +1037,7 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)
1037 1037
1038struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont) 1038struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont)
1039{ 1039{
1040 return mem_cgroup_from_css( 1040 return mem_cgroup_from_css(cgroup_css(cont, mem_cgroup_subsys_id));
1041 cgroup_subsys_state(cont, mem_cgroup_subsys_id));
1042} 1041}
1043 1042
1044struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p) 1043struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p)
@@ -1051,7 +1050,7 @@ struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p)
1051 if (unlikely(!p)) 1050 if (unlikely(!p))
1052 return NULL; 1051 return NULL;
1053 1052
1054 return mem_cgroup_from_css(task_subsys_state(p, mem_cgroup_subsys_id)); 1053 return mem_cgroup_from_css(task_css(p, mem_cgroup_subsys_id));
1055} 1054}
1056 1055
1057struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm) 1056struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
diff --git a/mm/vmpressure.c b/mm/vmpressure.c
index 736a6011c2c8..7f1654d3cec7 100644
--- a/mm/vmpressure.c
+++ b/mm/vmpressure.c
@@ -76,7 +76,7 @@ static struct vmpressure *work_to_vmpressure(struct work_struct *work)
76 76
77static struct vmpressure *cg_to_vmpressure(struct cgroup *cg) 77static struct vmpressure *cg_to_vmpressure(struct cgroup *cg)
78{ 78{
79 return css_to_vmpressure(cgroup_subsys_state(cg, mem_cgroup_subsys_id)); 79 return css_to_vmpressure(cgroup_css(cg, mem_cgroup_subsys_id));
80} 80}
81 81
82static struct vmpressure *vmpressure_parent(struct vmpressure *vmpr) 82static struct vmpressure *vmpressure_parent(struct vmpressure *vmpr)
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index e533259dce3c..ccf852311987 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -31,7 +31,7 @@
31 31
32static inline struct cgroup_netprio_state *cgrp_netprio_state(struct cgroup *cgrp) 32static inline struct cgroup_netprio_state *cgrp_netprio_state(struct cgroup *cgrp)
33{ 33{
34 return container_of(cgroup_subsys_state(cgrp, net_prio_subsys_id), 34 return container_of(cgroup_css(cgrp, net_prio_subsys_id),
35 struct cgroup_netprio_state, css); 35 struct cgroup_netprio_state, css);
36} 36}
37 37
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 3a294eb98d61..5ee72a001df0 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -25,13 +25,13 @@
25 25
26static inline struct cgroup_cls_state *cgrp_cls_state(struct cgroup *cgrp) 26static inline struct cgroup_cls_state *cgrp_cls_state(struct cgroup *cgrp)
27{ 27{
28 return container_of(cgroup_subsys_state(cgrp, net_cls_subsys_id), 28 return container_of(cgroup_css(cgrp, net_cls_subsys_id),
29 struct cgroup_cls_state, css); 29 struct cgroup_cls_state, css);
30} 30}
31 31
32static inline struct cgroup_cls_state *task_cls_state(struct task_struct *p) 32static inline struct cgroup_cls_state *task_cls_state(struct task_struct *p)
33{ 33{
34 return container_of(task_subsys_state(p, net_cls_subsys_id), 34 return container_of(task_css(p, net_cls_subsys_id),
35 struct cgroup_cls_state, css); 35 struct cgroup_cls_state, css);
36} 36}
37 37
diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index e8aad69f0d69..87a0a037fbd6 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -58,12 +58,12 @@ static inline struct dev_cgroup *css_to_devcgroup(struct cgroup_subsys_state *s)
58 58
59static inline struct dev_cgroup *cgroup_to_devcgroup(struct cgroup *cgroup) 59static inline struct dev_cgroup *cgroup_to_devcgroup(struct cgroup *cgroup)
60{ 60{
61 return css_to_devcgroup(cgroup_subsys_state(cgroup, devices_subsys_id)); 61 return css_to_devcgroup(cgroup_css(cgroup, devices_subsys_id));
62} 62}
63 63
64static inline struct dev_cgroup *task_devcgroup(struct task_struct *task) 64static inline struct dev_cgroup *task_devcgroup(struct task_struct *task)
65{ 65{
66 return css_to_devcgroup(task_subsys_state(task, devices_subsys_id)); 66 return css_to_devcgroup(task_css(task, devices_subsys_id));
67} 67}
68 68
69struct cgroup_subsys devices_subsys; 69struct cgroup_subsys devices_subsys;