btrfs: btrfs_bio_clone never fails, skip error handling
authorDavid Sterba <dsterba@suse.com>
Fri, 2 Jun 2017 15:38:30 +0000 (17:38 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2017 16:26:02 +0000 (18:26 +0200)
Update direct callers of btrfs_bio_clone that do error handling, that we
can now remove.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c
fs/btrfs/volumes.c

index 4e33c3fded5ca9484c4c74bc052e57bea9b2ad1c..1fde50a430a9e9cc4036242e806729090278c46c 100644 (file)
@@ -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) {
index e28c113785bbf323b95474b4afde541b8a3f1575..ea9912157a56363304c9766a755cb0fda288569d 100644 (file)
@@ -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,