diff options
author | Chao Yu <chao2.yu@samsung.com> | 2013-11-28 02:43:43 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-12-22 20:18:05 -0500 |
commit | 8f99a946f360c4083d6e323e10a5928e1ce385a4 (patch) | |
tree | 7ea7e26398fbb0e11b7c696d30d419729f7cf2ff /fs | |
parent | 1069bbf7b963d31d5532c36d43a02b0447e5bcfa (diff) |
f2fs: convert recover_orphan_inodes to void
The recover_orphan_inodes() returns no error all the time, so we don't need to
check its errors.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
[Jaegeuk Kim: add description]
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/checkpoint.c | 6 | ||||
-rw-r--r-- | fs/f2fs/f2fs.h | 2 | ||||
-rw-r--r-- | fs/f2fs/super.c | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index c7e0572fdede..40eea42f85ff 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c | |||
@@ -271,12 +271,12 @@ static void recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino) | |||
271 | iput(inode); | 271 | iput(inode); |
272 | } | 272 | } |
273 | 273 | ||
274 | int recover_orphan_inodes(struct f2fs_sb_info *sbi) | 274 | void recover_orphan_inodes(struct f2fs_sb_info *sbi) |
275 | { | 275 | { |
276 | block_t start_blk, orphan_blkaddr, i, j; | 276 | block_t start_blk, orphan_blkaddr, i, j; |
277 | 277 | ||
278 | if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG)) | 278 | if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG)) |
279 | return 0; | 279 | return; |
280 | 280 | ||
281 | sbi->por_doing = true; | 281 | sbi->por_doing = true; |
282 | start_blk = __start_cp_addr(sbi) + 1; | 282 | start_blk = __start_cp_addr(sbi) + 1; |
@@ -296,7 +296,7 @@ int recover_orphan_inodes(struct f2fs_sb_info *sbi) | |||
296 | /* clear Orphan Flag */ | 296 | /* clear Orphan Flag */ |
297 | clear_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG); | 297 | clear_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG); |
298 | sbi->por_doing = false; | 298 | sbi->por_doing = false; |
299 | return 0; | 299 | return; |
300 | } | 300 | } |
301 | 301 | ||
302 | static void write_orphan_inodes(struct f2fs_sb_info *sbi, block_t start_blk) | 302 | static void write_orphan_inodes(struct f2fs_sb_info *sbi, block_t start_blk) |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 9a76c83937b1..ca33cda78e02 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -1126,7 +1126,7 @@ int acquire_orphan_inode(struct f2fs_sb_info *); | |||
1126 | void release_orphan_inode(struct f2fs_sb_info *); | 1126 | void release_orphan_inode(struct f2fs_sb_info *); |
1127 | void add_orphan_inode(struct f2fs_sb_info *, nid_t); | 1127 | void add_orphan_inode(struct f2fs_sb_info *, nid_t); |
1128 | void remove_orphan_inode(struct f2fs_sb_info *, nid_t); | 1128 | void remove_orphan_inode(struct f2fs_sb_info *, nid_t); |
1129 | int recover_orphan_inodes(struct f2fs_sb_info *); | 1129 | void recover_orphan_inodes(struct f2fs_sb_info *); |
1130 | int get_valid_checkpoint(struct f2fs_sb_info *); | 1130 | int get_valid_checkpoint(struct f2fs_sb_info *); |
1131 | void set_dirty_dir_page(struct inode *, struct page *); | 1131 | void set_dirty_dir_page(struct inode *, struct page *); |
1132 | void add_dirty_dir_inode(struct inode *); | 1132 | void add_dirty_dir_inode(struct inode *); |
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 43f11cae408b..dd55074a304f 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -952,9 +952,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) | |||
952 | } | 952 | } |
953 | 953 | ||
954 | /* if there are nt orphan nodes free them */ | 954 | /* if there are nt orphan nodes free them */ |
955 | err = -EINVAL; | 955 | recover_orphan_inodes(sbi); |
956 | if (recover_orphan_inodes(sbi)) | ||
957 | goto free_node_inode; | ||
958 | 956 | ||
959 | /* read root inode and dentry */ | 957 | /* read root inode and dentry */ |
960 | root = f2fs_iget(sb, F2FS_ROOT_INO(sbi)); | 958 | root = f2fs_iget(sb, F2FS_ROOT_INO(sbi)); |
@@ -963,8 +961,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) | |||
963 | err = PTR_ERR(root); | 961 | err = PTR_ERR(root); |
964 | goto free_node_inode; | 962 | goto free_node_inode; |
965 | } | 963 | } |
966 | if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) | 964 | if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) { |
965 | err = -EINVAL; | ||
967 | goto free_root_inode; | 966 | goto free_root_inode; |
967 | } | ||
968 | 968 | ||
969 | sb->s_root = d_make_root(root); /* allocate root dentry */ | 969 | sb->s_root = d_make_root(root); /* allocate root dentry */ |
970 | if (!sb->s_root) { | 970 | if (!sb->s_root) { |