memcg: move charges to root cgroup if use_hierarchy=0
[pandora-kernel.git] / mm / vmstat.c
index 0dad31d..1bbbbd9 100644 (file)
@@ -1223,7 +1223,6 @@ module_init(setup_vmstat)
 #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_COMPACTION)
 #include <linux/debugfs.h>
 
-static struct dentry *extfrag_debug_root;
 
 /*
  * Return an index indicating how much of the available free memory is
@@ -1361,19 +1360,24 @@ static const struct file_operations extfrag_file_ops = {
 
 static int __init extfrag_debug_init(void)
 {
+       struct dentry *extfrag_debug_root;
+
        extfrag_debug_root = debugfs_create_dir("extfrag", NULL);
        if (!extfrag_debug_root)
                return -ENOMEM;
 
        if (!debugfs_create_file("unusable_index", 0444,
                        extfrag_debug_root, NULL, &unusable_file_ops))
-               return -ENOMEM;
+               goto fail;
 
        if (!debugfs_create_file("extfrag_index", 0444,
                        extfrag_debug_root, NULL, &extfrag_file_ops))
-               return -ENOMEM;
+               goto fail;
 
        return 0;
+fail:
+       debugfs_remove_recursive(extfrag_debug_root);
+       return -ENOMEM;
 }
 
 module_init(extfrag_debug_init);