1 From: Joel Becker <joel.becker@oracle.com>
2 Subject: ocfs2: Prefix the ocfs2_extent_tree structure.
3 Patch-mainline: 2.6.28?
6 The members of the ocfs2_extent_tree structure gain a prefix of 'et_'.
9 Signed-off-by: Joel Becker <joel.becker@oracle.com>
10 Acked-by: Mark Fasheh <mark.fasheh@suse.com>
12 fs/ocfs2/alloc.c | 118 ++++++++++++++++++++++++++++--------------------------
13 1 files changed, 61 insertions(+), 57 deletions(-)
15 diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
16 index 9fe49f2..ab16b89 100644
17 --- a/fs/ocfs2/alloc.c
18 +++ b/fs/ocfs2/alloc.c
19 @@ -75,28 +75,30 @@ struct ocfs2_extent_tree_operations {
22 struct ocfs2_extent_tree {
23 - enum ocfs2_extent_tree_type type;
24 - struct ocfs2_extent_tree_operations *eops;
25 - struct buffer_head *root_bh;
26 - struct ocfs2_extent_list *root_el;
28 - unsigned int max_leaf_clusters;
29 + enum ocfs2_extent_tree_type et_type;
30 + struct ocfs2_extent_tree_operations *et_ops;
31 + struct buffer_head *et_root_bh;
32 + struct ocfs2_extent_list *et_root_el;
34 + unsigned int et_max_leaf_clusters;
37 static void ocfs2_dinode_set_last_eb_blk(struct ocfs2_extent_tree *et,
40 - struct ocfs2_dinode *di = (struct ocfs2_dinode *)et->root_bh->b_data;
41 + struct ocfs2_dinode *di =
42 + (struct ocfs2_dinode *)et->et_root_bh->b_data;
44 - BUG_ON(et->type != OCFS2_DINODE_EXTENT);
45 + BUG_ON(et->et_type != OCFS2_DINODE_EXTENT);
46 di->i_last_eb_blk = cpu_to_le64(blkno);
49 static u64 ocfs2_dinode_get_last_eb_blk(struct ocfs2_extent_tree *et)
51 - struct ocfs2_dinode *di = (struct ocfs2_dinode *)et->root_bh->b_data;
52 + struct ocfs2_dinode *di =
53 + (struct ocfs2_dinode *)et->et_root_bh->b_data;
55 - BUG_ON(et->type != OCFS2_DINODE_EXTENT);
56 + BUG_ON(et->et_type != OCFS2_DINODE_EXTENT);
57 return le64_to_cpu(di->i_last_eb_blk);
60 @@ -105,7 +107,7 @@ static void ocfs2_dinode_update_clusters(struct inode *inode,
63 struct ocfs2_dinode *di =
64 - (struct ocfs2_dinode *)et->root_bh->b_data;
65 + (struct ocfs2_dinode *)et->et_root_bh->b_data;
67 le32_add_cpu(&di->i_clusters, clusters);
68 spin_lock(&OCFS2_I(inode)->ip_lock);
69 @@ -119,9 +121,9 @@ static int ocfs2_dinode_sanity_check(struct inode *inode,
71 struct ocfs2_dinode *di;
73 - BUG_ON(et->type != OCFS2_DINODE_EXTENT);
74 + BUG_ON(et->et_type != OCFS2_DINODE_EXTENT);
76 - di = (struct ocfs2_dinode *)et->root_bh->b_data;
77 + di = (struct ocfs2_dinode *)et->et_root_bh->b_data;
78 if (!OCFS2_IS_VALID_DINODE(di)) {
80 ocfs2_error(inode->i_sb,
81 @@ -143,7 +145,7 @@ static void ocfs2_xattr_value_set_last_eb_blk(struct ocfs2_extent_tree *et,
84 struct ocfs2_xattr_value_root *xv =
85 - (struct ocfs2_xattr_value_root *)et->private;
86 + (struct ocfs2_xattr_value_root *)et->et_private;
88 xv->xr_last_eb_blk = cpu_to_le64(blkno);
90 @@ -151,7 +153,7 @@ static void ocfs2_xattr_value_set_last_eb_blk(struct ocfs2_extent_tree *et,
91 static u64 ocfs2_xattr_value_get_last_eb_blk(struct ocfs2_extent_tree *et)
93 struct ocfs2_xattr_value_root *xv =
94 - (struct ocfs2_xattr_value_root *) et->private;
95 + (struct ocfs2_xattr_value_root *) et->et_private;
97 return le64_to_cpu(xv->xr_last_eb_blk);
99 @@ -161,7 +163,7 @@ static void ocfs2_xattr_value_update_clusters(struct inode *inode,
102 struct ocfs2_xattr_value_root *xv =
103 - (struct ocfs2_xattr_value_root *)et->private;
104 + (struct ocfs2_xattr_value_root *)et->et_private;
106 le32_add_cpu(&xv->xr_clusters, clusters);
108 @@ -183,7 +185,7 @@ static void ocfs2_xattr_tree_set_last_eb_blk(struct ocfs2_extent_tree *et,
111 struct ocfs2_xattr_block *xb =
112 - (struct ocfs2_xattr_block *) et->root_bh->b_data;
113 + (struct ocfs2_xattr_block *) et->et_root_bh->b_data;
114 struct ocfs2_xattr_tree_root *xt = &xb->xb_attrs.xb_root;
116 xt->xt_last_eb_blk = cpu_to_le64(blkno);
117 @@ -192,7 +194,7 @@ static void ocfs2_xattr_tree_set_last_eb_blk(struct ocfs2_extent_tree *et,
118 static u64 ocfs2_xattr_tree_get_last_eb_blk(struct ocfs2_extent_tree *et)
120 struct ocfs2_xattr_block *xb =
121 - (struct ocfs2_xattr_block *) et->root_bh->b_data;
122 + (struct ocfs2_xattr_block *) et->et_root_bh->b_data;
123 struct ocfs2_xattr_tree_root *xt = &xb->xb_attrs.xb_root;
125 return le64_to_cpu(xt->xt_last_eb_blk);
126 @@ -203,7 +205,7 @@ static void ocfs2_xattr_tree_update_clusters(struct inode *inode,
129 struct ocfs2_xattr_block *xb =
130 - (struct ocfs2_xattr_block *)et->root_bh->b_data;
131 + (struct ocfs2_xattr_block *)et->et_root_bh->b_data;
133 le32_add_cpu(&xb->xb_attrs.xb_root.xt_clusters, clusters);
135 @@ -233,25 +235,26 @@ static struct ocfs2_extent_tree*
139 - et->type = et_type;
140 + et->et_type = et_type;
143 - et->private = private;
144 + et->et_root_bh = bh;
145 + et->et_private = private;
147 if (et_type == OCFS2_DINODE_EXTENT) {
148 - et->root_el = &((struct ocfs2_dinode *)bh->b_data)->id2.i_list;
149 - et->eops = &ocfs2_dinode_et_ops;
151 + &((struct ocfs2_dinode *)bh->b_data)->id2.i_list;
152 + et->et_ops = &ocfs2_dinode_et_ops;
153 } else if (et_type == OCFS2_XATTR_VALUE_EXTENT) {
154 struct ocfs2_xattr_value_root *xv =
155 (struct ocfs2_xattr_value_root *) private;
156 - et->root_el = &xv->xr_list;
157 - et->eops = &ocfs2_xattr_et_ops;
158 + et->et_root_el = &xv->xr_list;
159 + et->et_ops = &ocfs2_xattr_et_ops;
160 } else if (et_type == OCFS2_XATTR_TREE_EXTENT) {
161 struct ocfs2_xattr_block *xb =
162 (struct ocfs2_xattr_block *)bh->b_data;
163 - et->root_el = &xb->xb_attrs.xb_root.xt_list;
164 - et->eops = &ocfs2_xattr_tree_et_ops;
165 - et->max_leaf_clusters = ocfs2_clusters_for_bytes(inode->i_sb,
166 + et->et_root_el = &xb->xb_attrs.xb_root.xt_list;
167 + et->et_ops = &ocfs2_xattr_tree_et_ops;
168 + et->et_max_leaf_clusters = ocfs2_clusters_for_bytes(inode->i_sb,
169 OCFS2_MAX_XATTR_TREE_LEAF_SIZE);
172 @@ -261,7 +264,7 @@ static struct ocfs2_extent_tree*
173 static void ocfs2_free_extent_tree(struct ocfs2_extent_tree *et)
176 - brelse(et->root_bh);
177 + brelse(et->et_root_bh);
181 @@ -269,25 +272,25 @@ static void ocfs2_free_extent_tree(struct ocfs2_extent_tree *et)
182 static inline void ocfs2_et_set_last_eb_blk(struct ocfs2_extent_tree *et,
185 - et->eops->eo_set_last_eb_blk(et, new_last_eb_blk);
186 + et->et_ops->eo_set_last_eb_blk(et, new_last_eb_blk);
189 static inline u64 ocfs2_et_get_last_eb_blk(struct ocfs2_extent_tree *et)
191 - return et->eops->eo_get_last_eb_blk(et);
192 + return et->et_ops->eo_get_last_eb_blk(et);
195 static inline void ocfs2_et_update_clusters(struct inode *inode,
196 struct ocfs2_extent_tree *et,
199 - et->eops->eo_update_clusters(inode, et, clusters);
200 + et->et_ops->eo_update_clusters(inode, et, clusters);
203 static inline int ocfs2_et_sanity_check(struct inode *inode,
204 struct ocfs2_extent_tree *et)
206 - return et->eops->eo_sanity_check(inode, et);
207 + return et->et_ops->eo_sanity_check(inode, et);
210 static void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc);
211 @@ -805,7 +808,7 @@ static int ocfs2_add_branch(struct ocfs2_super *osb,
212 eb = (struct ocfs2_extent_block *) eb_bh->b_data;
216 + el = et->et_root_el;
218 /* we never add a branch to a leaf. */
219 BUG_ON(!el->l_tree_depth);
220 @@ -895,7 +898,7 @@ static int ocfs2_add_branch(struct ocfs2_super *osb,
224 - status = ocfs2_journal_access(handle, inode, et->root_bh,
225 + status = ocfs2_journal_access(handle, inode, et->et_root_bh,
226 OCFS2_JOURNAL_ACCESS_WRITE);
229 @@ -928,7 +931,7 @@ static int ocfs2_add_branch(struct ocfs2_super *osb,
230 status = ocfs2_journal_dirty(handle, *last_eb_bh);
233 - status = ocfs2_journal_dirty(handle, et->root_bh);
234 + status = ocfs2_journal_dirty(handle, et->et_root_bh);
238 @@ -994,7 +997,7 @@ static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
242 - root_el = et->root_el;
243 + root_el = et->et_root_el;
245 status = ocfs2_journal_access(handle, inode, new_eb_bh,
246 OCFS2_JOURNAL_ACCESS_CREATE);
247 @@ -1015,7 +1018,7 @@ static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
251 - status = ocfs2_journal_access(handle, inode, et->root_bh,
252 + status = ocfs2_journal_access(handle, inode, et->et_root_bh,
253 OCFS2_JOURNAL_ACCESS_WRITE);
256 @@ -1038,7 +1041,7 @@ static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
257 if (root_el->l_tree_depth == cpu_to_le16(1))
258 ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
260 - status = ocfs2_journal_dirty(handle, et->root_bh);
261 + status = ocfs2_journal_dirty(handle, et->et_root_bh);
265 @@ -1088,7 +1091,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb,
270 + el = et->et_root_el;
272 while(le16_to_cpu(el->l_tree_depth) > 1) {
273 if (le16_to_cpu(el->l_next_free_rec) == 0) {
274 @@ -1140,7 +1143,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb,
276 /* If we didn't find one and the fe doesn't have any room,
279 + el = et->et_root_el;
280 if (!lowest_bh && (el->l_next_free_rec == el->l_count))
283 @@ -1169,7 +1172,7 @@ static int ocfs2_grow_tree(struct inode *inode, handle_t *handle,
284 struct ocfs2_alloc_context *meta_ac)
287 - struct ocfs2_extent_list *el = et->root_el;
288 + struct ocfs2_extent_list *el = et->et_root_el;
289 int depth = le16_to_cpu(el->l_tree_depth);
290 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
291 struct buffer_head *bh = NULL;
292 @@ -2774,7 +2777,7 @@ static int ocfs2_remove_rightmost_path(struct inode *inode, handle_t *handle,
294 ocfs2_unlink_path(inode, handle, dealloc, path, 1);
297 + el = et->et_root_el;
298 el->l_tree_depth = 0;
299 el->l_next_free_rec = 0;
300 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
301 @@ -3907,9 +3910,9 @@ static int ocfs2_do_insert_extent(struct inode *inode,
302 struct ocfs2_path *left_path = NULL;
303 struct ocfs2_extent_list *el;
306 + el = et->et_root_el;
308 - ret = ocfs2_journal_access(handle, inode, et->root_bh,
309 + ret = ocfs2_journal_access(handle, inode, et->et_root_bh,
310 OCFS2_JOURNAL_ACCESS_WRITE);
313 @@ -3921,7 +3924,7 @@ static int ocfs2_do_insert_extent(struct inode *inode,
314 goto out_update_clusters;
317 - right_path = ocfs2_new_path(et->root_bh, et->root_el);
318 + right_path = ocfs2_new_path(et->et_root_bh, et->et_root_el);
322 @@ -3971,7 +3974,7 @@ static int ocfs2_do_insert_extent(struct inode *inode,
323 * ocfs2_rotate_tree_right() might have extended the
324 * transaction without re-journaling our tree root.
326 - ret = ocfs2_journal_access(handle, inode, et->root_bh,
327 + ret = ocfs2_journal_access(handle, inode, et->et_root_bh,
328 OCFS2_JOURNAL_ACCESS_WRITE);
331 @@ -3999,7 +4002,7 @@ out_update_clusters:
332 ocfs2_et_update_clusters(inode, et,
333 le16_to_cpu(insert_rec->e_leaf_clusters));
335 - ret = ocfs2_journal_dirty(handle, et->root_bh);
336 + ret = ocfs2_journal_dirty(handle, et->et_root_bh);
340 @@ -4157,7 +4160,8 @@ static void ocfs2_figure_contig_type(struct inode *inode,
341 * Caller might want us to limit the size of extents, don't
342 * calculate contiguousness if we might exceed that limit.
344 - if (et->max_leaf_clusters && len > et->max_leaf_clusters)
345 + if (et->et_max_leaf_clusters &&
346 + (len > et->et_max_leaf_clusters))
347 insert->ins_contig = CONTIG_NONE;
350 @@ -4234,7 +4238,7 @@ static int ocfs2_figure_insert_type(struct inode *inode,
352 insert->ins_split = SPLIT_NONE;
355 + el = et->et_root_el;
356 insert->ins_tree_depth = le16_to_cpu(el->l_tree_depth);
358 if (el->l_tree_depth) {
359 @@ -4272,7 +4276,7 @@ static int ocfs2_figure_insert_type(struct inode *inode,
363 - path = ocfs2_new_path(et->root_bh, et->root_el);
364 + path = ocfs2_new_path(et->et_root_bh, et->et_root_el);
368 @@ -4413,7 +4417,7 @@ static int ocfs2_insert_extent(struct ocfs2_super *osb,
369 status = ocfs2_do_insert_extent(inode, handle, et, &rec, &insert);
372 - else if (et->type == OCFS2_DINODE_EXTENT)
373 + else if (et->et_type == OCFS2_DINODE_EXTENT)
374 ocfs2_extent_map_insert_rec(inode, &rec);
377 @@ -4687,7 +4691,7 @@ leftright:
379 rec = path_leaf_el(path)->l_recs[split_index];
381 - rightmost_el = et->root_el;
382 + rightmost_el = et->et_root_el;
384 depth = le16_to_cpu(rightmost_el->l_tree_depth);
386 @@ -4930,7 +4934,7 @@ int ocfs2_mark_extent_written(struct inode *inode, struct buffer_head *root_bh,
387 if (et_type == OCFS2_DINODE_EXTENT)
388 ocfs2_extent_map_trunc(inode, 0);
390 - left_path = ocfs2_new_path(et->root_bh, et->root_el);
391 + left_path = ocfs2_new_path(et->et_root_bh, et->et_root_el);
395 @@ -5010,7 +5014,7 @@ static int ocfs2_split_tree(struct inode *inode, struct ocfs2_extent_tree *et,
396 rightmost_el = path_leaf_el(path);
398 credits += path->p_tree_depth +
399 - ocfs2_extend_meta_needed(et->root_el);
400 + ocfs2_extend_meta_needed(et->et_root_el);
401 ret = ocfs2_extend_trans(handle, credits);
404 @@ -5223,7 +5227,7 @@ int ocfs2_remove_extent(struct inode *inode, struct buffer_head *root_bh,
406 ocfs2_extent_map_trunc(inode, 0);
408 - path = ocfs2_new_path(et->root_bh, et->root_el);
409 + path = ocfs2_new_path(et->et_root_bh, et->et_root_el);