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

Ext2: remove the static function release_blocks to optimize the kernel

Because the static function 'release_blocks' is only called
when releasing blocks,it will be more simple and efficient to
call the function 'percpu_counter_add' directly.

Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Wang Shilong and committed by
Jan Kara
712ddc52 8e3dffc6

+1 -10
+1 -10
fs/ext2/balloc.c
··· 159 159 return bh; 160 160 } 161 161 162 - static void release_blocks(struct super_block *sb, int count) 163 - { 164 - if (count) { 165 - struct ext2_sb_info *sbi = EXT2_SB(sb); 166 - 167 - percpu_counter_add(&sbi->s_freeblocks_counter, count); 168 - } 169 - } 170 - 171 162 static void group_adjust_blocks(struct super_block *sb, int group_no, 172 163 struct ext2_group_desc *desc, struct buffer_head *bh, int count) 173 164 { ··· 560 569 error_return: 561 570 brelse(bitmap_bh); 562 571 if (freed) { 563 - release_blocks(sb, freed); 572 + percpu_counter_add(&sbi->s_freeblocks_counter, freed); 564 573 dquot_free_block_nodirty(inode, freed); 565 574 mark_inode_dirty(inode); 566 575 }