]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ext4: convert to use leXX_add_cpu()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 27 Sep 2012 13:37:53 +0000 (09:37 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 27 Sep 2012 13:37:53 +0000 (09:37 -0400)
Convert cpu_to_leXX(leXX_to_cpu(E1) + E2) to use leXX_add_cpu().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c
fs/ext4/move_extent.c
fs/ext4/super.c

index cbcc6b3f2ae049f543122183829e53263616032e..8f08c7b77179d4eb35462259e3078cbd27de9daa 100644 (file)
@@ -1177,7 +1177,7 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode,
                  le32_to_cpu(EXT_FIRST_INDEX(neh)->ei_block),
                  ext4_idx_pblock(EXT_FIRST_INDEX(neh)));
 
-       neh->eh_depth = cpu_to_le16(le16_to_cpu(neh->eh_depth) + 1);
+       le16_add_cpu(&neh->eh_depth, 1);
        ext4_mark_inode_dirty(handle, inode);
 out:
        brelse(bh);
index cee4bd066b7af395361792ce964bba639718c44b..8076b96b52991d1889aff3552712a0d1b726c824 100644 (file)
@@ -570,9 +570,8 @@ mext_calc_swap_extents(struct ext4_extent *tmp_dext,
        diff = donor_off - le32_to_cpu(tmp_dext->ee_block);
 
        ext4_ext_store_pblock(tmp_dext, ext4_ext_pblock(tmp_dext) + diff);
-       tmp_dext->ee_block =
-                       cpu_to_le32(le32_to_cpu(tmp_dext->ee_block) + diff);
-       tmp_dext->ee_len = cpu_to_le16(le16_to_cpu(tmp_dext->ee_len) - diff);
+       le32_add_cpu(&tmp_dext->ee_block, diff);
+       le16_add_cpu(&tmp_dext->ee_len, -diff);
 
        if (max_count < ext4_ext_get_actual_len(tmp_dext))
                tmp_dext->ee_len = cpu_to_le16(max_count);
index a53a23aef5e312d0912f20e2600704cd3e3de1f2..ae456321c5bf09b22275592441a0570bfc13bd88 100644 (file)
@@ -431,7 +431,7 @@ static void __save_error_info(struct super_block *sb, const char *func,
         */
        if (!es->s_error_count)
                mod_timer(&EXT4_SB(sb)->s_err_report, jiffies + 24*60*60*HZ);
-       es->s_error_count = cpu_to_le32(le32_to_cpu(es->s_error_count) + 1);
+       le32_add_cpu(&es->s_error_count, 1);
 }
 
 static void save_error_info(struct super_block *sb, const char *func,