Thread (1 message) 1 message, 1 author, 2012-03-20

Re: [PATCH 3/4] provide a function to register more cftype files into memcg

From: Tejun Heo <hidden>
Date: 2012-03-20 18:32:33

Hey,

On Tue, Mar 20, 2012 at 08:50:55PM +0400, Glauber Costa wrote:
quoted hunk
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 <redacted>
CC: Tejun Heo <redacted>
CC: Aneesh Kumar K.V <redacted>
---
 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);
Why not just export mem_cgroup_subsys?

Thanks.

-- 
tejun
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help