Skip to contentSkip to conversation

btrfs: Remove btrfs_bio::flags member

PATCH Superseded Qu Wenruo 3 participants 4 messages Oct 23, 2019 – Oct 24, 2019 Btrfs file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

PATCH 1/1 btrfs: Remove btrfs_bio::flags member

This member is not used by any one, just remove it.

And since it's between two pointers, such removal should save us a pointer size of the structure.

Furthermore, if we just want to know the block group profile, we have btrfs_bio::map_type, which is much better than this ambiguous member.

---
 fs/btrfs/volumes.h | 1 -
 1 file changed, 1 deletion(-)
fs/btrfs/volumes.h +0 -1
index 7f6aa1816409..5ab2920b0c1f 100644
@@ -331,7 +331,6 @@ struct btrfs_bio {
 	u64 map_type; /* get from map_lookup->type */
 	bio_end_io_t *end_io;
 	struct bio *orig_bio;
-	unsigned long flags;
 	void *private;
 	atomic_t error;
 	int max_errors;
Signature · 1 line
2.23.0
#1 lore raw
Quoted 1 line · Qu Wenruo

This member is not used by any one, just remove it.

What's the patch that removed the last use? This should be in patches that remove struct members. Otherwise good, every byte removed counts.

I've briefly checked 'void *private', but looks like it can be removed as well, it's holds bi_private of the first_bio (btrfs_map_bio) and it's read in btrfs_end_bbio, but bbio is accessible and so bbio->private is bbio->orig_bio->bi_private.

#2 lore raw
Quoted 5 lines · David Sterba
Quoted 1 line · Qu Wenruo

This member is not used by any one, just remove it.

What's the patch that removed the last use? This should be in patches that remove struct members. Otherwise good, every byte removed counts.

Will update the patch with the mentioning of last user.

Quoted 5 lines

I've briefly checked 'void *private', but looks like it can be removed as well, it's holds bi_private of the first_bio (btrfs_map_bio) and it's read in btrfs_end_bbio, but bbio is accessible and so bbio->private is bbio->orig_bio->bi_private.

Would double check that, anyway it will be another patch.

Thanks,
Qu

#3 lore raw
Quoted 6 lines · Qu Wenruo
Quoted 4 lines

I've briefly checked 'void *private', but looks like it can be removed as well, it's holds bi_private of the first_bio (btrfs_map_bio) and it's read in btrfs_end_bbio, but bbio is accessible and so bbio->private is bbio->orig_bio->bi_private.

Would double check that, anyway it will be another patch.

No rush, that was only a drive-by idea. The btrfs_bio could be improved, there are eg. some raid56-only members or other types can be narrowed or reordered so this can be done at the same time. More work compared to removing a completely unused member.