Skip to contentSkip to conversation

btrfs: stop looking at btrfs_bio->iter in index_one_bio

PATCH In review Christoph Hellwig 2 participants 2 messages Jun 3, 2022 – Jun 7, 2022 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: stop looking at btrfs_bio->iter in index_one_bio

All the bios that index_one_bio operates on are the bios submitted by the upper layer. These are never resubmitted to an actual device by the raid56 code, and thus the iter never changes from the initial state. Thus we can always just use bi_iter directly as it will be the same as the saved copy.

---
 fs/btrfs/raid56.c | 3 ---
 1 file changed, 3 deletions(-)
fs/btrfs/raid56.c +0 -3
index 00cd9e8db7ae0..3c58869779375 100644
@@ -1106,9 +1106,6 @@ static void index_one_bio(struct btrfs_raid_bio *rbio, struct bio *bio)
 	u32 offset = (bio->bi_iter.bi_sector << SECTOR_SHIFT) -
 		     rbio->bioc->raid_map[0];
 
-	if (bio_flagged(bio, BIO_CLONED))
-		bio->bi_iter = btrfs_bio(bio)->iter;
-
 	bio_for_each_segment(bvec, bio, iter) {
 		u32 bvec_offset;
 
Signature · 1 line
2.30.2
#1 lore raw
Quoted 7 lines · Christoph Hellwig

All the bios that index_one_bio operates on are the bios submitted by the upper layer. These are never resubmitted to an actual device by the raid56 code, and thus the iter never changes from the initial state. Thus we can always just use bi_iter directly as it will be the same as the saved copy.

Added to misc-next, thanks.