aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-08-08 20:11:26 -0400
committerTejun Heo <tj@kernel.org>2013-08-08 20:11:26 -0400
commit81eeaf0411204f52af8ef78ff107cfca2fcfec1d (patch)
tree50ef753a5f351d9b838c0fbcf16f9e3b3723cc15 /include
parent72ec7029937f0518eff21b8762743c31591684f5 (diff)
cgroup: make cftype->[un]register_event() deal with cgroup_subsys_state instead of cgroup
cgroup is in the process of converting to css (cgroup_subsys_state) from cgroup as the principal subsystem interface handle. This is mostly to prepare for the unified hierarchy support where css's will be created and destroyed dynamically but also helps cleaning up subsystem implementations as css is usually what they are interested in anyway. cftype->[un]register_event() is among the remaining couple interfaces which still use struct cgroup. Convert it to cgroup_subsys_state. The conversion is mostly mechanical and removes the last users of mem_cgroup_from_cont() and cg_to_vmpressure(), which are removed. v2: indentation update as suggested by Li Zefan. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Balbir Singh <bsingharora@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/cgroup.h10
-rw-r--r--include/linux/vmpressure.h6
2 files changed, 10 insertions, 6 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index cd105fce089c..b065d24486e6 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -506,16 +506,18 @@ struct cftype {
506 * you want to provide this functionality. Use eventfd_signal() 506 * you want to provide this functionality. Use eventfd_signal()
507 * on eventfd to send notification to userspace. 507 * on eventfd to send notification to userspace.
508 */ 508 */
509 int (*register_event)(struct cgroup *cgrp, struct cftype *cft, 509 int (*register_event)(struct cgroup_subsys_state *css,
510 struct eventfd_ctx *eventfd, const char *args); 510 struct cftype *cft, struct eventfd_ctx *eventfd,
511 const char *args);
511 /* 512 /*
512 * unregister_event() callback will be called when userspace 513 * unregister_event() callback will be called when userspace
513 * closes the eventfd or on cgroup removing. 514 * closes the eventfd or on cgroup removing.
514 * This callback must be implemented, if you want provide 515 * This callback must be implemented, if you want provide
515 * notification functionality. 516 * notification functionality.
516 */ 517 */
517 void (*unregister_event)(struct cgroup *cgrp, struct cftype *cft, 518 void (*unregister_event)(struct cgroup_subsys_state *css,
518 struct eventfd_ctx *eventfd); 519 struct cftype *cft,
520 struct eventfd_ctx *eventfd);
519}; 521};
520 522
521/* 523/*
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h
index 76be077340ea..b239482bd39d 100644
--- a/include/linux/vmpressure.h
+++ b/include/linux/vmpressure.h
@@ -33,10 +33,12 @@ extern void vmpressure_init(struct vmpressure *vmpr);
33extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); 33extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg);
34extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); 34extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr);
35extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); 35extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css);
36extern int vmpressure_register_event(struct cgroup *cg, struct cftype *cft, 36extern int vmpressure_register_event(struct cgroup_subsys_state *css,
37 struct cftype *cft,
37 struct eventfd_ctx *eventfd, 38 struct eventfd_ctx *eventfd,
38 const char *args); 39 const char *args);
39extern void vmpressure_unregister_event(struct cgroup *cg, struct cftype *cft, 40extern void vmpressure_unregister_event(struct cgroup_subsys_state *css,
41 struct cftype *cft,
40 struct eventfd_ctx *eventfd); 42 struct eventfd_ctx *eventfd);
41#else 43#else
42static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, 44static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,