diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2013-08-23 04:34:43 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-09-01 08:16:29 -0400 |
commit | 23fa76b0ba78b7d84708d9ee683587d8a5bbceef (patch) | |
tree | 10f09a05563e978d57228943f83fd1cf1c21d388 /fs/btrfs | |
parent | 48475471728f060bfd2e686f592ef208d3ba8b7d (diff) |
Btrf: cleanup: don't check for root_refs == 0 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 three more places.
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/file.c | 5 | ||||
-rw-r--r-- | fs/btrfs/relocation.c | 3 | ||||
-rw-r--r-- | fs/btrfs/scrub.c | 5 |
3 files changed, 0 insertions, 13 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 5e7ea996f105..5ba87b0d2ef8 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -310,11 +310,6 @@ static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info, | |||
310 | goto cleanup; | 310 | goto cleanup; |
311 | } | 311 | } |
312 | 312 | ||
313 | if (btrfs_root_refs(&inode_root->root_item) == 0) { | ||
314 | ret = -ENOENT; | ||
315 | goto cleanup; | ||
316 | } | ||
317 | |||
318 | key.objectid = defrag->ino; | 313 | key.objectid = defrag->ino; |
319 | btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY); | 314 | btrfs_set_key_type(&key, BTRFS_INODE_ITEM_KEY); |
320 | key.offset = 0; | 315 | key.offset = 0; |
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index cf5e30ff7093..aacc2121e87c 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -2354,9 +2354,6 @@ again: | |||
2354 | if (IS_ERR(root)) | 2354 | if (IS_ERR(root)) |
2355 | continue; | 2355 | continue; |
2356 | 2356 | ||
2357 | if (btrfs_root_refs(&root->root_item) == 0) | ||
2358 | continue; | ||
2359 | |||
2360 | trans = btrfs_join_transaction(root); | 2357 | trans = btrfs_join_transaction(root); |
2361 | BUG_ON(IS_ERR(trans)); | 2358 | BUG_ON(IS_ERR(trans)); |
2362 | 2359 | ||
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index ec6a33a20200..0afcd452fcb3 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -3217,11 +3217,6 @@ static int copy_nocow_pages_for_inode(u64 inum, u64 offset, u64 root, void *ctx) | |||
3217 | return PTR_ERR(local_root); | 3217 | return PTR_ERR(local_root); |
3218 | } | 3218 | } |
3219 | 3219 | ||
3220 | if (btrfs_root_refs(&local_root->root_item) == 0) { | ||
3221 | srcu_read_unlock(&fs_info->subvol_srcu, srcu_index); | ||
3222 | return -ENOENT; | ||
3223 | } | ||
3224 | |||
3225 | key.type = BTRFS_INODE_ITEM_KEY; | 3220 | key.type = BTRFS_INODE_ITEM_KEY; |
3226 | key.objectid = inum; | 3221 | key.objectid = inum; |
3227 | key.offset = 0; | 3222 | key.offset = 0; |