From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: make sizeof(struct btrfs_super_block) to match BTRFS_SUPER_INFO_SIZE
Date: Thu, 21 Oct 2021 17:24:50 +0200 [thread overview]
Message-ID: <20211021152450.GA20319@twin.jikos.cz> (raw)
In-Reply-To: <20211020234447.5578-1-wqu@suse.com>
On Thu, Oct 21, 2021 at 07:44:47AM +0800, Qu Wenruo wrote:
> It's a common practice to avoid use sizeof(struct btrfs_super_block)
> (3531), but to use BTRFS_SUPER_INFO_SIZE (4096).
>
> The problem is that, sizeof(struct btrfs_super_block) doesn't match
> BTRFS_SUPER_INFO_SIZE from the very beginning.
>
> Furthermore, for all call sites except selftest, we always allocate
> BTRFS_SUPER_INFO_SIZE space for btrfs super block, there isn't any real
> reason to use the smaller value, and it doesn't really save any space.
>
> So let's get rid of such confusing behavior, and unify those two values.
>
> This modification also adds a new static_assert() to verify the size,
> and moves the BTRFS_SUPER_INFO_* macros to the definition of
> btrfs_super_block for the static_assert().
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
Added to misc-next, thanks.
prev parent reply other threads:[~2021-10-21 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 23:44 [PATCH v2] btrfs: make sizeof(struct btrfs_super_block) to match BTRFS_SUPER_INFO_SIZE Qu Wenruo
2021-10-21 12:08 ` Josef Bacik
2021-10-21 15:24 ` David Sterba [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211021152450.GA20319@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox