aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/ialloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/ialloc.c')
-rw-r--r--fs/ext3/ialloc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
index 58ae2f943f12..4f4020c54683 100644
--- a/fs/ext3/ialloc.c
+++ b/fs/ext3/ialloc.c
@@ -164,11 +164,9 @@ void ext3_free_inode (handle_t *handle, struct inode * inode)
164 164
165 if (gdp) { 165 if (gdp) {
166 spin_lock(sb_bgl_lock(sbi, block_group)); 166 spin_lock(sb_bgl_lock(sbi, block_group));
167 gdp->bg_free_inodes_count = cpu_to_le16( 167 le16_add_cpu(&gdp->bg_free_inodes_count, 1);
168 le16_to_cpu(gdp->bg_free_inodes_count) + 1);
169 if (is_directory) 168 if (is_directory)
170 gdp->bg_used_dirs_count = cpu_to_le16( 169 le16_add_cpu(&gdp->bg_used_dirs_count, -1);
171 le16_to_cpu(gdp->bg_used_dirs_count) - 1);
172 spin_unlock(sb_bgl_lock(sbi, block_group)); 170 spin_unlock(sb_bgl_lock(sbi, block_group));
173 percpu_counter_inc(&sbi->s_freeinodes_counter); 171 percpu_counter_inc(&sbi->s_freeinodes_counter);
174 if (is_directory) 172 if (is_directory)
@@ -527,11 +525,9 @@ got:
527 err = ext3_journal_get_write_access(handle, bh2); 525 err = ext3_journal_get_write_access(handle, bh2);
528 if (err) goto fail; 526 if (err) goto fail;
529 spin_lock(sb_bgl_lock(sbi, group)); 527 spin_lock(sb_bgl_lock(sbi, group));
530 gdp->bg_free_inodes_count = 528 le16_add_cpu(&gdp->bg_free_inodes_count, -1);
531 cpu_to_le16(le16_to_cpu(gdp->bg_free_inodes_count) - 1);
532 if (S_ISDIR(mode)) { 529 if (S_ISDIR(mode)) {
533 gdp->bg_used_dirs_count = 530 le16_add_cpu(&gdp->bg_used_dirs_count, 1);
534 cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) + 1);
535 } 531 }
536 spin_unlock(sb_bgl_lock(sbi, group)); 532 spin_unlock(sb_bgl_lock(sbi, group));
537 BUFFER_TRACE(bh2, "call ext3_journal_dirty_metadata"); 533 BUFFER_TRACE(bh2, "call ext3_journal_dirty_metadata");