summaryrefslogtreecommitdiff
path: root/fs/ocfs2/quota_global.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2009-07-22 13:17:21 +0200
committerJoel Becker <joel.becker@oracle.com>2009-07-23 10:59:31 -0700
commit0584974a77796581eb3a64b6c5005edac4a95128 (patch)
tree8ae9e0fb7fa73bcdd1efefe0ecf82da1b55ba66e /fs/ocfs2/quota_global.c
parent4539f1df25bcd0fdf0d8a5e2c92de6bece83c7a0 (diff)
ocfs2: Define credit counts for quota operations
Numbers of needed credits for some quota operations were written as raw numbers. Create appropriate defines instead. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/quota_global.c')
-rw-r--r--fs/ocfs2/quota_global.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index dab45467b5f..cc8785cf8f6 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -648,10 +648,15 @@ int ocfs2_calc_qdel_credits(struct super_block *sb, int type)
return 0;
oinfo = sb_dqinfo(sb, type)->dqi_priv;
- /* We modify tree, leaf block, global info, local chunk header,
- * global and local inode */
- return oinfo->dqi_gi.dqi_qtree_depth + 2 + 1 +
- 2 * OCFS2_INODE_UPDATE_CREDITS;
+ /*
+ * We modify tree, leaf block, global info, local chunk header,
+ * global and local inode; OCFS2_QINFO_WRITE_CREDITS already
+ * accounts for inode update
+ */
+ return oinfo->dqi_gi.dqi_qtree_depth +
+ OCFS2_QINFO_WRITE_CREDITS +
+ 2 * OCFS2_QUOTA_BLOCK_UPDATE_CREDITS +
+ OCFS2_INODE_UPDATE_CREDITS;
}
static int ocfs2_release_dquot(struct dquot *dquot)
@@ -701,7 +706,10 @@ int ocfs2_calc_qinit_credits(struct super_block *sb, int type)
* global file we can modify info, tree and leaf block */
return ocfs2_calc_extend_credits(sb, &lfe->id2.i_list, 0) +
ocfs2_calc_extend_credits(sb, &gfe->id2.i_list, 0) +
- 3 + oinfo->dqi_gi.dqi_qtree_depth + 2;
+ OCFS2_LOCAL_QINFO_WRITE_CREDITS +
+ 2 * OCFS2_QUOTA_BLOCK_UPDATE_CREDITS +
+ oinfo->dqi_gi.dqi_qtree_depth +
+ 2 * OCFS2_QUOTA_BLOCK_UPDATE_CREDITS;
}
static int ocfs2_acquire_dquot(struct dquot *dquot)