From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] jbd2: remove redundant function jbd2_journal_has_csum_v2or3_feature
Date: Thu, 6 Feb 2025 20:11:55 -0800 [thread overview]
Message-ID: <20250207041155.GC21787@frogsfrogsfrogs> (raw)
In-Reply-To: <20250207031424.42755-1-ebiggers@kernel.org>
On Thu, Feb 06, 2025 at 07:14:24PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> Since commit dd348f054b24 ("jbd2: switch to using the crc32c library"),
> jbd2_journal_has_csum_v2or3() and jbd2_journal_has_csum_v2or3_feature()
> are the same. Remove jbd2_journal_has_csum_v2or3_feature() and just
> keep jbd2_journal_has_csum_v2or3().
>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
Looks good,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/jbd2/journal.c | 4 ++--
> include/linux/jbd2.h | 8 ++------
> 2 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
> index d8084b31b3610..4de74056a3c36 100644
> --- a/fs/jbd2/journal.c
> +++ b/fs/jbd2/journal.c
> @@ -1359,19 +1359,19 @@ static int journal_check_superblock(journal_t *journal)
> printk(KERN_ERR "JBD2: Can't enable checksumming v2 and v3 "
> "at the same time!\n");
> return err;
> }
>
> - if (jbd2_journal_has_csum_v2or3_feature(journal) &&
> + if (jbd2_journal_has_csum_v2or3(journal) &&
> jbd2_has_feature_checksum(journal)) {
> /* Can't have checksum v1 and v2 on at the same time! */
> printk(KERN_ERR "JBD2: Can't enable checksumming v1 and v2/3 "
> "at the same time!\n");
> return err;
> }
>
> - if (jbd2_journal_has_csum_v2or3_feature(journal)) {
> + if (jbd2_journal_has_csum_v2or3(journal)) {
> if (sb->s_checksum_type != JBD2_CRC32C_CHKSUM) {
> printk(KERN_ERR "JBD2: Unknown checksum type\n");
> return err;
> }
>
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index 561025b4f3d91..a7e8163637b44 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -1734,18 +1734,14 @@ static inline int tid_geq(tid_t x, tid_t y)
> }
>
> extern int jbd2_journal_blocks_per_page(struct inode *inode);
> extern size_t journal_tag_bytes(journal_t *journal);
>
> -static inline bool jbd2_journal_has_csum_v2or3_feature(journal_t *j)
> -{
> - return jbd2_has_feature_csum2(j) || jbd2_has_feature_csum3(j);
> -}
> -
> static inline int jbd2_journal_has_csum_v2or3(journal_t *journal)
> {
> - return jbd2_journal_has_csum_v2or3_feature(journal);
> + return jbd2_has_feature_csum2(journal) ||
> + jbd2_has_feature_csum3(journal);
> }
>
> static inline int jbd2_journal_get_num_fc_blks(journal_superblock_t *jsb)
> {
> int num_fc_blocks = be32_to_cpu(jsb->s_num_fc_blks);
>
> base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
> --
> 2.48.1
>
>
next prev parent reply other threads:[~2025-02-07 4:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 3:14 [PATCH] jbd2: remove redundant function jbd2_journal_has_csum_v2or3_feature Eric Biggers
2025-02-07 4:11 ` Darrick J. Wong [this message]
2025-03-18 3:41 ` Theodore Ts'o
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=20250207041155.GC21787@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=ebiggers@kernel.org \
--cc=linux-ext4@vger.kernel.org \
/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