aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 13867322cf5a..08a94c814bdc 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -119,7 +119,6 @@ static void f2fs_put_super(struct super_block *sb)
119int f2fs_sync_fs(struct super_block *sb, int sync) 119int f2fs_sync_fs(struct super_block *sb, int sync)
120{ 120{
121 struct f2fs_sb_info *sbi = F2FS_SB(sb); 121 struct f2fs_sb_info *sbi = F2FS_SB(sb);
122 int ret = 0;
123 122
124 if (!sbi->s_dirty && !get_pages(sbi, F2FS_DIRTY_NODES)) 123 if (!sbi->s_dirty && !get_pages(sbi, F2FS_DIRTY_NODES))
125 return 0; 124 return 0;
@@ -127,7 +126,7 @@ int f2fs_sync_fs(struct super_block *sb, int sync)
127 if (sync) 126 if (sync)
128 write_checkpoint(sbi, false, false); 127 write_checkpoint(sbi, false, false);
129 128
130 return ret; 129 return 0;
131} 130}
132 131
133static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf) 132static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
@@ -148,8 +147,8 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
148 buf->f_bfree = buf->f_blocks - valid_user_blocks(sbi) - ovp_count; 147 buf->f_bfree = buf->f_blocks - valid_user_blocks(sbi) - ovp_count;
149 buf->f_bavail = user_block_count - valid_user_blocks(sbi); 148 buf->f_bavail = user_block_count - valid_user_blocks(sbi);
150 149
151 buf->f_files = valid_inode_count(sbi); 150 buf->f_files = sbi->total_node_count;
152 buf->f_ffree = sbi->total_node_count - valid_node_count(sbi); 151 buf->f_ffree = sbi->total_node_count - valid_inode_count(sbi);
153 152
154 buf->f_namelen = F2FS_MAX_NAME_LEN; 153 buf->f_namelen = F2FS_MAX_NAME_LEN;
155 buf->f_fsid.val[0] = (u32)id; 154 buf->f_fsid.val[0] = (u32)id;
@@ -302,7 +301,7 @@ static int parse_options(struct f2fs_sb_info *sbi, char *options)
302 case Opt_active_logs: 301 case Opt_active_logs:
303 if (args->from && match_int(args, &arg)) 302 if (args->from && match_int(args, &arg))
304 return -EINVAL; 303 return -EINVAL;
305 if (arg != 2 && arg != 4 && arg != 6) 304 if (arg != 2 && arg != 4 && arg != NR_CURSEG_TYPE)
306 return -EINVAL; 305 return -EINVAL;
307 sbi->active_logs = arg; 306 sbi->active_logs = arg;
308 break; 307 break;
@@ -528,8 +527,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
528 527
529 /* if there are nt orphan nodes free them */ 528 /* if there are nt orphan nodes free them */
530 err = -EINVAL; 529 err = -EINVAL;
531 if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_UMOUNT_FLAG) && 530 if (recover_orphan_inodes(sbi))
532 recover_orphan_inodes(sbi))
533 goto free_node_inode; 531 goto free_node_inode;
534 532
535 /* read root inode and dentry */ 533 /* read root inode and dentry */
@@ -548,8 +546,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
548 } 546 }
549 547
550 /* recover fsynced data */ 548 /* recover fsynced data */
551 if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_UMOUNT_FLAG) && 549 if (!test_opt(sbi, DISABLE_ROLL_FORWARD))
552 !test_opt(sbi, DISABLE_ROLL_FORWARD))
553 recover_fsync_data(sbi); 550 recover_fsync_data(sbi);
554 551
555 /* After POR, we can run background GC thread */ 552 /* After POR, we can run background GC thread */