Skip to content

Commit

Permalink
ext2: switch to dquot_free_block_nodirty()
Browse files Browse the repository at this point in the history
brute-force conversion

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Aug 9, 2010
1 parent 5ccb4a7 commit 3889717
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions fs/ext2/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ void ext2_free_blocks (struct inode * inode, unsigned long block,
error_return:
brelse(bitmap_bh);
release_blocks(sb, freed);
dquot_free_block(inode, freed);
dquot_free_block_nodirty(inode, freed);
mark_inode_dirty(inode);
}

/**
Expand Down Expand Up @@ -1418,7 +1419,8 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,

*errp = 0;
brelse(bitmap_bh);
dquot_free_block(inode, *count-num);
dquot_free_block_nodirty(inode, *count-num);
mark_inode_dirty(inode);
*count = num;
return ret_block;

Expand All @@ -1428,8 +1430,10 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,
/*
* Undo the block allocation
*/
if (!performed_allocation)
dquot_free_block(inode, *count);
if (!performed_allocation) {
dquot_free_block_nodirty(inode, *count);
mark_inode_dirty(inode);
}
brelse(bitmap_bh);
return 0;
}
Expand Down
12 changes: 8 additions & 4 deletions fs/ext2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,10 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
* written (only some dirty data were not) so we just proceed
* as if nothing happened and cleanup the unused block */
if (error && error != -ENOSPC) {
if (new_bh && new_bh != old_bh)
dquot_free_block(inode, 1);
if (new_bh && new_bh != old_bh) {
dquot_free_block_nodirty(inode, 1);
mark_inode_dirty(inode);
}
goto cleanup;
}
} else
Expand Down Expand Up @@ -736,7 +738,8 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
le32_add_cpu(&HDR(old_bh)->h_refcount, -1);
if (ce)
mb_cache_entry_release(ce);
dquot_free_block(inode, 1);
dquot_free_block_nodirty(inode, 1);
mark_inode_dirty(inode);
mark_buffer_dirty(old_bh);
ea_bdebug(old_bh, "refcount now=%d",
le32_to_cpu(HDR(old_bh)->h_refcount));
Expand Down Expand Up @@ -799,7 +802,8 @@ ext2_xattr_delete_inode(struct inode *inode)
mark_buffer_dirty(bh);
if (IS_SYNC(inode))
sync_dirty_buffer(bh);
dquot_free_block(inode, 1);
dquot_free_block_nodirty(inode, 1);
mark_inode_dirty(inode);
}
EXT2_I(inode)->i_file_acl = 0;

Expand Down

0 comments on commit 3889717

Please sign in to comment.