提交 3aa8e074 编写于 作者: D David Sterba

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: NAnand Jain <anand.jain@oracle.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 0c4dd97c
...@@ -8584,10 +8584,6 @@ static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode, ...@@ -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; skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM;
bio = btrfs_bio_clone(dio_bio, GFP_NOFS); bio = btrfs_bio_clone(dio_bio, GFP_NOFS);
if (!bio) {
ret = -ENOMEM;
goto free_ordered;
}
dip = kzalloc(sizeof(*dip), GFP_NOFS); dip = kzalloc(sizeof(*dip), GFP_NOFS);
if (!dip) { if (!dip) {
......
...@@ -6255,10 +6255,9 @@ int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio, ...@@ -6255,10 +6255,9 @@ int btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
continue; continue;
} }
if (dev_nr < total_devs - 1) { if (dev_nr < total_devs - 1)
bio = btrfs_bio_clone(first_bio, GFP_NOFS); bio = btrfs_bio_clone(first_bio, GFP_NOFS);
BUG_ON(!bio); /* -ENOMEM */ else
} else
bio = first_bio; bio = first_bio;
submit_stripe_bio(bbio, bio, bbio->stripes[dev_nr].physical, submit_stripe_bio(bbio, bio, bbio->stripes[dev_nr].physical,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册