@@ -1296,9 +1296,7 @@ static void submit_one_flush(struct drbd_device *device, struct issue_flush_cont
octx->device = device;
octx->ctx = ctx;
- bio_set_dev(bio, device->ldev->backing_bdev);
- bio->bi_private = octx;
- bio->bi_end_io = one_flush_endio;
+ bio_init_fields(bio, device->ldev->backing_bdev, 0, octx, one_flush_endio, 0, 0);
bio->bi_opf = REQ_OP_FLUSH | REQ_PREFLUSH;
device->flush_jif = jiffies;
@@ -1693,12 +1691,9 @@ int drbd_submit_peer_request(struct drbd_device *device,
goto fail;
}
/* > peer_req->i.sector, unless this is the first bio */
- bio->bi_iter.bi_sector = sector;
- bio_set_dev(bio, device->ldev->backing_bdev);
+ bio_init_fields(bio, device->ldev->backing_bdev, sector, peer_req,
+ drbd_peer_request_endio, 0, 0);
bio_set_op_attrs(bio, op, op_flags);
- bio->bi_private = peer_req;
- bio->bi_end_io = drbd_peer_request_endio;
-
bio->bi_next = bios;
bios = bio;
++n_bios;
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> --- drivers/block/drbd/drbd_receiver.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)