aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/balloc.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-03-03 09:05:00 -0500
committerJan Kara <jack@suse.cz>2010-03-04 18:20:28 -0500
commit5dd4056db84387975140ff2568eaa0406f07985e (patch)
tree03c26d7f6e3367b167bfeeb1a01654c6619573f4 /fs/ext3/balloc.c
parent49792c806d0bfd53afc789dcdf50dc9bed2c5b83 (diff)
dquot: cleanup space allocation / freeing routines
Get rid of the alloc_space, free_space, reserve_space, claim_space and release_rsv dquot operations - they are always called from the filesystem and if a filesystem really needs their own (which none currently does) it can just call into it's own routine directly. Move shared logic into the common __dquot_alloc_space, dquot_claim_space_nodirty and __dquot_free_space low-level methods, and rationalize the wrappers around it to move as much as possible code into the common block for CONFIG_QUOTA vs not. Also rename all these helpers to be named dquot_* instead of vfs_dq_*. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3/balloc.c')
-rw-r--r--fs/ext3/balloc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index 27967f92e820..161da2d3f890 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -676,7 +676,7 @@ void ext3_free_blocks(handle_t *handle, struct inode *inode,
676 } 676 }
677 ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks); 677 ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks);
678 if (dquot_freed_blocks) 678 if (dquot_freed_blocks)
679 vfs_dq_free_block(inode, dquot_freed_blocks); 679 dquot_free_block(inode, dquot_freed_blocks);
680 return; 680 return;
681} 681}
682 682
@@ -1502,8 +1502,9 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
1502 /* 1502 /*
1503 * Check quota for allocation of this block. 1503 * Check quota for allocation of this block.
1504 */ 1504 */
1505 if (vfs_dq_alloc_block(inode, num)) { 1505 err = dquot_alloc_block(inode, num);
1506 *errp = -EDQUOT; 1506 if (err) {
1507 *errp = err;
1507 return 0; 1508 return 0;
1508 } 1509 }
1509 1510
@@ -1713,7 +1714,7 @@ allocated:
1713 1714
1714 *errp = 0; 1715 *errp = 0;
1715 brelse(bitmap_bh); 1716 brelse(bitmap_bh);
1716 vfs_dq_free_block(inode, *count-num); 1717 dquot_free_block(inode, *count-num);
1717 *count = num; 1718 *count = num;
1718 return ret_block; 1719 return ret_block;
1719 1720
@@ -1728,7 +1729,7 @@ out:
1728 * Undo the block allocation 1729 * Undo the block allocation
1729 */ 1730 */
1730 if (!performed_allocation) 1731 if (!performed_allocation)
1731 vfs_dq_free_block(inode, *count); 1732 dquot_free_block(inode, *count);
1732 brelse(bitmap_bh); 1733 brelse(bitmap_bh);
1733 return 0; 1734 return 0;
1734} 1735}