]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: Joel Becker <joel.becker@oracle.com> |
2 | Subject: ocfs2: Comment struct ocfs2_extent_tree_operations. | |
3 | Patch-mainline: 2.6.28? | |
4 | References: FATE302067 | |
5 | ||
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 | |
8 | good idea. | |
9 | ||
10 | Signed-off-by: Joel Becker <joel.becker@oracle.com> | |
11 | Acked-by: Mark Fasheh <mark.fasheh@suse.com> | |
12 | --- | |
13 | fs/ocfs2/alloc.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- | |
14 | 1 files changed, 43 insertions(+), 2 deletions(-) | |
15 | ||
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 | |
20 | @@ -50,21 +50,62 @@ | |
21 | #include "buffer_head_io.h" | |
22 | ||
23 | ||
24 | +/* | |
25 | + * Operations for a specific extent tree type. | |
26 | + * | |
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. | |
31 | + */ | |
32 | struct ocfs2_extent_tree_operations { | |
33 | + /* | |
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 | |
38 | + * both required. | |
39 | + */ | |
40 | void (*eo_set_last_eb_blk)(struct ocfs2_extent_tree *et, | |
41 | u64 blkno); | |
42 | u64 (*eo_get_last_eb_blk)(struct ocfs2_extent_tree *et); | |
43 | + | |
44 | + /* | |
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. | |
49 | + */ | |
50 | void (*eo_update_clusters)(struct inode *inode, | |
51 | struct ocfs2_extent_tree *et, | |
52 | u32 new_clusters); | |
53 | + | |
54 | + /* | |
55 | + * If ->eo_insert_check() exists, it is called before rec is | |
56 | + * inserted into the extent tree. It is optional. | |
57 | + */ | |
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); | |
62 | ||
63 | - /* These are internal to ocfs2_extent_tree and don't have | |
64 | - * accessor functions */ | |
65 | + /* | |
66 | + * -------------------------------------------------------------- | |
67 | + * The remaining are internal to ocfs2_extent_tree and don't have | |
68 | + * accessor functions | |
69 | + */ | |
70 | + | |
71 | + /* | |
72 | + * ->eo_fill_root_el() takes et->et_object and sets et->et_root_el. | |
73 | + * It is required. | |
74 | + */ | |
75 | void (*eo_fill_root_el)(struct ocfs2_extent_tree *et); | |
76 | + | |
77 | + /* | |
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. | |
81 | + */ | |
82 | void (*eo_fill_max_leaf_clusters)(struct inode *inode, | |
83 | struct ocfs2_extent_tree *et); | |
84 | }; | |
85 | -- | |
86 | 1.5.4.5 | |
87 |