Message ID | 20191023070447.6899-1-wqu@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: Remove btrfs_bio::flags member | expand |
On Wed, Oct 23, 2019 at 03:04:47PM +0800, Qu Wenruo wrote:
> 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.
On 2019/10/24 上午1:17, David Sterba wrote: > On Wed, Oct 23, 2019 at 03:04:47PM +0800, Qu Wenruo wrote: >> 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. > > 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
On Thu, Oct 24, 2019 at 09:33:18AM +0800, Qu Wenruo wrote: > > 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.
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 7f6aa1816409..5ab2920b0c1f 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -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;
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. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/volumes.h | 1 - 1 file changed, 1 deletion(-)