]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dm-bufio: use bio_add_virt_nofail
authorChristoph Hellwig <hch@lst.de>
Wed, 7 May 2025 12:04:37 +0000 (14:04 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 7 May 2025 13:31:07 +0000 (07:31 -0600)
Convert the __bio_add_page(..., virt_to_page(), ...) pattern to the
bio_add_virt_nofail helper implementing it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20250507120451.4000627-14-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/dm-bufio.c

index 9c8ed65cd87e635366f65276756e0e3e48c8383a..e82cd5dc83ce06d0fa3d735e032e6cd671ef5e9c 100644 (file)
@@ -1362,7 +1362,7 @@ static void use_bio(struct dm_buffer *b, enum req_op op, sector_t sector,
        ptr = (char *)b->data + offset;
        len = n_sectors << SECTOR_SHIFT;
 
-       __bio_add_page(bio, virt_to_page(ptr), len, offset_in_page(ptr));
+       bio_add_virt_nofail(bio, ptr, len);
 
        submit_bio(bio);
 }