diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2008-04-17 10:38:59 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-04-17 10:38:59 -0400 |
commit | e8546d0615542684ca02ba03edebec1a503beb6b (patch) | |
tree | c0114f0e86278dd1418f5a548b38d5d1c4b157b3 /fs/ext4/balloc.c | |
parent | 9a0762c5af40e4aa64fef999967459c98e6ae4c9 (diff) |
ext4: le*_add_cpu conversion
replace all:
little_endian_variable = cpu_to_leX(leX_to_cpu(little_endian_variable) +
expression_in_cpu_byteorder);
with:
leX_add_cpu(&little_endian_variable, expression_in_cpu_byteorder);
generated with semantic patch
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Cc: sct@redhat.com
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: adilger@clusterfs.com
Cc: Mingming Cao <cmm@us.ibm.com>
Diffstat (limited to 'fs/ext4/balloc.c')
-rw-r--r-- | fs/ext4/balloc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 0737e05ba3dd..5d348998ff38 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -752,9 +752,7 @@ do_more: | |||
752 | jbd_unlock_bh_state(bitmap_bh); | 752 | jbd_unlock_bh_state(bitmap_bh); |
753 | 753 | ||
754 | spin_lock(sb_bgl_lock(sbi, block_group)); | 754 | spin_lock(sb_bgl_lock(sbi, block_group)); |
755 | desc->bg_free_blocks_count = | 755 | le16_add_cpu(&desc->bg_free_blocks_count, group_freed); |
756 | cpu_to_le16(le16_to_cpu(desc->bg_free_blocks_count) + | ||
757 | group_freed); | ||
758 | desc->bg_checksum = ext4_group_desc_csum(sbi, block_group, desc); | 756 | desc->bg_checksum = ext4_group_desc_csum(sbi, block_group, desc); |
759 | spin_unlock(sb_bgl_lock(sbi, block_group)); | 757 | spin_unlock(sb_bgl_lock(sbi, block_group)); |
760 | percpu_counter_add(&sbi->s_freeblocks_counter, count); | 758 | percpu_counter_add(&sbi->s_freeblocks_counter, count); |
@@ -1823,8 +1821,7 @@ allocated: | |||
1823 | spin_lock(sb_bgl_lock(sbi, group_no)); | 1821 | spin_lock(sb_bgl_lock(sbi, group_no)); |
1824 | if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) | 1822 | if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) |
1825 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); | 1823 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); |
1826 | gdp->bg_free_blocks_count = | 1824 | le16_add_cpu(&gdp->bg_free_blocks_count, -num); |
1827 | cpu_to_le16(le16_to_cpu(gdp->bg_free_blocks_count)-num); | ||
1828 | gdp->bg_checksum = ext4_group_desc_csum(sbi, group_no, gdp); | 1825 | gdp->bg_checksum = ext4_group_desc_csum(sbi, group_no, gdp); |
1829 | spin_unlock(sb_bgl_lock(sbi, group_no)); | 1826 | spin_unlock(sb_bgl_lock(sbi, group_no)); |
1830 | percpu_counter_sub(&sbi->s_freeblocks_counter, num); | 1827 | percpu_counter_sub(&sbi->s_freeblocks_counter, num); |