Skip to content

Commit 6017dbb

Browse files
ebiggerstytso
authored andcommitted
ext4: remove sb argument from ext4_superblock_csum()
Since ext4_superblock_csum() no longer uses its sb argument, remove it. Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Baokun Li <libaokun1@huawei.com> Link: https://patch.msgid.link/20250513053809.699974-3-ebiggers@kernel.org Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 6cbab5f commit 6017dbb

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

fs/ext4/ext4.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3136,8 +3136,7 @@ extern int ext4_read_bh_lock(struct buffer_head *bh, blk_opf_t op_flags, bool wa
31363136
extern void ext4_sb_breadahead_unmovable(struct super_block *sb, sector_t block);
31373137
extern int ext4_seq_options_show(struct seq_file *seq, void *offset);
31383138
extern int ext4_calculate_overhead(struct super_block *sb);
3139-
extern __le32 ext4_superblock_csum(struct super_block *sb,
3140-
struct ext4_super_block *es);
3139+
extern __le32 ext4_superblock_csum(struct ext4_super_block *es);
31413140
extern void ext4_superblock_csum_set(struct super_block *sb);
31423141
extern int ext4_alloc_flex_bg_array(struct super_block *sb,
31433142
ext4_group_t ngroup);

fs/ext4/ioctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ static int ext4_update_backup_sb(struct super_block *sb,
143143
es = (struct ext4_super_block *) (bh->b_data + offset);
144144
lock_buffer(bh);
145145
if (ext4_has_feature_metadata_csum(sb) &&
146-
es->s_checksum != ext4_superblock_csum(sb, es)) {
146+
es->s_checksum != ext4_superblock_csum(es)) {
147147
ext4_msg(sb, KERN_ERR, "Invalid checksum for backup "
148148
"superblock %llu", sb_block);
149149
unlock_buffer(bh);
150150
goto out_bh;
151151
}
152152
func(es, arg);
153153
if (ext4_has_feature_metadata_csum(sb))
154-
es->s_checksum = ext4_superblock_csum(sb, es);
154+
es->s_checksum = ext4_superblock_csum(es);
155155
set_buffer_uptodate(bh);
156156
unlock_buffer(bh);
157157

fs/ext4/resize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ static inline void ext4_set_block_group_nr(struct super_block *sb, char *data,
11191119

11201120
es->s_block_group_nr = cpu_to_le16(group);
11211121
if (ext4_has_feature_metadata_csum(sb))
1122-
es->s_checksum = ext4_superblock_csum(sb, es);
1122+
es->s_checksum = ext4_superblock_csum(es);
11231123
}
11241124

11251125
/*

fs/ext4/super.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ static int ext4_verify_csum_type(struct super_block *sb,
286286
return es->s_checksum_type == EXT4_CRC32C_CHKSUM;
287287
}
288288

289-
__le32 ext4_superblock_csum(struct super_block *sb,
290-
struct ext4_super_block *es)
289+
__le32 ext4_superblock_csum(struct ext4_super_block *es)
291290
{
292291
int offset = offsetof(struct ext4_super_block, s_checksum);
293292
__u32 csum;
@@ -303,7 +302,7 @@ static int ext4_superblock_csum_verify(struct super_block *sb,
303302
if (!ext4_has_feature_metadata_csum(sb))
304303
return 1;
305304

306-
return es->s_checksum == ext4_superblock_csum(sb, es);
305+
return es->s_checksum == ext4_superblock_csum(es);
307306
}
308307

309308
void ext4_superblock_csum_set(struct super_block *sb)
@@ -313,7 +312,7 @@ void ext4_superblock_csum_set(struct super_block *sb)
313312
if (!ext4_has_feature_metadata_csum(sb))
314313
return;
315314

316-
es->s_checksum = ext4_superblock_csum(sb, es);
315+
es->s_checksum = ext4_superblock_csum(es);
317316
}
318317

319318
ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
@@ -5912,7 +5911,7 @@ static struct file *ext4_get_journal_blkdev(struct super_block *sb,
59125911

59135912
if ((le32_to_cpu(es->s_feature_ro_compat) &
59145913
EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) &&
5915-
es->s_checksum != ext4_superblock_csum(sb, es)) {
5914+
es->s_checksum != ext4_superblock_csum(es)) {
59165915
ext4_msg(sb, KERN_ERR, "external journal has corrupt superblock");
59175916
errno = -EFSCORRUPTED;
59185917
goto out_bh;

0 commit comments

Comments
 (0)