Commit 81414b4d authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o

ext4: remove redundant sb checksum recomputation

Superblock is written out either through ext4_commit_super() or through
ext4_handle_dirty_super(). In both cases we recompute the checksum so it
is not necessary to recompute it after updating superblock free inodes &
blocks counters.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Reviewed-by: default avatarAndreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/20201127113405.26867-3-jack@suse.czSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent b08070ec
...@@ -5010,13 +5010,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -5010,13 +5010,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
block = ext4_count_free_clusters(sb); block = ext4_count_free_clusters(sb);
ext4_free_blocks_count_set(sbi->s_es, ext4_free_blocks_count_set(sbi->s_es,
EXT4_C2B(sbi, block)); EXT4_C2B(sbi, block));
ext4_superblock_csum_set(sb);
err = percpu_counter_init(&sbi->s_freeclusters_counter, block, err = percpu_counter_init(&sbi->s_freeclusters_counter, block,
GFP_KERNEL); GFP_KERNEL);
if (!err) { if (!err) {
unsigned long freei = ext4_count_free_inodes(sb); unsigned long freei = ext4_count_free_inodes(sb);
sbi->s_es->s_free_inodes_count = cpu_to_le32(freei); sbi->s_es->s_free_inodes_count = cpu_to_le32(freei);
ext4_superblock_csum_set(sb);
err = percpu_counter_init(&sbi->s_freeinodes_counter, freei, err = percpu_counter_init(&sbi->s_freeinodes_counter, freei,
GFP_KERNEL); GFP_KERNEL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment