btrfs: btrfs_iget never returns an is_bad_inode inode
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 Jul 2018 22:04:45 +0000 (23:04 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:13:02 +0000 (13:13 +0200)
Just get rid of pointless checks.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/free-space-cache.c
fs/btrfs/relocation.c
fs/btrfs/tree-log.c

index 57e7ab7f5e03c310a45290f63dd0567c523bb6e7..0adf38b00fa0477f7a36d2570246213b9442ab23 100644 (file)
@@ -71,10 +71,6 @@ static struct inode *__lookup_free_space_inode(struct btrfs_root *root,
        inode = btrfs_iget(fs_info->sb, &location, root, NULL);
        if (IS_ERR(inode))
                return inode;
-       if (is_bad_inode(inode)) {
-               iput(inode);
-               return ERR_PTR(-ENOENT);
-       }
 
        mapping_set_gfp_mask(inode->i_mapping,
                        mapping_gfp_constraint(inode->i_mapping,
index d6bcf558789e6c05e1fc78567329d1bab1a103b7..8783a1776540fbb214a6d464858d9a9fb36be843 100644 (file)
@@ -3470,11 +3470,8 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info,
        key.offset = 0;
 
        inode = btrfs_iget(fs_info->sb, &key, root, NULL);
-       if (IS_ERR(inode) || is_bad_inode(inode)) {
-               if (!IS_ERR(inode))
-                       iput(inode);
+       if (IS_ERR(inode))
                return -ENOENT;
-       }
 
 truncate:
        ret = btrfs_check_trunc_cache_free_space(fs_info,
@@ -4155,7 +4152,7 @@ struct inode *create_reloc_inode(struct btrfs_fs_info *fs_info,
        key.type = BTRFS_INODE_ITEM_KEY;
        key.offset = 0;
        inode = btrfs_iget(fs_info->sb, &key, root, NULL);
-       BUG_ON(IS_ERR(inode) || is_bad_inode(inode));
+       BUG_ON(IS_ERR(inode));
        BTRFS_I(inode)->index_cnt = group->key.objectid;
 
        err = btrfs_orphan_add(trans, BTRFS_I(inode));
index 033aeebbe9de237919a5d6860e497529c04d9f71..730b97dee95550b6ea4a8605e3c311fd52b869d6 100644 (file)
@@ -545,12 +545,8 @@ static noinline struct inode *read_one_inode(struct btrfs_root *root,
        key.type = BTRFS_INODE_ITEM_KEY;
        key.offset = 0;
        inode = btrfs_iget(root->fs_info->sb, &key, root, NULL);
-       if (IS_ERR(inode)) {
+       if (IS_ERR(inode))
                inode = NULL;
-       } else if (is_bad_inode(inode)) {
-               iput(inode);
-               inode = NULL;
-       }
        return inode;
 }