From: Eric Biggers <ebiggers@kernel.org>
To: linux-ext4@vger.kernel.org
Subject: [PATCH 2/4] ext4: remove sb argument from ext4_superblock_csum()
Date: Mon, 12 May 2025 22:38:07 -0700 [thread overview]
Message-ID: <20250513053809.699974-3-ebiggers@kernel.org> (raw)
In-Reply-To: <20250513053809.699974-1-ebiggers@kernel.org>
From: Eric Biggers <ebiggers@google.com>
Since ext4_superblock_csum() no longer uses its sb argument, remove it.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
fs/ext4/ext4.h | 3 +--
fs/ext4/ioctl.c | 4 ++--
fs/ext4/resize.c | 2 +-
fs/ext4/super.c | 9 ++++-----
4 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 5c7a86acbf79..25221c6693b0 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -3116,12 +3116,11 @@ extern int ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags,
bh_end_io_t *end_io, bool simu_fail);
extern int ext4_read_bh_lock(struct buffer_head *bh, blk_opf_t op_flags, bool wait);
extern void ext4_sb_breadahead_unmovable(struct super_block *sb, sector_t block);
extern int ext4_seq_options_show(struct seq_file *seq, void *offset);
extern int ext4_calculate_overhead(struct super_block *sb);
-extern __le32 ext4_superblock_csum(struct super_block *sb,
- struct ext4_super_block *es);
+extern __le32 ext4_superblock_csum(struct ext4_super_block *es);
extern void ext4_superblock_csum_set(struct super_block *sb);
extern int ext4_alloc_flex_bg_array(struct super_block *sb,
ext4_group_t ngroup);
extern const char *ext4_decode_error(struct super_block *sb, int errno,
char nbuf[16]);
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 6b99284095bf..c05eb0efbb95 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -141,19 +141,19 @@ static int ext4_update_backup_sb(struct super_block *sb,
}
es = (struct ext4_super_block *) (bh->b_data + offset);
lock_buffer(bh);
if (ext4_has_feature_metadata_csum(sb) &&
- es->s_checksum != ext4_superblock_csum(sb, es)) {
+ es->s_checksum != ext4_superblock_csum(es)) {
ext4_msg(sb, KERN_ERR, "Invalid checksum for backup "
"superblock %llu", sb_block);
unlock_buffer(bh);
goto out_bh;
}
func(es, arg);
if (ext4_has_feature_metadata_csum(sb))
- es->s_checksum = ext4_superblock_csum(sb, es);
+ es->s_checksum = ext4_superblock_csum(es);
set_buffer_uptodate(bh);
unlock_buffer(bh);
if (handle) {
err = ext4_handle_dirty_metadata(handle, NULL, bh);
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index b7ff0d955f0d..050f26168d97 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1117,11 +1117,11 @@ static inline void ext4_set_block_group_nr(struct super_block *sb, char *data,
{
struct ext4_super_block *es = (struct ext4_super_block *) data;
es->s_block_group_nr = cpu_to_le16(group);
if (ext4_has_feature_metadata_csum(sb))
- es->s_checksum = ext4_superblock_csum(sb, es);
+ es->s_checksum = ext4_superblock_csum(es);
}
/*
* Update the backup copies of the ext4 metadata. These don't need to be part
* of the main resize transaction, because e2fsck will re-write them if there
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index d7780269b455..14e47cc2a5a3 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -284,12 +284,11 @@ static int ext4_verify_csum_type(struct super_block *sb,
return 1;
return es->s_checksum_type == EXT4_CRC32C_CHKSUM;
}
-__le32 ext4_superblock_csum(struct super_block *sb,
- struct ext4_super_block *es)
+__le32 ext4_superblock_csum(struct ext4_super_block *es)
{
int offset = offsetof(struct ext4_super_block, s_checksum);
__u32 csum;
csum = ext4_chksum(~0, (char *)es, offset);
@@ -301,21 +300,21 @@ static int ext4_superblock_csum_verify(struct super_block *sb,
struct ext4_super_block *es)
{
if (!ext4_has_feature_metadata_csum(sb))
return 1;
- return es->s_checksum == ext4_superblock_csum(sb, es);
+ return es->s_checksum == ext4_superblock_csum(es);
}
void ext4_superblock_csum_set(struct super_block *sb)
{
struct ext4_super_block *es = EXT4_SB(sb)->s_es;
if (!ext4_has_feature_metadata_csum(sb))
return;
- es->s_checksum = ext4_superblock_csum(sb, es);
+ es->s_checksum = ext4_superblock_csum(es);
}
ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
struct ext4_group_desc *bg)
{
@@ -5913,11 +5912,11 @@ static struct file *ext4_get_journal_blkdev(struct super_block *sb,
goto out_bh;
}
if ((le32_to_cpu(es->s_feature_ro_compat) &
EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) &&
- es->s_checksum != ext4_superblock_csum(sb, es)) {
+ es->s_checksum != ext4_superblock_csum(es)) {
ext4_msg(sb, KERN_ERR, "external journal has corrupt superblock");
errno = -EFSCORRUPTED;
goto out_bh;
}
--
2.49.0
next prev parent reply other threads:[~2025-05-13 5:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-13 5:38 [PATCH 0/4] ext4,jbd2: clean up unused arguments to checksum functions Eric Biggers
2025-05-13 5:38 ` [PATCH 1/4] ext4: remove sbi argument from ext4_chksum() Eric Biggers
2025-05-13 6:13 ` Baokun Li
2025-05-13 5:38 ` Eric Biggers [this message]
2025-05-13 6:17 ` [PATCH 2/4] ext4: remove sb argument from ext4_superblock_csum() Baokun Li
2025-05-13 5:38 ` [PATCH 3/4] jbd2: remove journal_t argument from jbd2_chksum() Eric Biggers
2025-05-13 6:19 ` Baokun Li
2025-05-13 5:38 ` [PATCH 4/4] jbd2: remove journal_t argument from jbd2_superblock_csum() Eric Biggers
2025-05-13 6:21 ` Baokun Li
2025-05-20 14:40 ` [PATCH 0/4] ext4,jbd2: clean up unused arguments to checksum functions 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=20250513053809.699974-3-ebiggers@kernel.org \
--to=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 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.