diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-10-17 22:25:01 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:40:32 -0500 |
commit | 13723d00e374c2a6d6ccb5af6de965e89c3e1b01 (patch) | |
tree | 70dcd8f3d188bf2f62e4bf4b44a0662d8cd527ca /fs/ocfs2/alloc.h | |
parent | ffdd7a54631f07918b75e324d86713a08c11ec06 (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/alloc.h')
-rw-r--r-- | fs/ocfs2/alloc.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ocfs2/alloc.h b/fs/ocfs2/alloc.h index 59d37d1b7d4c..4b6fea22748a 100644 --- a/fs/ocfs2/alloc.h +++ b/fs/ocfs2/alloc.h | |||
@@ -45,7 +45,9 @@ | |||
45 | * | 45 | * |
46 | * ocfs2_extent_tree contains info for the root of the b-tree, it must have a | 46 | * ocfs2_extent_tree contains info for the root of the b-tree, it must have a |
47 | * root ocfs2_extent_list and a root_bh so that they can be used in the b-tree | 47 | * root ocfs2_extent_list and a root_bh so that they can be used in the b-tree |
48 | * functions. | 48 | * functions. With metadata ecc, we now call different journal_access |
49 | * functions for each type of metadata, so it must have the | ||
50 | * root_journal_access function. | ||
49 | * ocfs2_extent_tree_operations abstract the normal operations we do for | 51 | * ocfs2_extent_tree_operations abstract the normal operations we do for |
50 | * the root of extent b-tree. | 52 | * the root of extent b-tree. |
51 | */ | 53 | */ |
@@ -54,6 +56,7 @@ struct ocfs2_extent_tree { | |||
54 | struct ocfs2_extent_tree_operations *et_ops; | 56 | struct ocfs2_extent_tree_operations *et_ops; |
55 | struct buffer_head *et_root_bh; | 57 | struct buffer_head *et_root_bh; |
56 | struct ocfs2_extent_list *et_root_el; | 58 | struct ocfs2_extent_list *et_root_el; |
59 | ocfs2_journal_access_func et_root_journal_access; | ||
57 | void *et_object; | 60 | void *et_object; |
58 | unsigned int et_max_leaf_clusters; | 61 | unsigned int et_max_leaf_clusters; |
59 | }; | 62 | }; |