dquot: cleanup space allocation / freeing routines
[pandora-kernel.git] / fs / ocfs2 / file.c
index 558ce03..6cf3d8d 100644 (file)
@@ -629,11 +629,10 @@ restart_all:
        }
 
 restarted_transaction:
-       if (vfs_dq_alloc_space_nodirty(inode, ocfs2_clusters_to_bytes(osb->sb,
-           clusters_to_add))) {
-               status = -EDQUOT;
+       status = dquot_alloc_space_nodirty(inode,
+                       ocfs2_clusters_to_bytes(osb->sb, clusters_to_add));
+       if (status)
                goto leave;
-       }
        did_quota = 1;
 
        /* reserve a write to the file entry early on - that we if we
@@ -674,7 +673,7 @@ restarted_transaction:
        clusters_to_add -= (OCFS2_I(inode)->ip_clusters - prev_clusters);
        spin_unlock(&OCFS2_I(inode)->ip_lock);
        /* Release unused quota reservation */
-       vfs_dq_free_space(inode,
+       dquot_free_space(inode,
                        ocfs2_clusters_to_bytes(osb->sb, clusters_to_add));
        did_quota = 0;
 
@@ -710,7 +709,7 @@ restarted_transaction:
 
 leave:
        if (status < 0 && did_quota)
-               vfs_dq_free_space(inode,
+               dquot_free_space(inode,
                        ocfs2_clusters_to_bytes(osb->sb, clusters_to_add));
        if (handle) {
                ocfs2_commit_trans(osb, handle);