summaryrefslogtreecommitdiff
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2011-10-04 03:23:12 (GMT)
committerDavid Sterba <dsterba@suse.cz>2012-03-22 00:45:33 (GMT)
commit0417341e6bd93e2a2ceac0e57409706803b335e5 (patch)
tree718f160e8b4edaa31d1747b6996fc60623903227 /fs/btrfs/inode.c
parentb45a9d8b48e5ce534bd222007c43cbf374544f0b (diff)
downloadlinux-fsl-qoriq-0417341e6bd93e2a2ceac0e57409706803b335e5.tar.xz
btrfs: Simplify btrfs_submit_bio_hook
btrfs_submit_bio_hook currently calls btrfs_bio_wq_end_io in either case of an if statement that determines one of the arguments. This patch moves the function call outside of the if statement and uses it to only determine the different argument. This allows us to catch an error in one place in a more visually obvious way. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 892b347..f0dfd7d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1479,13 +1479,14 @@ static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
struct btrfs_root *root = BTRFS_I(inode)->root;
int ret = 0;
int skip_sum;
+ int metadata = 0;
skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM;
if (btrfs_is_free_space_inode(root, inode))
- ret = btrfs_bio_wq_end_io(root->fs_info, bio, 2);
- else
- ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0);
+ metadata = 2;
+
+ ret = btrfs_bio_wq_end_io(root->fs_info, bio, metadata);
BUG_ON(ret);
if (!(rw & REQ_WRITE)) {