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>
This commit is contained in:
parent
72ec702993
commit
81eeaf0411
5 changed files with 35 additions and 38 deletions
|
|
@ -506,16 +506,18 @@ struct cftype {
|
|||
* you want to provide this functionality. Use eventfd_signal()
|
||||
* on eventfd to send notification to userspace.
|
||||
*/
|
||||
int (*register_event)(struct cgroup *cgrp, struct cftype *cft,
|
||||
struct eventfd_ctx *eventfd, const char *args);
|
||||
int (*register_event)(struct cgroup_subsys_state *css,
|
||||
struct cftype *cft, struct eventfd_ctx *eventfd,
|
||||
const char *args);
|
||||
/*
|
||||
* unregister_event() callback will be called when userspace
|
||||
* closes the eventfd or on cgroup removing.
|
||||
* This callback must be implemented, if you want provide
|
||||
* notification functionality.
|
||||
*/
|
||||
void (*unregister_event)(struct cgroup *cgrp, struct cftype *cft,
|
||||
struct eventfd_ctx *eventfd);
|
||||
void (*unregister_event)(struct cgroup_subsys_state *css,
|
||||
struct cftype *cft,
|
||||
struct eventfd_ctx *eventfd);
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -33,10 +33,12 @@ extern void vmpressure_init(struct vmpressure *vmpr);
|
|||
extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg);
|
||||
extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr);
|
||||
extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css);
|
||||
extern int vmpressure_register_event(struct cgroup *cg, struct cftype *cft,
|
||||
extern int vmpressure_register_event(struct cgroup_subsys_state *css,
|
||||
struct cftype *cft,
|
||||
struct eventfd_ctx *eventfd,
|
||||
const char *args);
|
||||
extern void vmpressure_unregister_event(struct cgroup *cg, struct cftype *cft,
|
||||
extern void vmpressure_unregister_event(struct cgroup_subsys_state *css,
|
||||
struct cftype *cft,
|
||||
struct eventfd_ctx *eventfd);
|
||||
#else
|
||||
static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue