aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/f2fs/debug.c20
-rw-r--r--fs/f2fs/f2fs.h4
-rw-r--r--fs/f2fs/super.c5
3 files changed, 6 insertions, 23 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index 503fde8349e6..99e9a5c37b71 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -511,30 +511,16 @@ void f2fs_destroy_stats(struct f2fs_sb_info *sbi)
511 kvfree(si); 511 kvfree(si);
512} 512}
513 513
514int __init f2fs_create_root_stats(void) 514void __init f2fs_create_root_stats(void)
515{ 515{
516 struct dentry *file;
517
518 f2fs_debugfs_root = debugfs_create_dir("f2fs", NULL); 516 f2fs_debugfs_root = debugfs_create_dir("f2fs", NULL);
519 if (!f2fs_debugfs_root)
520 return -ENOMEM;
521 517
522 file = debugfs_create_file("status", S_IRUGO, f2fs_debugfs_root, 518 debugfs_create_file("status", S_IRUGO, f2fs_debugfs_root, NULL,
523 NULL, &stat_fops); 519 &stat_fops);
524 if (!file) {
525 debugfs_remove(f2fs_debugfs_root);
526 f2fs_debugfs_root = NULL;
527 return -ENOMEM;
528 }
529
530 return 0;
531} 520}
532 521
533void f2fs_destroy_root_stats(void) 522void f2fs_destroy_root_stats(void)
534{ 523{
535 if (!f2fs_debugfs_root)
536 return;
537
538 debugfs_remove_recursive(f2fs_debugfs_root); 524 debugfs_remove_recursive(f2fs_debugfs_root);
539 f2fs_debugfs_root = NULL; 525 f2fs_debugfs_root = NULL;
540} 526}
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 9286ec381453..7df41cd1eb35 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -3329,7 +3329,7 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
3329 3329
3330int f2fs_build_stats(struct f2fs_sb_info *sbi); 3330int f2fs_build_stats(struct f2fs_sb_info *sbi);
3331void f2fs_destroy_stats(struct f2fs_sb_info *sbi); 3331void f2fs_destroy_stats(struct f2fs_sb_info *sbi);
3332int __init f2fs_create_root_stats(void); 3332void __init f2fs_create_root_stats(void);
3333void f2fs_destroy_root_stats(void); 3333void f2fs_destroy_root_stats(void);
3334#else 3334#else
3335#define stat_inc_cp_count(si) do { } while (0) 3335#define stat_inc_cp_count(si) do { } while (0)
@@ -3367,7 +3367,7 @@ void f2fs_destroy_root_stats(void);
3367 3367
3368static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; } 3368static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; }
3369static inline void f2fs_destroy_stats(struct f2fs_sb_info *sbi) { } 3369static inline void f2fs_destroy_stats(struct f2fs_sb_info *sbi) { }
3370static inline int __init f2fs_create_root_stats(void) { return 0; } 3370static inline void __init f2fs_create_root_stats(void) { }
3371static inline void f2fs_destroy_root_stats(void) { } 3371static inline void f2fs_destroy_root_stats(void) { }
3372#endif 3372#endif
3373 3373
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index bc32a1035f65..ea514acede36 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -3550,9 +3550,7 @@ static int __init init_f2fs_fs(void)
3550 err = register_filesystem(&f2fs_fs_type); 3550 err = register_filesystem(&f2fs_fs_type);
3551 if (err) 3551 if (err)
3552 goto free_shrinker; 3552 goto free_shrinker;
3553 err = f2fs_create_root_stats(); 3553 f2fs_create_root_stats();
3554 if (err)
3555 goto free_filesystem;
3556 err = f2fs_init_post_read_processing(); 3554 err = f2fs_init_post_read_processing();
3557 if (err) 3555 if (err)
3558 goto free_root_stats; 3556 goto free_root_stats;
@@ -3560,7 +3558,6 @@ static int __init init_f2fs_fs(void)
3560 3558
3561free_root_stats: 3559free_root_stats:
3562 f2fs_destroy_root_stats(); 3560 f2fs_destroy_root_stats();
3563free_filesystem:
3564 unregister_filesystem(&f2fs_fs_type); 3561 unregister_filesystem(&f2fs_fs_type);
3565free_shrinker: 3562free_shrinker:
3566 unregister_shrinker(&f2fs_shrinker_info); 3563 unregister_shrinker(&f2fs_shrinker_info);