[Ocfs2-tools-devel] [PATCH 02/10] libocfs2: Add more members to ocfs2_extent_tree.
Tao Ma
tao.ma at oracle.com
Wed Sep 30 07:27:39 PDT 2009
Like ocfs2_path, we have to add blkno to ocfs2_extent_tree so
that we can have the block number for the root buf.
Different extent tree have different type of tree root.
So we need different root function method.
Signed-off-by: Tao Ma <tao.ma at oracle.com>
---
libocfs2/extent_tree.c | 9 +++++++--
libocfs2/extent_tree.h | 8 +++++++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/libocfs2/extent_tree.c b/libocfs2/extent_tree.c
index ee0a2b3..e4f59a9 100644
--- a/libocfs2/extent_tree.c
+++ b/libocfs2/extent_tree.c
@@ -61,11 +61,15 @@ static struct ocfs2_extent_tree_operations ocfs2_dinode_et_ops = {
static void __ocfs2_init_extent_tree(struct ocfs2_extent_tree *et,
ocfs2_filesys *fs,
char *buf,
+ uint64_t blkno,
+ ocfs2_root_write_func write,
void *obj,
struct ocfs2_extent_tree_operations *ops)
{
et->et_ops = ops;
et->et_root_buf = buf;
+ et->et_root_blkno = blkno;
+ et->et_root_write = write;
et->et_object = obj;
et->et_ops->eo_fill_root_el(et);
@@ -77,8 +81,9 @@ static void __ocfs2_init_extent_tree(struct ocfs2_extent_tree *et,
void ocfs2_init_dinode_extent_tree(struct ocfs2_extent_tree *et,
ocfs2_filesys *fs,
- char *buf)
+ char *buf, uint64_t blkno)
{
- __ocfs2_init_extent_tree(et, fs, buf,
+ __ocfs2_init_extent_tree(et, fs, buf, blkno,
+ ocfs2_write_inode,
buf, &ocfs2_dinode_et_ops);
}
diff --git a/libocfs2/extent_tree.h b/libocfs2/extent_tree.h
index b0df721..5f3c688 100644
--- a/libocfs2/extent_tree.h
+++ b/libocfs2/extent_tree.h
@@ -15,9 +15,15 @@
* General Public License for more details.
*/
+/* Useful typedef for passing around writing functions for extent tree root. */
+typedef errcode_t (*ocfs2_root_write_func)(ocfs2_filesys *fs,
+ uint64_t blkno,
+ char *root_buf);
struct ocfs2_extent_tree {
struct ocfs2_extent_tree_operations *et_ops;
char *et_root_buf;
+ uint64_t et_root_blkno;
+ ocfs2_root_write_func et_root_write;
struct ocfs2_extent_list *et_root_el;
void *et_object;
uint32_t et_max_leaf_clusters;
@@ -90,4 +96,4 @@ struct ocfs2_extent_tree_operations {
void ocfs2_init_dinode_extent_tree(struct ocfs2_extent_tree *et,
ocfs2_filesys *fs,
- char *buf);
+ char *buf, uint64_t blkno);
--
1.5.5
More information about the Ocfs2-tools-devel
mailing list