diff options
Diffstat (limited to 'mm/vmstat.c')
-rw-r--r-- | mm/vmstat.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c index 0dad31dc1618..1bbbbd9776ad 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -1223,7 +1223,6 @@ module_init(setup_vmstat) | |||
1223 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_COMPACTION) | 1223 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_COMPACTION) |
1224 | #include <linux/debugfs.h> | 1224 | #include <linux/debugfs.h> |
1225 | 1225 | ||
1226 | static struct dentry *extfrag_debug_root; | ||
1227 | 1226 | ||
1228 | /* | 1227 | /* |
1229 | * Return an index indicating how much of the available free memory is | 1228 | * Return an index indicating how much of the available free memory is |
@@ -1361,19 +1360,24 @@ static const struct file_operations extfrag_file_ops = { | |||
1361 | 1360 | ||
1362 | static int __init extfrag_debug_init(void) | 1361 | static int __init extfrag_debug_init(void) |
1363 | { | 1362 | { |
1363 | struct dentry *extfrag_debug_root; | ||
1364 | |||
1364 | extfrag_debug_root = debugfs_create_dir("extfrag", NULL); | 1365 | extfrag_debug_root = debugfs_create_dir("extfrag", NULL); |
1365 | if (!extfrag_debug_root) | 1366 | if (!extfrag_debug_root) |
1366 | return -ENOMEM; | 1367 | return -ENOMEM; |
1367 | 1368 | ||
1368 | if (!debugfs_create_file("unusable_index", 0444, | 1369 | if (!debugfs_create_file("unusable_index", 0444, |
1369 | extfrag_debug_root, NULL, &unusable_file_ops)) | 1370 | extfrag_debug_root, NULL, &unusable_file_ops)) |
1370 | return -ENOMEM; | 1371 | goto fail; |
1371 | 1372 | ||
1372 | if (!debugfs_create_file("extfrag_index", 0444, | 1373 | if (!debugfs_create_file("extfrag_index", 0444, |
1373 | extfrag_debug_root, NULL, &extfrag_file_ops)) | 1374 | extfrag_debug_root, NULL, &extfrag_file_ops)) |
1374 | return -ENOMEM; | 1375 | goto fail; |
1375 | 1376 | ||
1376 | return 0; | 1377 | return 0; |
1378 | fail: | ||
1379 | debugfs_remove_recursive(extfrag_debug_root); | ||
1380 | return -ENOMEM; | ||
1377 | } | 1381 | } |
1378 | 1382 | ||
1379 | module_init(extfrag_debug_init); | 1383 | module_init(extfrag_debug_init); |