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 file changed, 43 insertions(+), 2 deletions(-)
16 --- a/fs/ocfs2/alloc.c
17 +++ b/fs/ocfs2/alloc.c
19 #include "buffer_head_io.h"
23 + * Operations for a specific extent tree type.
25 + * To implement an on-disk btree (extent tree) type in ocfs2, add
26 + * an ocfs2_extent_tree_operations structure and the matching
27 + * ocfs2_get_<thingy>_extent_tree() function. That's pretty much it
28 + * for the allocation portion of the extent tree.
30 struct ocfs2_extent_tree_operations {
32 + * last_eb_blk is the block number of the right most leaf extent
33 + * block. Most on-disk structures containing an extent tree store
34 + * this value for fast access. The ->eo_set_last_eb_blk() and
35 + * ->eo_get_last_eb_blk() operations access this value. They are
38 void (*eo_set_last_eb_blk)(struct ocfs2_extent_tree *et,
40 u64 (*eo_get_last_eb_blk)(struct ocfs2_extent_tree *et);
43 + * The on-disk structure usually keeps track of how many total
44 + * clusters are stored in this extent tree. This function updates
45 + * that value. new_clusters is the delta, and must be
46 + * added to the total. Required.
48 void (*eo_update_clusters)(struct inode *inode,
49 struct ocfs2_extent_tree *et,
53 + * If ->eo_insert_check() exists, it is called before rec is
54 + * inserted into the extent tree. It is optional.
56 int (*eo_insert_check)(struct inode *inode,
57 struct ocfs2_extent_tree *et,
58 struct ocfs2_extent_rec *rec);
59 int (*eo_sanity_check)(struct inode *inode, struct ocfs2_extent_tree *et);
61 - /* These are internal to ocfs2_extent_tree and don't have
62 - * accessor functions */
64 + * --------------------------------------------------------------
65 + * The remaining are internal to ocfs2_extent_tree and don't have
66 + * accessor functions
70 + * ->eo_fill_root_el() takes et->et_object and sets et->et_root_el.
73 void (*eo_fill_root_el)(struct ocfs2_extent_tree *et);
76 + * ->eo_fill_max_leaf_clusters sets et->et_max_leaf_clusters if
77 + * it exists. If it does not, et->et_max_leaf_clusters is set
78 + * to 0 (unlimited). Optional.
80 void (*eo_fill_max_leaf_clusters)(struct inode *inode,
81 struct ocfs2_extent_tree *et);