@@ -518,8 +518,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
518518 EXT3_SB (sb )-> s_gdb_count ++ ;
519519 kfree (o_group_desc );
520520
521- es -> s_reserved_gdt_blocks =
522- cpu_to_le16 (le16_to_cpu (es -> s_reserved_gdt_blocks ) - 1 );
521+ le16_add_cpu (& es -> s_reserved_gdt_blocks , -1 );
523522 ext3_journal_dirty_metadata (handle , EXT3_SB (sb )-> s_sbh );
524523
525524 return 0 ;
@@ -890,10 +889,8 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
890889 * blocks/inodes before the group is live won't actually let us
891890 * allocate the new space yet.
892891 */
893- es -> s_blocks_count = cpu_to_le32 (le32_to_cpu (es -> s_blocks_count ) +
894- input -> blocks_count );
895- es -> s_inodes_count = cpu_to_le32 (le32_to_cpu (es -> s_inodes_count ) +
896- EXT3_INODES_PER_GROUP (sb ));
892+ le32_add_cpu (& es -> s_blocks_count , input -> blocks_count );
893+ le32_add_cpu (& es -> s_inodes_count , EXT3_INODES_PER_GROUP (sb ));
897894
898895 /*
899896 * We need to protect s_groups_count against other CPUs seeing
@@ -926,8 +923,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
926923
927924 /* Update the reserved block counts only once the new group is
928925 * active. */
929- es -> s_r_blocks_count = cpu_to_le32 (le32_to_cpu (es -> s_r_blocks_count ) +
930- input -> reserved_blocks );
926+ le32_add_cpu (& es -> s_r_blocks_count , input -> reserved_blocks );
931927
932928 /* Update the free space counts */
933929 percpu_counter_add (& sbi -> s_freeblocks_counter ,
0 commit comments