diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2013-05-13 09:53:35 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-06-14 11:29:30 -0400 |
commit | 3c64a1aba7cfcb04f79e76f859b3d66660275d59 (patch) | |
tree | b84ec1bcce88d60d5c3fd7a68d4dbcbdf985a6cb /fs/btrfs/inode.c | |
parent | b1b195969fe6d936f8c8bb63abf7efd2cc4cd5cf (diff) |
Btrfs: cleanup: don't check the same thing twice
btrfs_read_fs_root_no_name() already checks if btrfs_root_refs()
is zero and returns ENOENT in this case. There is no need to do
it again in six places.
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c931a4dbd031..3817c1e49035 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -2262,11 +2262,6 @@ static noinline int relink_extent_backref(struct btrfs_path *path, | |||
2262 | return 0; | 2262 | return 0; |
2263 | return PTR_ERR(root); | 2263 | return PTR_ERR(root); |
2264 | } | 2264 | } |
2265 | if (btrfs_root_refs(&root->root_item) == 0) { | ||
2266 | srcu_read_unlock(&fs_info->subvol_srcu, index); | ||
2267 | /* parse ENOENT to 0 */ | ||
2268 | return 0; | ||
2269 | } | ||
2270 | 2265 | ||
2271 | /* step 2: get inode */ | 2266 | /* step 2: get inode */ |
2272 | key.objectid = backref->inum; | 2267 | key.objectid = backref->inum; |
@@ -4821,11 +4816,6 @@ static int fixup_tree_root_location(struct btrfs_root *root, | |||
4821 | goto out; | 4816 | goto out; |
4822 | } | 4817 | } |
4823 | 4818 | ||
4824 | if (btrfs_root_refs(&new_root->root_item) == 0) { | ||
4825 | err = -ENOENT; | ||
4826 | goto out; | ||
4827 | } | ||
4828 | |||
4829 | *sub_root = new_root; | 4819 | *sub_root = new_root; |
4830 | location->objectid = btrfs_root_dirid(&new_root->root_item); | 4820 | location->objectid = btrfs_root_dirid(&new_root->root_item); |
4831 | location->type = BTRFS_INODE_ITEM_KEY; | 4821 | location->type = BTRFS_INODE_ITEM_KEY; |