aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/quota_local.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-10-17 22:25:01 -0400
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:40:32 -0500
commit13723d00e374c2a6d6ccb5af6de965e89c3e1b01 (patch)
tree70dcd8f3d188bf2f62e4bf4b44a0662d8cd527ca /fs/ocfs2/quota_local.c
parentffdd7a54631f07918b75e324d86713a08c11ec06 (diff)
ocfs2: Use metadata-specific ocfs2_journal_access_*() functions.
The per-metadata-type ocfs2_journal_access_*() functions hook up jbd2 commit triggers and allow us to compute metadata ecc right before the buffers are written out. This commit provides ecc for inodes, extent blocks, group descriptors, and quota blocks. It is not safe to use extened attributes and metaecc at the same time yet. The ocfs2_extent_tree and ocfs2_path abstractions in alloc.c both hide the type of block at their root. Before, it didn't matter, but now the root block must use the appropriate ocfs2_journal_access_*() function. To keep this abstract, the structures now have a pointer to the matching journal_access function and a wrapper call to call it. A few places use naked ocfs2_write_block() calls instead of adding the blocks to the journal. We make sure to calculate their checksum and ecc before the write. Since we pass around the journal_access functions. Let's typedef them in ocfs2.h. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/quota_local.c')
-rw-r--r--fs/ocfs2/quota_local.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c
index d451b715aefe..07deec5e9721 100644
--- a/fs/ocfs2/quota_local.c
+++ b/fs/ocfs2/quota_local.c
@@ -106,8 +106,8 @@ static int ocfs2_modify_bh(struct inode *inode, struct buffer_head *bh,
106 mlog_errno(status); 106 mlog_errno(status);
107 return status; 107 return status;
108 } 108 }
109 status = ocfs2_journal_access(handle, inode, bh, 109 status = ocfs2_journal_access_dq(handle, inode, bh,
110 OCFS2_JOURNAL_ACCESS_WRITE); 110 OCFS2_JOURNAL_ACCESS_WRITE);
111 if (status < 0) { 111 if (status < 0) {
112 mlog_errno(status); 112 mlog_errno(status);
113 ocfs2_commit_trans(OCFS2_SB(sb), handle); 113 ocfs2_commit_trans(OCFS2_SB(sb), handle);
@@ -506,7 +506,7 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode,
506 goto out_commit; 506 goto out_commit;
507 } 507 }
508 /* Release local quota file entry */ 508 /* Release local quota file entry */
509 status = ocfs2_journal_access(handle, lqinode, 509 status = ocfs2_journal_access_dq(handle, lqinode,
510 qbh, OCFS2_JOURNAL_ACCESS_WRITE); 510 qbh, OCFS2_JOURNAL_ACCESS_WRITE);
511 if (status < 0) { 511 if (status < 0) {
512 mlog_errno(status); 512 mlog_errno(status);
@@ -614,8 +614,8 @@ int ocfs2_finish_quota_recovery(struct ocfs2_super *osb,
614 mlog_errno(status); 614 mlog_errno(status);
615 goto out_bh; 615 goto out_bh;
616 } 616 }
617 status = ocfs2_journal_access(handle, lqinode, bh, 617 status = ocfs2_journal_access_dq(handle, lqinode, bh,
618 OCFS2_JOURNAL_ACCESS_WRITE); 618 OCFS2_JOURNAL_ACCESS_WRITE);
619 if (status < 0) { 619 if (status < 0) {
620 mlog_errno(status); 620 mlog_errno(status);
621 goto out_trans; 621 goto out_trans;
@@ -981,8 +981,8 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk(
981 goto out; 981 goto out;
982 } 982 }
983 983
984 status = ocfs2_journal_access(handle, lqinode, bh, 984 status = ocfs2_journal_access_dq(handle, lqinode, bh,
985 OCFS2_JOURNAL_ACCESS_WRITE); 985 OCFS2_JOURNAL_ACCESS_WRITE);
986 if (status < 0) { 986 if (status < 0) {
987 mlog_errno(status); 987 mlog_errno(status);
988 goto out_trans; 988 goto out_trans;
@@ -1074,7 +1074,7 @@ static struct ocfs2_quota_chunk *ocfs2_extend_local_quota_file(
1074 mlog_errno(status); 1074 mlog_errno(status);
1075 goto out; 1075 goto out;
1076 } 1076 }
1077 status = ocfs2_journal_access(handle, lqinode, chunk->qc_headerbh, 1077 status = ocfs2_journal_access_dq(handle, lqinode, chunk->qc_headerbh,
1078 OCFS2_JOURNAL_ACCESS_WRITE); 1078 OCFS2_JOURNAL_ACCESS_WRITE);
1079 if (status < 0) { 1079 if (status < 0) {
1080 mlog_errno(status); 1080 mlog_errno(status);
@@ -1207,7 +1207,7 @@ static int ocfs2_local_release_dquot(struct dquot *dquot)
1207 goto out; 1207 goto out;
1208 } 1208 }
1209 1209
1210 status = ocfs2_journal_access(handle, sb_dqopt(sb)->files[type], 1210 status = ocfs2_journal_access_dq(handle, sb_dqopt(sb)->files[type],
1211 od->dq_chunk->qc_headerbh, OCFS2_JOURNAL_ACCESS_WRITE); 1211 od->dq_chunk->qc_headerbh, OCFS2_JOURNAL_ACCESS_WRITE);
1212 if (status < 0) { 1212 if (status < 0) {
1213 mlog_errno(status); 1213 mlog_errno(status);