summaryrefslogtreecommitdiff
path: root/drivers/md/dm-zoned-metadata.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-01-24 12:10:53 +0300
committerJens Axboe <axboe@kernel.dk>2022-02-02 17:49:59 +0300
commit53db984e004c7116ce69e2f4a163664453336ae1 (patch)
tree61bb0a5aeb27d9c456aae35a8831d025bb56f3bc /drivers/md/dm-zoned-metadata.c
parent39146b6f66ba5c107d5c5758a17f290846165b4d (diff)
downloadlinux-53db984e004c7116ce69e2f4a163664453336ae1.tar.xz
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 <hch@lst.de> Link: https://lore.kernel.org/r/20220124091107.642561-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/dm-zoned-metadata.c')
-rw-r--r--drivers/md/dm-zoned-metadata.c11
1 files changed, 0 insertions, 11 deletions
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);