From: David Sterba Date: Fri, 2 Jun 2017 15:38:30 +0000 (+0200) Subject: btrfs: btrfs_bio_clone never fails, skip error handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3aa8e074ab2ec507b7380dd5d460fea83d92b66b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git btrfs: btrfs_bio_clone never fails, skip error handling Update direct callers of btrfs_bio_clone that do error handling, that we can now remove. Reviewed-by: Anand Jain Signed-off-by: David Sterba --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 4e33c3fded5c..1fde50a430a9 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8584,10 +8584,6 @@ static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode, skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; bio = btrfs_bio_clone(dio_bio, GFP_NOFS); - if (!bio) { - ret = -ENOMEM; - goto free_ordered; - } dip = kzalloc(sizeof(*dip), GFP_NOFS); if (!dip) { diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index e28c113785bb..ea9912157a56 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -6255,10 +6255,9 @@ int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio, continue; } - if (dev_nr < total_devs - 1) { + if (dev_nr < total_devs - 1) bio = btrfs_bio_clone(first_bio, GFP_NOFS); - BUG_ON(!bio); /* -ENOMEM */ - } else + else bio = first_bio; submit_stripe_bio(bbio, bio, bbio->stripes[dev_nr].physical,