diff mbox series

[RFC,11/37] jfs: use bio_init_fields in logmgr

Message ID 20210119050631.57073-12-chaitanya.kulkarni@wdc.com
State Rejected
Headers show
Series block: introduce bio_init_fields() | expand

Commit Message

Chaitanya Kulkarni Jan. 19, 2021, 5:06 a.m. UTC
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 fs/jfs/jfs_logmgr.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 9330eff210e0..ee7407ca32c0 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -1980,15 +1980,11 @@  static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp)
 	bp->l_flag |= lbmREAD;
 
 	bio = bio_alloc(GFP_NOFS, 1);
-
-	bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9);
-	bio_set_dev(bio, log->bdev);
-
+	bio_init_fields(bio, log->bdev, bp->l_blkno << (log->l2bsize - 9),
+			log->bdev, 0, lbmIODone, bp, 0, 0);
 	bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset);
 	BUG_ON(bio->bi_iter.bi_size != LOGPSIZE);
 
-	bio->bi_end_io = lbmIODone;
-	bio->bi_private = bp;
 	bio->bi_opf = REQ_OP_READ;
 	/*check if journaling to disk has been disabled*/
 	if (log->no_integrity) {
@@ -2125,14 +2121,10 @@  static void lbmStartIO(struct lbuf * bp)
 	jfs_info("lbmStartIO");
 
 	bio = bio_alloc(GFP_NOFS, 1);
-	bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9);
-	bio_set_dev(bio, log->bdev);
-
+	bio_init_fields(bio, log->bdev, bp->l_blkno << (log->l2bsize - 9),
+			log->bdev, 0, lbmIODone, bp, 0, 0);
 	bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset);
 	BUG_ON(bio->bi_iter.bi_size != LOGPSIZE);
-
-	bio->bi_end_io = lbmIODone;
-	bio->bi_private = bp;
 	bio->bi_opf = REQ_OP_WRITE | REQ_SYNC;
 
 	/* check if journaling to disk has been disabled */