From 53db984e004c7116ce69e2f4a163664453336ae1 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 24 Jan 2022 10:10:53 +0100 Subject: dm: bio_alloc can't fail if it is allowed to sleep Remove handling of NULL returns from sleeping bio_alloc calls given that those can't fail. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220124091107.642561-6-hch@lst.de Signed-off-by: Jens Axboe --- drivers/md/dm-zoned-metadata.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'drivers/md/dm-zoned-metadata.c') diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index ee4626d08557..5718b83cc718 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -551,10 +551,6 @@ static struct dmz_mblock *dmz_get_mblock_slow(struct dmz_metadata *zmd, return ERR_PTR(-ENOMEM); bio = bio_alloc(GFP_NOIO, 1); - if (!bio) { - dmz_free_mblock(zmd, mblk); - return ERR_PTR(-ENOMEM); - } spin_lock(&zmd->mblk_lock); @@ -726,10 +722,6 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, return -EIO; bio = bio_alloc(GFP_NOIO, 1); - if (!bio) { - set_bit(DMZ_META_ERROR, &mblk->state); - return -ENOMEM; - } set_bit(DMZ_META_WRITING, &mblk->state); @@ -760,9 +752,6 @@ static int dmz_rdwr_block(struct dmz_dev *dev, int op, return -EIO; bio = bio_alloc(GFP_NOIO, 1); - if (!bio) - return -ENOMEM; - bio->bi_iter.bi_sector = dmz_blk2sect(block); bio_set_dev(bio, dev->bdev); bio_set_op_attrs(bio, op, REQ_SYNC | REQ_META | REQ_PRIO); -- cgit v1.2.3