From f41a95eadca98506e627b21f5cc73332bba4d95c Mon Sep 17 00:00:00 2001 From: Liujie Xie Date: Fri, 25 Jun 2021 22:16:33 +0800 Subject: [PATCH] ANDROID: Export memcg functions to allow module to add new files Export cgroup_add_legacy_cftypes and a helper function to allow vendor module to expose additional files in the memory cgroup hierarchy. Bug: 192052083 Signed-off-by: Liujie Xie Change-Id: Ie2b936b3e77c7ab6d740d1bb6d70e03c70a326a7 --- kernel/cgroup/cgroup.c | 1 + mm/memcontrol.c | 1 + 2 files changed, 2 insertions(+) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index eae1ce5569bf..b320eee4aa03 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -4123,6 +4123,7 @@ int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) cft->flags |= __CFTYPE_NOT_ON_DFL; return cgroup_add_cftypes(ss, cfts); } +EXPORT_SYMBOL_GPL(cgroup_add_legacy_cftypes); /** * cgroup_file_notify - generate a file modified event for a cgroup_file diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 8ced615688b9..a9fd9e511536 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5187,6 +5187,7 @@ struct mem_cgroup *mem_cgroup_from_id(unsigned short id) WARN_ON_ONCE(!rcu_read_lock_held()); return idr_find(&mem_cgroup_idr, id); } +EXPORT_SYMBOL_GPL(mem_cgroup_from_id); static int alloc_mem_cgroup_per_node_info(struct mem_cgroup *memcg, int node) {