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/file.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/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 558ce0312421..6cf3d8d18369 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -629,11 +629,10 @@ restart_all: | |||
629 | } | 629 | } |
630 | 630 | ||
631 | restarted_transaction: | 631 | restarted_transaction: |
632 | if (vfs_dq_alloc_space_nodirty(inode, ocfs2_clusters_to_bytes(osb->sb, | 632 | status = dquot_alloc_space_nodirty(inode, |
633 | clusters_to_add))) { | 633 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_add)); |
634 | status = -EDQUOT; | 634 | if (status) |
635 | goto leave; | 635 | goto leave; |
636 | } | ||
637 | did_quota = 1; | 636 | did_quota = 1; |
638 | 637 | ||
639 | /* reserve a write to the file entry early on - that we if we | 638 | /* reserve a write to the file entry early on - that we if we |
@@ -674,7 +673,7 @@ restarted_transaction: | |||
674 | clusters_to_add -= (OCFS2_I(inode)->ip_clusters - prev_clusters); | 673 | clusters_to_add -= (OCFS2_I(inode)->ip_clusters - prev_clusters); |
675 | spin_unlock(&OCFS2_I(inode)->ip_lock); | 674 | spin_unlock(&OCFS2_I(inode)->ip_lock); |
676 | /* Release unused quota reservation */ | 675 | /* Release unused quota reservation */ |
677 | vfs_dq_free_space(inode, | 676 | dquot_free_space(inode, |
678 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_add)); | 677 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_add)); |
679 | did_quota = 0; | 678 | did_quota = 0; |
680 | 679 | ||
@@ -710,7 +709,7 @@ restarted_transaction: | |||
710 | 709 | ||
711 | leave: | 710 | leave: |
712 | if (status < 0 && did_quota) | 711 | if (status < 0 && did_quota) |
713 | vfs_dq_free_space(inode, | 712 | dquot_free_space(inode, |
714 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_add)); | 713 | ocfs2_clusters_to_bytes(osb->sb, clusters_to_add)); |
715 | if (handle) { | 714 | if (handle) { |
716 | ocfs2_commit_trans(osb, handle); | 715 | ocfs2_commit_trans(osb, handle); |