1 From: Joel Becker <joel.becker@oracle.com>
2 Subject: ocfs2: Comment struct ocfs2_extent_tree_operations.
3 Patch-mainline: 2.6.28?
6 struct ocfs2_extent_tree_operations provides methods for the different
7 on-disk btrees in ocfs2. Describing what those methods do is probably a
10 Signed-off-by: Joel Becker <joel.becker@oracle.com>
11 Acked-by: Mark Fasheh <mark.fasheh@suse.com>
13 fs/ocfs2/alloc.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
14 1 files changed, 43 insertions(+), 2 deletions(-)
16 diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
17 index d196d40..51c3183 100644
18 --- a/fs/ocfs2/alloc.c
19 +++ b/fs/ocfs2/alloc.c
21 #include "buffer_head_io.h"
25 + * Operations for a specific extent tree type.
27 + * To implement an on-disk btree (extent tree) type in ocfs2, add
28 + * an ocfs2_extent_tree_operations structure and the matching
29 + * ocfs2_get_<thingy>_extent_tree() function. That's pretty much it
30 + * for the allocation portion of the extent tree.
32 struct ocfs2_extent_tree_operations {
34 + * last_eb_blk is the block number of the right most leaf extent
35 + * block. Most on-disk structures containing an extent tree store
36 + * this value for fast access. The ->eo_set_last_eb_blk() and
37 + * ->eo_get_last_eb_blk() operations access this value. They are
40 void (*eo_set_last_eb_blk)(struct ocfs2_extent_tree *et,
42 u64 (*eo_get_last_eb_blk)(struct ocfs2_extent_tree *et);
45 + * The on-disk structure usually keeps track of how many total
46 + * clusters are stored in this extent tree. This function updates
47 + * that value. new_clusters is the delta, and must be
48 + * added to the total. Required.
50 void (*eo_update_clusters)(struct inode *inode,
51 struct ocfs2_extent_tree *et,
55 + * If ->eo_insert_check() exists, it is called before rec is
56 + * inserted into the extent tree. It is optional.
58 int (*eo_insert_check)(struct inode *inode,
59 struct ocfs2_extent_tree *et,
60 struct ocfs2_extent_rec *rec);
61 int (*eo_sanity_check)(struct inode *inode, struct ocfs2_extent_tree *et);
63 - /* These are internal to ocfs2_extent_tree and don't have
64 - * accessor functions */
66 + * --------------------------------------------------------------
67 + * The remaining are internal to ocfs2_extent_tree and don't have
68 + * accessor functions
72 + * ->eo_fill_root_el() takes et->et_object and sets et->et_root_el.
75 void (*eo_fill_root_el)(struct ocfs2_extent_tree *et);
78 + * ->eo_fill_max_leaf_clusters sets et->et_max_leaf_clusters if
79 + * it exists. If it does not, et->et_max_leaf_clusters is set
80 + * to 0 (unlimited). Optional.
82 void (*eo_fill_max_leaf_clusters)(struct inode *inode,
83 struct ocfs2_extent_tree *et);