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/ocfs2/alloc.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/ocfs2/alloc.c')
-rw-r--r-- | fs/ocfs2/alloc.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index d17bdc718f74..20538dd832a4 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -5712,7 +5712,7 @@ int ocfs2_remove_btree_range(struct inode *inode, | |||
5712 | goto out; | 5712 | goto out; |
5713 | } | 5713 | } |
5714 | 5714 | ||
5715 | vfs_dq_free_space_nodirty(inode, | 5715 | dquot_free_space_nodirty(inode, |
5716 | ocfs2_clusters_to_bytes(inode->i_sb, len)); | 5716 | ocfs2_clusters_to_bytes(inode->i_sb, len)); |
5717 | 5717 | ||
5718 | ret = ocfs2_remove_extent(handle, et, cpos, len, meta_ac, dealloc); | 5718 | ret = ocfs2_remove_extent(handle, et, cpos, len, meta_ac, dealloc); |
@@ -6935,7 +6935,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb, | |||
6935 | goto bail; | 6935 | goto bail; |
6936 | } | 6936 | } |
6937 | 6937 | ||
6938 | vfs_dq_free_space_nodirty(inode, | 6938 | dquot_free_space_nodirty(inode, |
6939 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_del)); | 6939 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_del)); |
6940 | spin_lock(&OCFS2_I(inode)->ip_lock); | 6940 | spin_lock(&OCFS2_I(inode)->ip_lock); |
6941 | OCFS2_I(inode)->ip_clusters = le32_to_cpu(fe->i_clusters) - | 6941 | OCFS2_I(inode)->ip_clusters = le32_to_cpu(fe->i_clusters) - |
@@ -7300,11 +7300,10 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, | |||
7300 | unsigned int page_end; | 7300 | unsigned int page_end; |
7301 | u64 phys; | 7301 | u64 phys; |
7302 | 7302 | ||
7303 | if (vfs_dq_alloc_space_nodirty(inode, | 7303 | ret = dquot_alloc_space_nodirty(inode, |
7304 | ocfs2_clusters_to_bytes(osb->sb, 1))) { | 7304 | ocfs2_clusters_to_bytes(osb->sb, 1)); |
7305 | ret = -EDQUOT; | 7305 | if (ret) |
7306 | goto out_commit; | 7306 | goto out_commit; |
7307 | } | ||
7308 | did_quota = 1; | 7307 | did_quota = 1; |
7309 | 7308 | ||
7310 | ret = ocfs2_claim_clusters(osb, handle, data_ac, 1, &bit_off, | 7309 | ret = ocfs2_claim_clusters(osb, handle, data_ac, 1, &bit_off, |
@@ -7380,7 +7379,7 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, | |||
7380 | 7379 | ||
7381 | out_commit: | 7380 | out_commit: |
7382 | if (ret < 0 && did_quota) | 7381 | if (ret < 0 && did_quota) |
7383 | vfs_dq_free_space_nodirty(inode, | 7382 | dquot_free_space_nodirty(inode, |
7384 | ocfs2_clusters_to_bytes(osb->sb, 1)); | 7383 | ocfs2_clusters_to_bytes(osb->sb, 1)); |
7385 | 7384 | ||
7386 | ocfs2_commit_trans(osb, handle); | 7385 | ocfs2_commit_trans(osb, handle); |