diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-07-29 18:04:45 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-08-06 07:13:02 -0400 |
commit | 2e19f1f9d31b3515356710b8bdfb655f47a98448 (patch) | |
tree | 41d6d39adc85c8d15a21974f995565cce1391b31 /fs/btrfs | |
parent | 1e7e1f9e3aba00c9b9c323bfeeddafe69ff21ff6 (diff) |
btrfs: btrfs_iget never returns an is_bad_inode inode
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/free-space-cache.c | 4 | ||||
-rw-r--r-- | fs/btrfs/relocation.c | 7 | ||||
-rw-r--r-- | fs/btrfs/tree-log.c | 6 |
3 files changed, 3 insertions, 14 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 57e7ab7f5e03..0adf38b00fa0 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
@@ -71,10 +71,6 @@ static struct inode *__lookup_free_space_inode(struct btrfs_root *root, | |||
71 | inode = btrfs_iget(fs_info->sb, &location, root, NULL); | 71 | inode = btrfs_iget(fs_info->sb, &location, root, NULL); |
72 | if (IS_ERR(inode)) | 72 | if (IS_ERR(inode)) |
73 | return inode; | 73 | return inode; |
74 | if (is_bad_inode(inode)) { | ||
75 | iput(inode); | ||
76 | return ERR_PTR(-ENOENT); | ||
77 | } | ||
78 | 74 | ||
79 | mapping_set_gfp_mask(inode->i_mapping, | 75 | mapping_set_gfp_mask(inode->i_mapping, |
80 | mapping_gfp_constraint(inode->i_mapping, | 76 | mapping_gfp_constraint(inode->i_mapping, |
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index d6bcf558789e..8783a1776540 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -3470,11 +3470,8 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info, | |||
3470 | key.offset = 0; | 3470 | key.offset = 0; |
3471 | 3471 | ||
3472 | inode = btrfs_iget(fs_info->sb, &key, root, NULL); | 3472 | inode = btrfs_iget(fs_info->sb, &key, root, NULL); |
3473 | if (IS_ERR(inode) || is_bad_inode(inode)) { | 3473 | if (IS_ERR(inode)) |
3474 | if (!IS_ERR(inode)) | ||
3475 | iput(inode); | ||
3476 | return -ENOENT; | 3474 | return -ENOENT; |
3477 | } | ||
3478 | 3475 | ||
3479 | truncate: | 3476 | truncate: |
3480 | ret = btrfs_check_trunc_cache_free_space(fs_info, | 3477 | ret = btrfs_check_trunc_cache_free_space(fs_info, |
@@ -4155,7 +4152,7 @@ struct inode *create_reloc_inode(struct btrfs_fs_info *fs_info, | |||
4155 | key.type = BTRFS_INODE_ITEM_KEY; | 4152 | key.type = BTRFS_INODE_ITEM_KEY; |
4156 | key.offset = 0; | 4153 | key.offset = 0; |
4157 | inode = btrfs_iget(fs_info->sb, &key, root, NULL); | 4154 | inode = btrfs_iget(fs_info->sb, &key, root, NULL); |
4158 | BUG_ON(IS_ERR(inode) || is_bad_inode(inode)); | 4155 | BUG_ON(IS_ERR(inode)); |
4159 | BTRFS_I(inode)->index_cnt = group->key.objectid; | 4156 | BTRFS_I(inode)->index_cnt = group->key.objectid; |
4160 | 4157 | ||
4161 | err = btrfs_orphan_add(trans, BTRFS_I(inode)); | 4158 | err = btrfs_orphan_add(trans, BTRFS_I(inode)); |
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 033aeebbe9de..730b97dee955 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -545,12 +545,8 @@ static noinline struct inode *read_one_inode(struct btrfs_root *root, | |||
545 | key.type = BTRFS_INODE_ITEM_KEY; | 545 | key.type = BTRFS_INODE_ITEM_KEY; |
546 | key.offset = 0; | 546 | key.offset = 0; |
547 | inode = btrfs_iget(root->fs_info->sb, &key, root, NULL); | 547 | inode = btrfs_iget(root->fs_info->sb, &key, root, NULL); |
548 | if (IS_ERR(inode)) { | 548 | if (IS_ERR(inode)) |
549 | inode = NULL; | 549 | inode = NULL; |
550 | } else if (is_bad_inode(inode)) { | ||
551 | iput(inode); | ||
552 | inode = NULL; | ||
553 | } | ||
554 | return inode; | 550 | return inode; |
555 | } | 551 | } |
556 | 552 | ||