Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drbd: use __bio_add_page to add page to bio

The drbd code only adds a single page to a newly created bio. So use
__bio_add_page() to add the page which is guaranteed to succeed in this
case.

This brings us closer to marking bio_add_page() as __must_check.

Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/435007afac14f3766455559059d21843771fae53.1685532726.git.johannes.thumshirn@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Johannes Thumshirn and committed by
Jens Axboe
8f11f79f cb58bf91

+1 -3
+1 -3
drivers/block/drbd/drbd_bitmap.c
··· 1043 1043 bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op, GFP_NOIO, 1044 1044 &drbd_md_io_bio_set); 1045 1045 bio->bi_iter.bi_sector = on_disk_sector; 1046 - /* bio_add_page of a single page to an empty bio will always succeed, 1047 - * according to api. Do we want to assert that? */ 1048 - bio_add_page(bio, page, len, 0); 1046 + __bio_add_page(bio, page, len, 0); 1049 1047 bio->bi_private = ctx; 1050 1048 bio->bi_end_io = drbd_bm_endio; 1051 1049