Skip to contentSkip to conversation

block: Remove code handling bio_alloc failure with __GFP_WAIT

PATCH In review Nikanth Karthikesan 1 participant 1 message Apr 15, 2009 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 2/7 block: Remove code handling bio_alloc failure with __GFP_WAIT

Remove code handling bio_alloc failure with __GFP_WAIT. GFP_KERNEL implies __GFP_WAIT.

---

block/blk-barrier.c +0 -3
index f7dae57..20b4111 100644
@@ -319,9 +319,6 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
 		return -ENXIO;
 
 	bio = bio_alloc(GFP_KERNEL, 0);
-	if (!bio)
-		return -ENOMEM;
-
 	bio->bi_end_io = bio_end_empty_barrier;
 	bio->bi_private = &wait;
 	bio->bi_bdev = bdev;
block/ioctl.c +0 -2
index 0f22e62..ad474d4 100644
@@ -146,8 +146,6 @@ static int blk_ioctl_discard(struct block_device *bdev, uint64_t start,
 		struct bio *bio;
 
 		bio = bio_alloc(GFP_KERNEL, 0);
-		if (!bio)
-			return -ENOMEM;
 
 		bio->bi_end_io = blk_ioc_discard_endio;
 		bio->bi_bdev = bdev;