[RFC PATCH 21/37] dm-bufio: use bio_init_fields

From
Chaitanya Kulkarni <hidden>
Date
2021-01-19 05:30:19
Also in
dm-devel, linux-bcache, linux-block, linux-btrfs, linux-fsdevel, linux-raid, linux-scsi, linux-xfs, lkml, target-devel
Reply to
Chaitanya Kulkarni, 2021-01-19
Signed-off-by: Chaitanya Kulkarni <redacted>
---
 drivers/md/dm-bufio.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 9c1a86bde658..1295e7e33e06 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -633,11 +633,8 @@ static void use_bio(struct dm_buffer *b, int rw, sector_t sector,
 		return;
 	}
 
-	bio->bi_iter.bi_sector = sector;
-	bio_set_dev(bio, b->c->bdev);
 	bio_set_op_attrs(bio, rw, 0);
-	bio->bi_end_io = bio_complete;
-	bio->bi_private = b;
+	bio_init_fields(bio, b->c->bdev, sector, b, bio_complete, 0, 0);
 
 	ptr = (char *)b->data + offset;
 	len = n_sectors << SECTOR_SHIFT;
-- 
2.22.1
Thread (44 messages) 44 messages, 5 authors, last reply 2021-01-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help