The function mem_cgroup_register_cftype() is provided here, so an optional memcg subsystem that needs to register files at a time later than memcg initialization can do it. Signed-off-by: Glauber Costa <glommer@xxxxxxxxxxxxx> CC: Tejun Heo <tj@xxxxxxxxxx> CC: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx> --- include/linux/memcontrol.h | 1 + mm/memcontrol.c | 6 ++++++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 4d34356..bcf8de3 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -141,6 +141,7 @@ static inline bool mem_cgroup_disabled(void) return false; } +int mem_cgroup_register_cftype(const struct cftype *cfts); void mem_cgroup_update_page_stat(struct page *page, enum mem_cgroup_page_stat_item idx, int val); diff --git a/mm/memcontrol.c b/mm/memcontrol.c index f7c6727..bd91a46 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -444,6 +444,12 @@ struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg) return &memcg->css; } +int mem_cgroup_register_cftype(const struct cftype *cfts) +{ + return WARN_ON(cgroup_add_cftypes(&mem_cgroup_subsys, cfts)); +} +EXPORT_SYMBOL(mem_cgroup_register_cftype); + static struct mem_cgroup_per_zone * page_cgroup_zoneinfo(struct mem_cgroup *memcg, struct page *page) { -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe cgroups" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html