ext2: switch to dquot_free_block_nodirty()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 21 Jul 2010 21:13:36 +0000 (01:13 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 Aug 2010 20:47:54 +0000 (16:47 -0400)
brute-force conversion

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ext2/balloc.c
fs/ext2/xattr.c

index e8766a3967760f07b210e10e3b879f2c6af62872..db69c1206f13cf87853689badadd4c957734505f 100644 (file)
@@ -571,7 +571,8 @@ do_more:
 error_return:
        brelse(bitmap_bh);
        release_blocks(sb, freed);
-       dquot_free_block(inode, freed);
+       dquot_free_block_nodirty(inode, freed);
+       mark_inode_dirty(inode);
 }
 
 /**
@@ -1418,7 +1419,8 @@ allocated:
 
        *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;
 
@@ -1428,8 +1430,10 @@ out:
        /*
         * 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;
 }
index 7c3915780b19dd049586dc2e027822d12fd47826..0fa24e814d8a7a5816dc8560448407e880998aae 100644 (file)
@@ -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
@@ -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));
@@ -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;