diff options
Diffstat (limited to 'fs/ext2/ialloc.c')
-rw-r--r-- | fs/ext2/ialloc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index 08f647d8188d..f59741346760 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c | |||
@@ -75,11 +75,9 @@ static void ext2_release_inode(struct super_block *sb, int group, int dir) | |||
75 | } | 75 | } |
76 | 76 | ||
77 | spin_lock(sb_bgl_lock(EXT2_SB(sb), group)); | 77 | spin_lock(sb_bgl_lock(EXT2_SB(sb), group)); |
78 | desc->bg_free_inodes_count = | 78 | le16_add_cpu(&desc->bg_free_inodes_count, 1); |
79 | cpu_to_le16(le16_to_cpu(desc->bg_free_inodes_count) + 1); | ||
80 | if (dir) | 79 | if (dir) |
81 | desc->bg_used_dirs_count = | 80 | le16_add_cpu(&desc->bg_used_dirs_count, -1); |
82 | cpu_to_le16(le16_to_cpu(desc->bg_used_dirs_count) - 1); | ||
83 | spin_unlock(sb_bgl_lock(EXT2_SB(sb), group)); | 81 | spin_unlock(sb_bgl_lock(EXT2_SB(sb), group)); |
84 | if (dir) | 82 | if (dir) |
85 | percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter); | 83 | percpu_counter_dec(&EXT2_SB(sb)->s_dirs_counter); |
@@ -539,13 +537,11 @@ got: | |||
539 | percpu_counter_inc(&sbi->s_dirs_counter); | 537 | percpu_counter_inc(&sbi->s_dirs_counter); |
540 | 538 | ||
541 | spin_lock(sb_bgl_lock(sbi, group)); | 539 | spin_lock(sb_bgl_lock(sbi, group)); |
542 | gdp->bg_free_inodes_count = | 540 | le16_add_cpu(&gdp->bg_free_inodes_count, -1); |
543 | cpu_to_le16(le16_to_cpu(gdp->bg_free_inodes_count) - 1); | ||
544 | if (S_ISDIR(mode)) { | 541 | if (S_ISDIR(mode)) { |
545 | if (sbi->s_debts[group] < 255) | 542 | if (sbi->s_debts[group] < 255) |
546 | sbi->s_debts[group]++; | 543 | sbi->s_debts[group]++; |
547 | gdp->bg_used_dirs_count = | 544 | le16_add_cpu(&gdp->bg_used_dirs_count, 1); |
548 | cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) + 1); | ||
549 | } else { | 545 | } else { |
550 | if (sbi->s_debts[group]) | 546 | if (sbi->s_debts[group]) |
551 | sbi->s_debts[group]--; | 547 | sbi->s_debts[group]--; |