summaryrefslogtreecommitdiffstats
path: root/mm/mm_init.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2008-07-23 21:27:39 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 10:47:17 -0700
commitff7ea79cf7c3a481851bd4b2185fdeb6ce4afa29 (patch)
treeea0438b98c268584c28c8f5f8c331cb12c2c44b9 /mm/mm_init.c
parent5e9426abe209cf134adbbd62c5e73ef534eb73e9 (diff)
downloadop-kernel-dev-ff7ea79cf7c3a481851bd4b2185fdeb6ce4afa29.zip
op-kernel-dev-ff7ea79cf7c3a481851bd4b2185fdeb6ce4afa29.tar.gz
mm: create /sys/kernel/mm
Add a kobject to create /sys/kernel/mm when sysfs is mounted. The kobject will exist regardless. This will allow for the hugepage related sysfs directories to exist under the mm "subsystem" directory. Add an ABI file appropriately. [kosaki.motohiro@jp.fujitsu.com: fix build] Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Mel Gorman <mel@csn.ul.ie> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mm_init.c')
-rw-r--r--mm/mm_init.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mm/mm_init.c b/mm/mm_init.c
index eaf0d3b..c6af41e 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -7,6 +7,8 @@
*/
#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/kobject.h>
+#include <linux/module.h>
#include "internal.h"
#ifdef CONFIG_DEBUG_MEMORY_INIT
@@ -134,3 +136,17 @@ static __init int set_mminit_loglevel(char *str)
}
early_param("mminit_loglevel", set_mminit_loglevel);
#endif /* CONFIG_DEBUG_MEMORY_INIT */
+
+struct kobject *mm_kobj;
+EXPORT_SYMBOL_GPL(mm_kobj);
+
+static int __init mm_sysfs_init(void)
+{
+ mm_kobj = kobject_create_and_add("mm", kernel_kobj);
+ if (!mm_kobj)
+ return -ENOMEM;
+
+ return 0;
+}
+
+__initcall(mm_sysfs_init);
OpenPOWER on IntegriCloud