diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-03-03 09:05:00 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-03-04 18:20:28 -0500 |
commit | 5dd4056db84387975140ff2568eaa0406f07985e (patch) | |
tree | 03c26d7f6e3367b167bfeeb1a01654c6619573f4 /fs/ext4/mballoc.c | |
parent | 49792c806d0bfd53afc789dcdf50dc9bed2c5b83 (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/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index d34afad3e137..0b905781e8e6 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -4254,7 +4254,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, | |||
4254 | return 0; | 4254 | return 0; |
4255 | } | 4255 | } |
4256 | reserv_blks = ar->len; | 4256 | reserv_blks = ar->len; |
4257 | while (ar->len && vfs_dq_alloc_block(ar->inode, ar->len)) { | 4257 | while (ar->len && dquot_alloc_block(ar->inode, ar->len)) { |
4258 | ar->flags |= EXT4_MB_HINT_NOPREALLOC; | 4258 | ar->flags |= EXT4_MB_HINT_NOPREALLOC; |
4259 | ar->len--; | 4259 | ar->len--; |
4260 | } | 4260 | } |
@@ -4331,7 +4331,7 @@ out2: | |||
4331 | kmem_cache_free(ext4_ac_cachep, ac); | 4331 | kmem_cache_free(ext4_ac_cachep, ac); |
4332 | out1: | 4332 | out1: |
4333 | if (inquota && ar->len < inquota) | 4333 | if (inquota && ar->len < inquota) |
4334 | vfs_dq_free_block(ar->inode, inquota - ar->len); | 4334 | dquot_free_block(ar->inode, inquota - ar->len); |
4335 | out3: | 4335 | out3: |
4336 | if (!ar->len) { | 4336 | if (!ar->len) { |
4337 | if (!EXT4_I(ar->inode)->i_delalloc_reserved_flag) | 4337 | if (!EXT4_I(ar->inode)->i_delalloc_reserved_flag) |
@@ -4646,7 +4646,7 @@ do_more: | |||
4646 | sb->s_dirt = 1; | 4646 | sb->s_dirt = 1; |
4647 | error_return: | 4647 | error_return: |
4648 | if (freed) | 4648 | if (freed) |
4649 | vfs_dq_free_block(inode, freed); | 4649 | dquot_free_block(inode, freed); |
4650 | brelse(bitmap_bh); | 4650 | brelse(bitmap_bh); |
4651 | ext4_std_error(sb, err); | 4651 | ext4_std_error(sb, err); |
4652 | if (ac) | 4652 | if (ac) |