Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eric Biggers and committed by
Theodore Ts'o
6017dbb7 6cbab5f9

+8 -10
+1 -2
fs/ext4/ext4.h
··· 3136 3136 extern void ext4_sb_breadahead_unmovable(struct super_block *sb, sector_t block); 3137 3137 extern int ext4_seq_options_show(struct seq_file *seq, void *offset); 3138 3138 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); 3141 3140 extern void ext4_superblock_csum_set(struct super_block *sb); 3142 3141 extern int ext4_alloc_flex_bg_array(struct super_block *sb, 3143 3142 ext4_group_t ngroup);
+2 -2
fs/ext4/ioctl.c
··· 143 143 es = (struct ext4_super_block *) (bh->b_data + offset); 144 144 lock_buffer(bh); 145 145 if (ext4_has_feature_metadata_csum(sb) && 146 - es->s_checksum != ext4_superblock_csum(sb, es)) { 146 + es->s_checksum != ext4_superblock_csum(es)) { 147 147 ext4_msg(sb, KERN_ERR, "Invalid checksum for backup " 148 148 "superblock %llu", sb_block); 149 149 unlock_buffer(bh); ··· 151 151 } 152 152 func(es, arg); 153 153 if (ext4_has_feature_metadata_csum(sb)) 154 - es->s_checksum = ext4_superblock_csum(sb, es); 154 + es->s_checksum = ext4_superblock_csum(es); 155 155 set_buffer_uptodate(bh); 156 156 unlock_buffer(bh); 157 157
+1 -1
fs/ext4/resize.c
··· 1119 1119 1120 1120 es->s_block_group_nr = cpu_to_le16(group); 1121 1121 if (ext4_has_feature_metadata_csum(sb)) 1122 - es->s_checksum = ext4_superblock_csum(sb, es); 1122 + es->s_checksum = ext4_superblock_csum(es); 1123 1123 } 1124 1124 1125 1125 /*
+4 -5
fs/ext4/super.c
··· 286 286 return es->s_checksum_type == EXT4_CRC32C_CHKSUM; 287 287 } 288 288 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) 291 290 { 292 291 int offset = offsetof(struct ext4_super_block, s_checksum); 293 292 __u32 csum; ··· 302 303 if (!ext4_has_feature_metadata_csum(sb)) 303 304 return 1; 304 305 305 - return es->s_checksum == ext4_superblock_csum(sb, es); 306 + return es->s_checksum == ext4_superblock_csum(es); 306 307 } 307 308 308 309 void ext4_superblock_csum_set(struct super_block *sb) ··· 312 313 if (!ext4_has_feature_metadata_csum(sb)) 313 314 return; 314 315 315 - es->s_checksum = ext4_superblock_csum(sb, es); 316 + es->s_checksum = ext4_superblock_csum(es); 316 317 } 317 318 318 319 ext4_fsblk_t ext4_block_bitmap(struct super_block *sb, ··· 5911 5912 5912 5913 if ((le32_to_cpu(es->s_feature_ro_compat) & 5913 5914 EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) && 5914 - es->s_checksum != ext4_superblock_csum(sb, es)) { 5915 + es->s_checksum != ext4_superblock_csum(es)) { 5915 5916 ext4_msg(sb, KERN_ERR, "external journal has corrupt superblock"); 5916 5917 errno = -EFSCORRUPTED; 5917 5918 goto out_bh;