aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/journal.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/journal.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/journal.c')
-rw-r--r--fs/ocfs2/journal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index 2daa5848faf2..3b54dba0f74b 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -752,6 +752,7 @@ static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb,
752 if (replayed) 752 if (replayed)
753 ocfs2_bump_recovery_generation(fe); 753 ocfs2_bump_recovery_generation(fe);
754 754
755 ocfs2_compute_meta_ecc(osb->sb, bh->b_data, &fe->i_check);
755 status = ocfs2_write_block(osb, bh, journal->j_inode); 756 status = ocfs2_write_block(osb, bh, journal->j_inode);
756 if (status < 0) 757 if (status < 0)
757 mlog_errno(status); 758 mlog_errno(status);
@@ -1486,6 +1487,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
1486 osb->slot_recovery_generations[slot_num] = 1487 osb->slot_recovery_generations[slot_num] =
1487 ocfs2_get_recovery_generation(fe); 1488 ocfs2_get_recovery_generation(fe);
1488 1489
1490 ocfs2_compute_meta_ecc(osb->sb, bh->b_data, &fe->i_check);
1489 status = ocfs2_write_block(osb, bh, inode); 1491 status = ocfs2_write_block(osb, bh, inode);
1490 if (status < 0) 1492 if (status < 0)
1491 mlog_errno(status); 1493 mlog_errno(status);