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>
This commit is contained in:

committed by
Theodore Ts'o

parent
9a0762c5af
commit
e8546d0615
@@ -223,11 +223,9 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
|
||||
|
||||
if (gdp) {
|
||||
spin_lock(sb_bgl_lock(sbi, block_group));
|
||||
gdp->bg_free_inodes_count = cpu_to_le16(
|
||||
le16_to_cpu(gdp->bg_free_inodes_count) + 1);
|
||||
le16_add_cpu(&gdp->bg_free_inodes_count, 1);
|
||||
if (is_directory)
|
||||
gdp->bg_used_dirs_count = cpu_to_le16(
|
||||
le16_to_cpu(gdp->bg_used_dirs_count) - 1);
|
||||
le16_add_cpu(&gdp->bg_used_dirs_count, -1);
|
||||
gdp->bg_checksum = ext4_group_desc_csum(sbi,
|
||||
block_group, gdp);
|
||||
spin_unlock(sb_bgl_lock(sbi, block_group));
|
||||
@@ -664,11 +662,9 @@ got:
|
||||
cpu_to_le16(EXT4_INODES_PER_GROUP(sb) - ino);
|
||||
}
|
||||
|
||||
gdp->bg_free_inodes_count =
|
||||
cpu_to_le16(le16_to_cpu(gdp->bg_free_inodes_count) - 1);
|
||||
le16_add_cpu(&gdp->bg_free_inodes_count, -1);
|
||||
if (S_ISDIR(mode)) {
|
||||
gdp->bg_used_dirs_count =
|
||||
cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) + 1);
|
||||
le16_add_cpu(&gdp->bg_used_dirs_count, 1);
|
||||
}
|
||||
gdp->bg_checksum = ext4_group_desc_csum(sbi, group, gdp);
|
||||
spin_unlock(sb_bgl_lock(sbi, group));
|
||||
|
Reference in New Issue
Block a user