OSDN Git Service

nfs/blocklayout: remove cruft in bl_alloc_init_bio
authorChristoph Hellwig <hch@lst.de>
Tue, 26 Jan 2021 14:52:45 +0000 (15:52 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 27 Jan 2021 16:51:48 +0000 (09:51 -0700)
bio_alloc never returns NULL when it can sleep.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Acked-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/nfs/blocklayout/blocklayout.c

index 3be6836..1a96ce2 100644 (file)
@@ -123,11 +123,6 @@ bl_alloc_init_bio(int npg, struct block_device *bdev, sector_t disk_sector,
 
        npg = min(npg, BIO_MAX_PAGES);
        bio = bio_alloc(GFP_NOIO, npg);
-       if (!bio && (current->flags & PF_MEMALLOC)) {
-               while (!bio && (npg /= 2))
-                       bio = bio_alloc(GFP_NOIO, npg);
-       }
-
        if (bio) {
                bio->bi_iter.bi_sector = disk_sector;
                bio_set_dev(bio, bdev);