btrfs: Remove btrfs_bio::flags member
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
@@ -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
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.
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_privateof thefirst_bio(btrfs_map_bio) and it's read inbtrfs_end_bbio, but bbio is accessible and sobbio->privateisbbio->orig_bio->bi_private.
Would double check that, anyway it will be another patch.
Thanks,
Qu
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_privateof thefirst_bio(btrfs_map_bio) and it's read inbtrfs_end_bbio, but bbio is accessible and sobbio->privateisbbio->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.