[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210119050631.57073-4-chaitanya.kulkarni@wdc.com>
Date: Mon, 18 Jan 2021 21:05:57 -0800
From: Chaitanya Kulkarni <chaitanya.kulkarni@....com>
To: linux-block@...r.kernel.org, linux-xfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
drbd-dev@...ts.linbit.com, linux-bcache@...r.kernel.org,
linux-raid@...r.kernel.org, linux-nvme@...ts.infradead.org,
linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
linux-btrfs@...r.kernel.org, linux-ext4@...r.kernel.org,
cluster-devel@...hat.com
Cc: jfs-discussion@...ts.sourceforge.net, dm-devel@...hat.com,
axboe@...nel.dk, philipp.reisner@...bit.com,
lars.ellenberg@...bit.com, efremov@...ux.com, colyli@...e.de,
kent.overstreet@...il.com, agk@...hat.com, snitzer@...hat.com,
song@...nel.org, hch@....de, sagi@...mberg.me,
martin.petersen@...cle.com, viro@...iv.linux.org.uk, clm@...com,
josef@...icpanda.com, dsterba@...e.com, tytso@....edu,
adilger.kernel@...ger.ca, rpeterso@...hat.com, agruenba@...hat.com,
darrick.wong@...cle.com, shaggy@...nel.org, damien.lemoal@....com,
naohiro.aota@....com, jth@...nel.org, tj@...nel.org,
osandov@...com, bvanassche@....org, gustavo@...eddedor.com,
asml.silence@...il.com, jefflexu@...ux.alibaba.com,
Chaitanya Kulkarni <chaitanya.kulkarni@....com>
Subject: [RFC PATCH 03/37] btrfs: use bio_init_fields in disk-io
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@....com>
---
fs/btrfs/disk-io.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 765deefda92b..9a65432fc5e9 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3637,10 +3637,8 @@ static int write_dev_supers(struct btrfs_device *device,
* checking.
*/
bio = bio_alloc(GFP_NOFS, 1);
- bio_set_dev(bio, device->bdev);
- bio->bi_iter.bi_sector = bytenr >> SECTOR_SHIFT;
- bio->bi_private = device;
- bio->bi_end_io = btrfs_end_super_write;
+ bio_init_fields(bio, device->bdev, bytenr >> SECTOR_SHIFT,
+ device, btrfs_end_super_write, 0, 0);
__bio_add_page(bio, page, BTRFS_SUPER_INFO_SIZE,
offset_in_page(bytenr));
@@ -3748,11 +3746,10 @@ static void write_dev_flush(struct btrfs_device *device)
return;
bio_reset(bio);
- bio->bi_end_io = btrfs_end_empty_barrier;
- bio_set_dev(bio, device->bdev);
bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH;
init_completion(&device->flush_wait);
- bio->bi_private = &device->flush_wait;
+ bio_init_fields(bio, device->bdev, 0, &device->flush_wait,
+ btrfs_end_empty_barrier, 0, 0);
btrfsic_submit_bio(bio);
set_bit(BTRFS_DEV_STATE_FLUSH_SENT, &device->dev_state);
--
2.22.1
Powered by blists - more mailing lists