diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-08-21 20:11:10 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-10-13 19:57:05 -0400 |
commit | 1625f8ac151743e452ec062c2989669c508ffa48 (patch) | |
tree | 0da18fe83c3c0153c33ed1ad5903e4ae08e2fb6e /fs | |
parent | f99b9b7ccf6a691f653cec45f36bfdd1e94769c7 (diff) |
ocfs2: Comment struct ocfs2_extent_tree_operations.
struct ocfs2_extent_tree_operations provides methods for the different
on-disk btrees in ocfs2. Describing what those methods do is probably a
good idea.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/alloc.c | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 786a82982622..06b9bd73d6d2 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -50,21 +50,62 @@ | |||
50 | #include "buffer_head_io.h" | 50 | #include "buffer_head_io.h" |
51 | 51 | ||
52 | 52 | ||
53 | /* | ||
54 | * Operations for a specific extent tree type. | ||
55 | * | ||
56 | * To implement an on-disk btree (extent tree) type in ocfs2, add | ||
57 | * an ocfs2_extent_tree_operations structure and the matching | ||
58 | * ocfs2_get_<thingy>_extent_tree() function. That's pretty much it | ||
59 | * for the allocation portion of the extent tree. | ||
60 | */ | ||
53 | struct ocfs2_extent_tree_operations { | 61 | struct ocfs2_extent_tree_operations { |
62 | /* | ||
63 | * last_eb_blk is the block number of the right most leaf extent | ||
64 | * block. Most on-disk structures containing an extent tree store | ||
65 | * this value for fast access. The ->eo_set_last_eb_blk() and | ||
66 | * ->eo_get_last_eb_blk() operations access this value. They are | ||
67 | * both required. | ||
68 | */ | ||
54 | void (*eo_set_last_eb_blk)(struct ocfs2_extent_tree *et, | 69 | void (*eo_set_last_eb_blk)(struct ocfs2_extent_tree *et, |
55 | u64 blkno); | 70 | u64 blkno); |
56 | u64 (*eo_get_last_eb_blk)(struct ocfs2_extent_tree *et); | 71 | u64 (*eo_get_last_eb_blk)(struct ocfs2_extent_tree *et); |
72 | |||
73 | /* | ||
74 | * The on-disk structure usually keeps track of how many total | ||
75 | * clusters are stored in this extent tree. This function updates | ||
76 | * that value. new_clusters is the delta, and must be | ||
77 | * added to the total. Required. | ||
78 | */ | ||
57 | void (*eo_update_clusters)(struct inode *inode, | 79 | void (*eo_update_clusters)(struct inode *inode, |
58 | struct ocfs2_extent_tree *et, | 80 | struct ocfs2_extent_tree *et, |
59 | u32 new_clusters); | 81 | u32 new_clusters); |
82 | |||
83 | /* | ||
84 | * If ->eo_insert_check() exists, it is called before rec is | ||
85 | * inserted into the extent tree. It is optional. | ||
86 | */ | ||
60 | int (*eo_insert_check)(struct inode *inode, | 87 | int (*eo_insert_check)(struct inode *inode, |
61 | struct ocfs2_extent_tree *et, | 88 | struct ocfs2_extent_tree *et, |
62 | struct ocfs2_extent_rec *rec); | 89 | struct ocfs2_extent_rec *rec); |
63 | int (*eo_sanity_check)(struct inode *inode, struct ocfs2_extent_tree *et); | 90 | int (*eo_sanity_check)(struct inode *inode, struct ocfs2_extent_tree *et); |
64 | 91 | ||
65 | /* These are internal to ocfs2_extent_tree and don't have | 92 | /* |
66 | * accessor functions */ | 93 | * -------------------------------------------------------------- |
94 | * The remaining are internal to ocfs2_extent_tree and don't have | ||
95 | * accessor functions | ||
96 | */ | ||
97 | |||
98 | /* | ||
99 | * ->eo_fill_root_el() takes et->et_object and sets et->et_root_el. | ||
100 | * It is required. | ||
101 | */ | ||
67 | void (*eo_fill_root_el)(struct ocfs2_extent_tree *et); | 102 | void (*eo_fill_root_el)(struct ocfs2_extent_tree *et); |
103 | |||
104 | /* | ||
105 | * ->eo_fill_max_leaf_clusters sets et->et_max_leaf_clusters if | ||
106 | * it exists. If it does not, et->et_max_leaf_clusters is set | ||
107 | * to 0 (unlimited). Optional. | ||
108 | */ | ||
68 | void (*eo_fill_max_leaf_clusters)(struct inode *inode, | 109 | void (*eo_fill_max_leaf_clusters)(struct inode *inode, |
69 | struct ocfs2_extent_tree *et); | 110 | struct ocfs2_extent_tree *et); |
70 | }; | 111 | }; |