浏览代码

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>
Chao Yu 11 年之前
父节点
当前提交
8f99a946f3
共有 3 个文件被更改,包括 8 次插入8 次删除
  1. 3 3
      fs/f2fs/checkpoint.c
  2. 1 1
      fs/f2fs/f2fs.h
  3. 4 4
      fs/f2fs/super.c

+ 3 - 3
fs/f2fs/checkpoint.c

@@ -271,12 +271,12 @@ static void recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
 	iput(inode);
 	iput(inode);
 }
 }
 
 
-int recover_orphan_inodes(struct f2fs_sb_info *sbi)
+void recover_orphan_inodes(struct f2fs_sb_info *sbi)
 {
 {
 	block_t start_blk, orphan_blkaddr, i, j;
 	block_t start_blk, orphan_blkaddr, i, j;
 
 
 	if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG))
 	if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG))
-		return 0;
+		return;
 
 
 	sbi->por_doing = true;
 	sbi->por_doing = true;
 	start_blk = __start_cp_addr(sbi) + 1;
 	start_blk = __start_cp_addr(sbi) + 1;
@@ -296,7 +296,7 @@ int recover_orphan_inodes(struct f2fs_sb_info *sbi)
 	/* clear Orphan Flag */
 	/* clear Orphan Flag */
 	clear_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG);
 	clear_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG);
 	sbi->por_doing = false;
 	sbi->por_doing = false;
-	return 0;
+	return;
 }
 }
 
 
 static void write_orphan_inodes(struct f2fs_sb_info *sbi, block_t start_blk)
 static void write_orphan_inodes(struct f2fs_sb_info *sbi, block_t start_blk)

+ 1 - 1
fs/f2fs/f2fs.h

@@ -1126,7 +1126,7 @@ int acquire_orphan_inode(struct f2fs_sb_info *);
 void release_orphan_inode(struct f2fs_sb_info *);
 void release_orphan_inode(struct f2fs_sb_info *);
 void add_orphan_inode(struct f2fs_sb_info *, nid_t);
 void add_orphan_inode(struct f2fs_sb_info *, nid_t);
 void remove_orphan_inode(struct f2fs_sb_info *, nid_t);
 void remove_orphan_inode(struct f2fs_sb_info *, nid_t);
-int recover_orphan_inodes(struct f2fs_sb_info *);
+void recover_orphan_inodes(struct f2fs_sb_info *);
 int get_valid_checkpoint(struct f2fs_sb_info *);
 int get_valid_checkpoint(struct f2fs_sb_info *);
 void set_dirty_dir_page(struct inode *, struct page *);
 void set_dirty_dir_page(struct inode *, struct page *);
 void add_dirty_dir_inode(struct inode *);
 void add_dirty_dir_inode(struct inode *);

+ 4 - 4
fs/f2fs/super.c

@@ -952,9 +952,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 	}
 	}
 
 
 	/* if there are nt orphan nodes free them */
 	/* if there are nt orphan nodes free them */
-	err = -EINVAL;
-	if (recover_orphan_inodes(sbi))
-		goto free_node_inode;
+	recover_orphan_inodes(sbi);
 
 
 	/* read root inode and dentry */
 	/* read root inode and dentry */
 	root = f2fs_iget(sb, F2FS_ROOT_INO(sbi));
 	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)
 		err = PTR_ERR(root);
 		err = PTR_ERR(root);
 		goto free_node_inode;
 		goto free_node_inode;
 	}
 	}
-	if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size)
+	if (!S_ISDIR(root->i_mode) || !root->i_blocks || !root->i_size) {
+		err = -EINVAL;
 		goto free_root_inode;
 		goto free_root_inode;
+	}
 
 
 	sb->s_root = d_make_root(root); /* allocate root dentry */
 	sb->s_root = d_make_root(root); /* allocate root dentry */
 	if (!sb->s_root) {
 	if (!sb->s_root) {