aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/xattr.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/ext2/xattr.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/ext2/xattr.c')
-rw-r--r--fs/ext2/xattr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 904f00642f84..e44dc92609be 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -644,8 +644,8 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
644 the inode. */ 644 the inode. */
645 ea_bdebug(new_bh, "reusing block"); 645 ea_bdebug(new_bh, "reusing block");
646 646
647 error = -EDQUOT; 647 error = dquot_alloc_block(inode, 1);
648 if (vfs_dq_alloc_block(inode, 1)) { 648 if (error) {
649 unlock_buffer(new_bh); 649 unlock_buffer(new_bh);
650 goto cleanup; 650 goto cleanup;
651 } 651 }
@@ -702,7 +702,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
702 * as if nothing happened and cleanup the unused block */ 702 * as if nothing happened and cleanup the unused block */
703 if (error && error != -ENOSPC) { 703 if (error && error != -ENOSPC) {
704 if (new_bh && new_bh != old_bh) 704 if (new_bh && new_bh != old_bh)
705 vfs_dq_free_block(inode, 1); 705 dquot_free_block(inode, 1);
706 goto cleanup; 706 goto cleanup;
707 } 707 }
708 } else 708 } else
@@ -734,7 +734,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
734 le32_add_cpu(&HDR(old_bh)->h_refcount, -1); 734 le32_add_cpu(&HDR(old_bh)->h_refcount, -1);
735 if (ce) 735 if (ce)
736 mb_cache_entry_release(ce); 736 mb_cache_entry_release(ce);
737 vfs_dq_free_block(inode, 1); 737 dquot_free_block(inode, 1);
738 mark_buffer_dirty(old_bh); 738 mark_buffer_dirty(old_bh);
739 ea_bdebug(old_bh, "refcount now=%d", 739 ea_bdebug(old_bh, "refcount now=%d",
740 le32_to_cpu(HDR(old_bh)->h_refcount)); 740 le32_to_cpu(HDR(old_bh)->h_refcount));
@@ -797,7 +797,7 @@ ext2_xattr_delete_inode(struct inode *inode)
797 mark_buffer_dirty(bh); 797 mark_buffer_dirty(bh);
798 if (IS_SYNC(inode)) 798 if (IS_SYNC(inode))
799 sync_dirty_buffer(bh); 799 sync_dirty_buffer(bh);
800 vfs_dq_free_block(inode, 1); 800 dquot_free_block(inode, 1);
801 } 801 }
802 EXT2_I(inode)->i_file_acl = 0; 802 EXT2_I(inode)->i_file_acl = 0;
803 803