Thread (47 messages) 47 messages, 7 authors, 2021-01-21

Re: [RFC PATCH 04/37] btrfs: use bio_init_fields in volumes

From: Nikolay Borisov <hidden>
Date: 2021-01-20 00:08:53
Also in: dm-devel, linux-bcache, linux-btrfs, linux-ext4, linux-fsdevel, linux-raid, linux-scsi, linux-xfs, lkml, target-devel


On 19.01.21 г. 7:05 ч., Chaitanya Kulkarni wrote:
quoted hunk ↗ jump to hunk
Signed-off-by: Chaitanya Kulkarni <redacted>
---
 fs/btrfs/volumes.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index ee086fc56c30..836167212252 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6371,14 +6371,12 @@ static void submit_stripe_bio(struct btrfs_bio *bbio, struct bio *bio,
 
 	bio->bi_private = bbio;
This line can be removed as ->private is initialized by bio_init_fields.
 	btrfs_io_bio(bio)->device = dev;
-	bio->bi_end_io = btrfs_end_bio;
-	bio->bi_iter.bi_sector = physical >> 9;
+	bio_init_fields(bio, dev->bdev, physical >> 9, bbio, btrfs_end_bio, 0, 0);
 	btrfs_debug_in_rcu(fs_info,
 	"btrfs_map_bio: rw %d 0x%x, sector=%llu, dev=%lu (%s id %llu), size=%u",
 		bio_op(bio), bio->bi_opf, bio->bi_iter.bi_sector,
 		(unsigned long)dev->bdev->bd_dev, rcu_str_deref(dev->name),
 		dev->devid, bio->bi_iter.bi_size);
-	bio_set_dev(bio, dev->bdev);
 
 	btrfs_bio_counter_inc_noblocked(fs_info);
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help