diff options
Diffstat (limited to 'fs/ext4/ialloc.c')
-rw-r--r-- | fs/ext4/ialloc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index cb14646117f0..e8d24f24f282 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -223,11 +223,9 @@ void ext4_free_inode (handle_t *handle, struct inode * inode) | |||
223 | 223 | ||
224 | if (gdp) { | 224 | if (gdp) { |
225 | spin_lock(sb_bgl_lock(sbi, block_group)); | 225 | spin_lock(sb_bgl_lock(sbi, block_group)); |
226 | gdp->bg_free_inodes_count = cpu_to_le16( | 226 | le16_add_cpu(&gdp->bg_free_inodes_count, 1); |
227 | le16_to_cpu(gdp->bg_free_inodes_count) + 1); | ||
228 | if (is_directory) | 227 | if (is_directory) |
229 | gdp->bg_used_dirs_count = cpu_to_le16( | 228 | le16_add_cpu(&gdp->bg_used_dirs_count, -1); |
230 | le16_to_cpu(gdp->bg_used_dirs_count) - 1); | ||
231 | gdp->bg_checksum = ext4_group_desc_csum(sbi, | 229 | gdp->bg_checksum = ext4_group_desc_csum(sbi, |
232 | block_group, gdp); | 230 | block_group, gdp); |
233 | spin_unlock(sb_bgl_lock(sbi, block_group)); | 231 | spin_unlock(sb_bgl_lock(sbi, block_group)); |
@@ -664,11 +662,9 @@ got: | |||
664 | cpu_to_le16(EXT4_INODES_PER_GROUP(sb) - ino); | 662 | cpu_to_le16(EXT4_INODES_PER_GROUP(sb) - ino); |
665 | } | 663 | } |
666 | 664 | ||
667 | gdp->bg_free_inodes_count = | 665 | le16_add_cpu(&gdp->bg_free_inodes_count, -1); |
668 | cpu_to_le16(le16_to_cpu(gdp->bg_free_inodes_count) - 1); | ||
669 | if (S_ISDIR(mode)) { | 666 | if (S_ISDIR(mode)) { |
670 | gdp->bg_used_dirs_count = | 667 | le16_add_cpu(&gdp->bg_used_dirs_count, 1); |
671 | cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) + 1); | ||
672 | } | 668 | } |
673 | gdp->bg_checksum = ext4_group_desc_csum(sbi, group, gdp); | 669 | gdp->bg_checksum = ext4_group_desc_csum(sbi, group, gdp); |
674 | spin_unlock(sb_bgl_lock(sbi, group)); | 670 | spin_unlock(sb_bgl_lock(sbi, group)); |