aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/quota_local.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2009-07-22 07:17:21 -0400
committerJoel Becker <joel.becker@oracle.com>2009-07-23 13:59:31 -0400
commit0584974a77796581eb3a64b6c5005edac4a95128 (patch)
tree8ae9e0fb7fa73bcdd1efefe0ecf82da1b55ba66e /fs/ocfs2/quota_local.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_local.c')
-rw-r--r--fs/ocfs2/quota_local.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c
index 9d2993de1082..bdb09cb6e1fe 100644
--- a/fs/ocfs2/quota_local.c
+++ b/fs/ocfs2/quota_local.c
@@ -101,7 +101,8 @@ static int ocfs2_modify_bh(struct inode *inode, struct buffer_head *bh,
101 handle_t *handle; 101 handle_t *handle;
102 int status; 102 int status;
103 103
104 handle = ocfs2_start_trans(OCFS2_SB(sb), 1); 104 handle = ocfs2_start_trans(OCFS2_SB(sb),
105 OCFS2_QUOTA_BLOCK_UPDATE_CREDITS);
105 if (IS_ERR(handle)) { 106 if (IS_ERR(handle)) {
106 status = PTR_ERR(handle); 107 status = PTR_ERR(handle);
107 mlog_errno(status); 108 mlog_errno(status);
@@ -611,7 +612,8 @@ int ocfs2_finish_quota_recovery(struct ocfs2_super *osb,
611 goto out_bh; 612 goto out_bh;
612 /* Mark quota file as clean if we are recovering quota file of 613 /* Mark quota file as clean if we are recovering quota file of
613 * some other node. */ 614 * some other node. */
614 handle = ocfs2_start_trans(osb, 1); 615 handle = ocfs2_start_trans(osb,
616 OCFS2_LOCAL_QINFO_WRITE_CREDITS);
615 if (IS_ERR(handle)) { 617 if (IS_ERR(handle)) {
616 status = PTR_ERR(handle); 618 status = PTR_ERR(handle);
617 mlog_errno(status); 619 mlog_errno(status);
@@ -965,7 +967,10 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk(
965 mlog_errno(status); 967 mlog_errno(status);
966 goto out; 968 goto out;
967 } 969 }
968 handle = ocfs2_start_trans(OCFS2_SB(sb), 3); 970 /* Local quota info and two new blocks we initialize */
971 handle = ocfs2_start_trans(OCFS2_SB(sb),
972 OCFS2_LOCAL_QINFO_WRITE_CREDITS +
973 2 * OCFS2_QUOTA_BLOCK_UPDATE_CREDITS);
969 if (IS_ERR(handle)) { 974 if (IS_ERR(handle)) {
970 status = PTR_ERR(handle); 975 status = PTR_ERR(handle);
971 mlog_errno(status); 976 mlog_errno(status);
@@ -1128,7 +1133,10 @@ static struct ocfs2_quota_chunk *ocfs2_extend_local_quota_file(
1128 } 1133 }
1129 ocfs2_set_new_buffer_uptodate(lqinode, bh); 1134 ocfs2_set_new_buffer_uptodate(lqinode, bh);
1130 1135
1131 handle = ocfs2_start_trans(OCFS2_SB(sb), 3); 1136 /* Local quota info, chunk header and the new block we initialize */
1137 handle = ocfs2_start_trans(OCFS2_SB(sb),
1138 OCFS2_LOCAL_QINFO_WRITE_CREDITS +
1139 2 * OCFS2_QUOTA_BLOCK_UPDATE_CREDITS);
1132 if (IS_ERR(handle)) { 1140 if (IS_ERR(handle)) {
1133 status = PTR_ERR(handle); 1141 status = PTR_ERR(handle);
1134 mlog_errno(status); 1142 mlog_errno(status);