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/aops.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/aops.c')
-rw-r--r-- | fs/ocfs2/aops.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 7e9df11260f4..7d04c171567d 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -1763,10 +1763,11 @@ int ocfs2_write_begin_nolock(struct address_space *mapping, | |||
1763 | 1763 | ||
1764 | wc->w_handle = handle; | 1764 | wc->w_handle = handle; |
1765 | 1765 | ||
1766 | if (clusters_to_alloc && vfs_dq_alloc_space_nodirty(inode, | 1766 | if (clusters_to_alloc) { |
1767 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_alloc))) { | 1767 | ret = dquot_alloc_space_nodirty(inode, |
1768 | ret = -EDQUOT; | 1768 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_alloc)); |
1769 | goto out_commit; | 1769 | if (ret) |
1770 | goto out_commit; | ||
1770 | } | 1771 | } |
1771 | /* | 1772 | /* |
1772 | * We don't want this to fail in ocfs2_write_end(), so do it | 1773 | * We don't want this to fail in ocfs2_write_end(), so do it |
@@ -1809,7 +1810,7 @@ success: | |||
1809 | return 0; | 1810 | return 0; |
1810 | out_quota: | 1811 | out_quota: |
1811 | if (clusters_to_alloc) | 1812 | if (clusters_to_alloc) |
1812 | vfs_dq_free_space(inode, | 1813 | dquot_free_space(inode, |
1813 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_alloc)); | 1814 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_alloc)); |
1814 | out_commit: | 1815 | out_commit: |
1815 | ocfs2_commit_trans(osb, handle); | 1816 | ocfs2_commit_trans(osb, handle); |