All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: Remove btrfs_bio::flags member
@ 2019-10-23  7:04 Qu Wenruo
  2019-10-23 17:17 ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Qu Wenruo @ 2019-10-23  7:04 UTC (permalink / raw)
  To: linux-btrfs

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(-)

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;
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: Remove btrfs_bio::flags member
  2019-10-23  7:04 [PATCH] btrfs: Remove btrfs_bio::flags member Qu Wenruo
@ 2019-10-23 17:17 ` David Sterba
  2019-10-24  1:33   ` Qu Wenruo
  0 siblings, 1 reply; 4+ messages in thread
From: David Sterba @ 2019-10-23 17:17 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: Remove btrfs_bio::flags member
  2019-10-23 17:17 ` David Sterba
@ 2019-10-24  1:33   ` Qu Wenruo
  2019-10-24 12:04     ` David Sterba
  0 siblings, 1 reply; 4+ messages in thread
From: Qu Wenruo @ 2019-10-24  1:33 UTC (permalink / raw)
  To: dsterba, Qu Wenruo, linux-btrfs


[-- Attachment #1.1: Type: text/plain, Size: 718 bytes --]



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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: Remove btrfs_bio::flags member
  2019-10-24  1:33   ` Qu Wenruo
@ 2019-10-24 12:04     ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2019-10-24 12:04 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: dsterba, Qu Wenruo, linux-btrfs

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-24 12:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-23  7:04 [PATCH] btrfs: Remove btrfs_bio::flags member Qu Wenruo
2019-10-23 17:17 ` David Sterba
2019-10-24  1:33   ` Qu Wenruo
2019-10-24 12:04     ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.