diff options
Diffstat (limited to 'fs/f2fs/debug.c')
-rw-r--r-- | fs/f2fs/debug.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c index 73f034a94182..c8c37307b326 100644 --- a/fs/f2fs/debug.c +++ b/fs/f2fs/debug.c | |||
@@ -300,7 +300,7 @@ static const struct file_operations stat_fops = { | |||
300 | .release = single_release, | 300 | .release = single_release, |
301 | }; | 301 | }; |
302 | 302 | ||
303 | static int init_stats(struct f2fs_sb_info *sbi) | 303 | int f2fs_build_stats(struct f2fs_sb_info *sbi) |
304 | { | 304 | { |
305 | struct f2fs_super_block *raw_super = F2FS_RAW_SUPER(sbi); | 305 | struct f2fs_super_block *raw_super = F2FS_RAW_SUPER(sbi); |
306 | struct f2fs_stat_info *si; | 306 | struct f2fs_stat_info *si; |
@@ -327,21 +327,6 @@ static int init_stats(struct f2fs_sb_info *sbi) | |||
327 | return 0; | 327 | return 0; |
328 | } | 328 | } |
329 | 329 | ||
330 | int f2fs_build_stats(struct f2fs_sb_info *sbi) | ||
331 | { | ||
332 | int retval; | ||
333 | |||
334 | retval = init_stats(sbi); | ||
335 | if (retval) | ||
336 | return retval; | ||
337 | |||
338 | if (!debugfs_root) | ||
339 | debugfs_root = debugfs_create_dir("f2fs", NULL); | ||
340 | |||
341 | debugfs_create_file("status", S_IRUGO, debugfs_root, NULL, &stat_fops); | ||
342 | return 0; | ||
343 | } | ||
344 | |||
345 | void f2fs_destroy_stats(struct f2fs_sb_info *sbi) | 330 | void f2fs_destroy_stats(struct f2fs_sb_info *sbi) |
346 | { | 331 | { |
347 | struct f2fs_stat_info *si = sbi->stat_info; | 332 | struct f2fs_stat_info *si = sbi->stat_info; |
@@ -353,7 +338,15 @@ void f2fs_destroy_stats(struct f2fs_sb_info *sbi) | |||
353 | kfree(sbi->stat_info); | 338 | kfree(sbi->stat_info); |
354 | } | 339 | } |
355 | 340 | ||
356 | void destroy_root_stats(void) | 341 | void __init f2fs_create_root_stats(void) |
342 | { | ||
343 | debugfs_root = debugfs_create_dir("f2fs", NULL); | ||
344 | if (debugfs_root) | ||
345 | debugfs_create_file("status", S_IRUGO, debugfs_root, | ||
346 | NULL, &stat_fops); | ||
347 | } | ||
348 | |||
349 | void f2fs_destroy_root_stats(void) | ||
357 | { | 350 | { |
358 | debugfs_remove_recursive(debugfs_root); | 351 | debugfs_remove_recursive(debugfs_root); |
359 | debugfs_root = NULL; | 352 | debugfs_root = NULL; |