aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/debug.c')
-rw-r--r--fs/f2fs/debug.c20
1 files changed, 3 insertions, 17 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}