Lines Matching full:et

69 	void (*eo_set_last_eb_blk)(struct ocfs2_extent_tree *et,
71 u64 (*eo_get_last_eb_blk)(struct ocfs2_extent_tree *et);
79 void (*eo_update_clusters)(struct ocfs2_extent_tree *et,
86 void (*eo_extent_map_insert)(struct ocfs2_extent_tree *et,
93 void (*eo_extent_map_truncate)(struct ocfs2_extent_tree *et,
100 int (*eo_insert_check)(struct ocfs2_extent_tree *et,
102 int (*eo_sanity_check)(struct ocfs2_extent_tree *et);
111 * ->eo_fill_root_el() takes et->et_object and sets et->et_root_el.
114 void (*eo_fill_root_el)(struct ocfs2_extent_tree *et);
117 * ->eo_fill_max_leaf_clusters sets et->et_max_leaf_clusters if
118 * it exists. If it does not, et->et_max_leaf_clusters is set
121 void (*eo_fill_max_leaf_clusters)(struct ocfs2_extent_tree *et);
129 (*eo_extent_contig)(struct ocfs2_extent_tree *et,
139 static u64 ocfs2_dinode_get_last_eb_blk(struct ocfs2_extent_tree *et);
140 static void ocfs2_dinode_set_last_eb_blk(struct ocfs2_extent_tree *et,
142 static void ocfs2_dinode_update_clusters(struct ocfs2_extent_tree *et,
144 static void ocfs2_dinode_extent_map_insert(struct ocfs2_extent_tree *et,
146 static void ocfs2_dinode_extent_map_truncate(struct ocfs2_extent_tree *et,
148 static int ocfs2_dinode_insert_check(struct ocfs2_extent_tree *et,
150 static int ocfs2_dinode_sanity_check(struct ocfs2_extent_tree *et);
151 static void ocfs2_dinode_fill_root_el(struct ocfs2_extent_tree *et);
154 struct ocfs2_extent_tree *et,
157 static int ocfs2_is_dealloc_empty(struct ocfs2_extent_tree *et);
170 static void ocfs2_dinode_set_last_eb_blk(struct ocfs2_extent_tree *et, in ocfs2_dinode_set_last_eb_blk() argument
173 struct ocfs2_dinode *di = et->et_object; in ocfs2_dinode_set_last_eb_blk()
175 BUG_ON(et->et_ops != &ocfs2_dinode_et_ops); in ocfs2_dinode_set_last_eb_blk()
179 static u64 ocfs2_dinode_get_last_eb_blk(struct ocfs2_extent_tree *et) in ocfs2_dinode_get_last_eb_blk() argument
181 struct ocfs2_dinode *di = et->et_object; in ocfs2_dinode_get_last_eb_blk()
183 BUG_ON(et->et_ops != &ocfs2_dinode_et_ops); in ocfs2_dinode_get_last_eb_blk()
187 static void ocfs2_dinode_update_clusters(struct ocfs2_extent_tree *et, in ocfs2_dinode_update_clusters() argument
190 struct ocfs2_inode_info *oi = cache_info_to_inode(et->et_ci); in ocfs2_dinode_update_clusters()
191 struct ocfs2_dinode *di = et->et_object; in ocfs2_dinode_update_clusters()
199 static void ocfs2_dinode_extent_map_insert(struct ocfs2_extent_tree *et, in ocfs2_dinode_extent_map_insert() argument
202 struct inode *inode = &cache_info_to_inode(et->et_ci)->vfs_inode; in ocfs2_dinode_extent_map_insert()
207 static void ocfs2_dinode_extent_map_truncate(struct ocfs2_extent_tree *et, in ocfs2_dinode_extent_map_truncate() argument
210 struct inode *inode = &cache_info_to_inode(et->et_ci)->vfs_inode; in ocfs2_dinode_extent_map_truncate()
215 static int ocfs2_dinode_insert_check(struct ocfs2_extent_tree *et, in ocfs2_dinode_insert_check() argument
218 struct ocfs2_inode_info *oi = cache_info_to_inode(et->et_ci); in ocfs2_dinode_insert_check()
233 static int ocfs2_dinode_sanity_check(struct ocfs2_extent_tree *et) in ocfs2_dinode_sanity_check() argument
235 struct ocfs2_dinode *di = et->et_object; in ocfs2_dinode_sanity_check()
237 BUG_ON(et->et_ops != &ocfs2_dinode_et_ops); in ocfs2_dinode_sanity_check()
243 static void ocfs2_dinode_fill_root_el(struct ocfs2_extent_tree *et) in ocfs2_dinode_fill_root_el() argument
245 struct ocfs2_dinode *di = et->et_object; in ocfs2_dinode_fill_root_el()
247 et->et_root_el = &di->id2.i_list; in ocfs2_dinode_fill_root_el()
251 static void ocfs2_xattr_value_fill_root_el(struct ocfs2_extent_tree *et) in ocfs2_xattr_value_fill_root_el() argument
253 struct ocfs2_xattr_value_buf *vb = et->et_object; in ocfs2_xattr_value_fill_root_el()
255 et->et_root_el = &vb->vb_xv->xr_list; in ocfs2_xattr_value_fill_root_el()
258 static void ocfs2_xattr_value_set_last_eb_blk(struct ocfs2_extent_tree *et, in ocfs2_xattr_value_set_last_eb_blk() argument
261 struct ocfs2_xattr_value_buf *vb = et->et_object; in ocfs2_xattr_value_set_last_eb_blk()
266 static u64 ocfs2_xattr_value_get_last_eb_blk(struct ocfs2_extent_tree *et) in ocfs2_xattr_value_get_last_eb_blk() argument
268 struct ocfs2_xattr_value_buf *vb = et->et_object; in ocfs2_xattr_value_get_last_eb_blk()
273 static void ocfs2_xattr_value_update_clusters(struct ocfs2_extent_tree *et, in ocfs2_xattr_value_update_clusters() argument
276 struct ocfs2_xattr_value_buf *vb = et->et_object; in ocfs2_xattr_value_update_clusters()
288 static void ocfs2_xattr_tree_fill_root_el(struct ocfs2_extent_tree *et) in ocfs2_xattr_tree_fill_root_el() argument
290 struct ocfs2_xattr_block *xb = et->et_object; in ocfs2_xattr_tree_fill_root_el()
292 et->et_root_el = &xb->xb_attrs.xb_root.xt_list; in ocfs2_xattr_tree_fill_root_el()
295 static void ocfs2_xattr_tree_fill_max_leaf_clusters(struct ocfs2_extent_tree *et) in ocfs2_xattr_tree_fill_max_leaf_clusters() argument
297 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in ocfs2_xattr_tree_fill_max_leaf_clusters()
298 et->et_max_leaf_clusters = in ocfs2_xattr_tree_fill_max_leaf_clusters()
302 static void ocfs2_xattr_tree_set_last_eb_blk(struct ocfs2_extent_tree *et, in ocfs2_xattr_tree_set_last_eb_blk() argument
305 struct ocfs2_xattr_block *xb = et->et_object; in ocfs2_xattr_tree_set_last_eb_blk()
311 static u64 ocfs2_xattr_tree_get_last_eb_blk(struct ocfs2_extent_tree *et) in ocfs2_xattr_tree_get_last_eb_blk() argument
313 struct ocfs2_xattr_block *xb = et->et_object; in ocfs2_xattr_tree_get_last_eb_blk()
319 static void ocfs2_xattr_tree_update_clusters(struct ocfs2_extent_tree *et, in ocfs2_xattr_tree_update_clusters() argument
322 struct ocfs2_xattr_block *xb = et->et_object; in ocfs2_xattr_tree_update_clusters()
335 static void ocfs2_dx_root_set_last_eb_blk(struct ocfs2_extent_tree *et, in ocfs2_dx_root_set_last_eb_blk() argument
338 struct ocfs2_dx_root_block *dx_root = et->et_object; in ocfs2_dx_root_set_last_eb_blk()
343 static u64 ocfs2_dx_root_get_last_eb_blk(struct ocfs2_extent_tree *et) in ocfs2_dx_root_get_last_eb_blk() argument
345 struct ocfs2_dx_root_block *dx_root = et->et_object; in ocfs2_dx_root_get_last_eb_blk()
350 static void ocfs2_dx_root_update_clusters(struct ocfs2_extent_tree *et, in ocfs2_dx_root_update_clusters() argument
353 struct ocfs2_dx_root_block *dx_root = et->et_object; in ocfs2_dx_root_update_clusters()
358 static int ocfs2_dx_root_sanity_check(struct ocfs2_extent_tree *et) in ocfs2_dx_root_sanity_check() argument
360 struct ocfs2_dx_root_block *dx_root = et->et_object; in ocfs2_dx_root_sanity_check()
367 static void ocfs2_dx_root_fill_root_el(struct ocfs2_extent_tree *et) in ocfs2_dx_root_fill_root_el() argument
369 struct ocfs2_dx_root_block *dx_root = et->et_object; in ocfs2_dx_root_fill_root_el()
371 et->et_root_el = &dx_root->dr_list; in ocfs2_dx_root_fill_root_el()
382 static void ocfs2_refcount_tree_fill_root_el(struct ocfs2_extent_tree *et) in ocfs2_refcount_tree_fill_root_el() argument
384 struct ocfs2_refcount_block *rb = et->et_object; in ocfs2_refcount_tree_fill_root_el()
386 et->et_root_el = &rb->rf_list; in ocfs2_refcount_tree_fill_root_el()
389 static void ocfs2_refcount_tree_set_last_eb_blk(struct ocfs2_extent_tree *et, in ocfs2_refcount_tree_set_last_eb_blk() argument
392 struct ocfs2_refcount_block *rb = et->et_object; in ocfs2_refcount_tree_set_last_eb_blk()
397 static u64 ocfs2_refcount_tree_get_last_eb_blk(struct ocfs2_extent_tree *et) in ocfs2_refcount_tree_get_last_eb_blk() argument
399 struct ocfs2_refcount_block *rb = et->et_object; in ocfs2_refcount_tree_get_last_eb_blk()
404 static void ocfs2_refcount_tree_update_clusters(struct ocfs2_extent_tree *et, in ocfs2_refcount_tree_update_clusters() argument
407 struct ocfs2_refcount_block *rb = et->et_object; in ocfs2_refcount_tree_update_clusters()
413 ocfs2_refcount_tree_extent_contig(struct ocfs2_extent_tree *et, in ocfs2_refcount_tree_extent_contig() argument
428 static void __ocfs2_init_extent_tree(struct ocfs2_extent_tree *et, in __ocfs2_init_extent_tree() argument
435 et->et_ops = ops; in __ocfs2_init_extent_tree()
436 et->et_root_bh = bh; in __ocfs2_init_extent_tree()
437 et->et_ci = ci; in __ocfs2_init_extent_tree()
438 et->et_root_journal_access = access; in __ocfs2_init_extent_tree()
441 et->et_object = obj; in __ocfs2_init_extent_tree()
442 et->et_dealloc = NULL; in __ocfs2_init_extent_tree()
444 et->et_ops->eo_fill_root_el(et); in __ocfs2_init_extent_tree()
445 if (!et->et_ops->eo_fill_max_leaf_clusters) in __ocfs2_init_extent_tree()
446 et->et_max_leaf_clusters = 0; in __ocfs2_init_extent_tree()
448 et->et_ops->eo_fill_max_leaf_clusters(et); in __ocfs2_init_extent_tree()
451 void ocfs2_init_dinode_extent_tree(struct ocfs2_extent_tree *et, in ocfs2_init_dinode_extent_tree() argument
455 __ocfs2_init_extent_tree(et, ci, bh, ocfs2_journal_access_di, in ocfs2_init_dinode_extent_tree()
459 void ocfs2_init_xattr_tree_extent_tree(struct ocfs2_extent_tree *et, in ocfs2_init_xattr_tree_extent_tree() argument
463 __ocfs2_init_extent_tree(et, ci, bh, ocfs2_journal_access_xb, in ocfs2_init_xattr_tree_extent_tree()
467 void ocfs2_init_xattr_value_extent_tree(struct ocfs2_extent_tree *et, in ocfs2_init_xattr_value_extent_tree() argument
471 __ocfs2_init_extent_tree(et, ci, vb->vb_bh, vb->vb_access, vb, in ocfs2_init_xattr_value_extent_tree()
475 void ocfs2_init_dx_root_extent_tree(struct ocfs2_extent_tree *et, in ocfs2_init_dx_root_extent_tree() argument
479 __ocfs2_init_extent_tree(et, ci, bh, ocfs2_journal_access_dr, in ocfs2_init_dx_root_extent_tree()
483 void ocfs2_init_refcount_extent_tree(struct ocfs2_extent_tree *et, in ocfs2_init_refcount_extent_tree() argument
487 __ocfs2_init_extent_tree(et, ci, bh, ocfs2_journal_access_rb, in ocfs2_init_refcount_extent_tree()
491 static inline void ocfs2_et_set_last_eb_blk(struct ocfs2_extent_tree *et, in ocfs2_et_set_last_eb_blk() argument
494 et->et_ops->eo_set_last_eb_blk(et, new_last_eb_blk); in ocfs2_et_set_last_eb_blk()
497 static inline u64 ocfs2_et_get_last_eb_blk(struct ocfs2_extent_tree *et) in ocfs2_et_get_last_eb_blk() argument
499 return et->et_ops->eo_get_last_eb_blk(et); in ocfs2_et_get_last_eb_blk()
502 static inline void ocfs2_et_update_clusters(struct ocfs2_extent_tree *et, in ocfs2_et_update_clusters() argument
505 et->et_ops->eo_update_clusters(et, clusters); in ocfs2_et_update_clusters()
508 static inline void ocfs2_et_extent_map_insert(struct ocfs2_extent_tree *et, in ocfs2_et_extent_map_insert() argument
511 if (et->et_ops->eo_extent_map_insert) in ocfs2_et_extent_map_insert()
512 et->et_ops->eo_extent_map_insert(et, rec); in ocfs2_et_extent_map_insert()
515 static inline void ocfs2_et_extent_map_truncate(struct ocfs2_extent_tree *et, in ocfs2_et_extent_map_truncate() argument
518 if (et->et_ops->eo_extent_map_truncate) in ocfs2_et_extent_map_truncate()
519 et->et_ops->eo_extent_map_truncate(et, clusters); in ocfs2_et_extent_map_truncate()
523 struct ocfs2_extent_tree *et, in ocfs2_et_root_journal_access() argument
526 return et->et_root_journal_access(handle, et->et_ci, et->et_root_bh, in ocfs2_et_root_journal_access()
531 ocfs2_et_extent_contig(struct ocfs2_extent_tree *et, in ocfs2_et_extent_contig() argument
535 if (et->et_ops->eo_extent_contig) in ocfs2_et_extent_contig()
536 return et->et_ops->eo_extent_contig(et, rec, insert_rec); in ocfs2_et_extent_contig()
539 ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_et_extent_contig()
543 static inline int ocfs2_et_insert_check(struct ocfs2_extent_tree *et, in ocfs2_et_insert_check() argument
548 if (et->et_ops->eo_insert_check) in ocfs2_et_insert_check()
549 ret = et->et_ops->eo_insert_check(et, rec); in ocfs2_et_insert_check()
553 static inline int ocfs2_et_sanity_check(struct ocfs2_extent_tree *et) in ocfs2_et_sanity_check() argument
557 if (et->et_ops->eo_sanity_check) in ocfs2_et_sanity_check()
558 ret = et->et_ops->eo_sanity_check(et); in ocfs2_et_sanity_check()
565 struct ocfs2_extent_tree *et,
706 struct ocfs2_path *ocfs2_new_path_from_et(struct ocfs2_extent_tree *et) in ocfs2_new_path_from_et() argument
708 return ocfs2_new_path(et->et_root_bh, et->et_root_el, in ocfs2_new_path_from_et()
709 et->et_root_journal_access); in ocfs2_new_path_from_et()
948 int ocfs2_num_free_extents(struct ocfs2_extent_tree *et) in ocfs2_num_free_extents() argument
956 el = et->et_root_el; in ocfs2_num_free_extents()
957 last_eb_blk = ocfs2_et_get_last_eb_blk(et); in ocfs2_num_free_extents()
960 retval = ocfs2_read_extent_block(et->et_ci, last_eb_blk, in ocfs2_num_free_extents()
971 retval = ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_num_free_extents()
973 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_num_free_extents()
993 struct ocfs2_extent_tree *et, in ocfs2_create_new_meta_bhs() argument
1003 OCFS2_SB(ocfs2_metadata_cache_get_super(et->et_ci)); in ocfs2_create_new_meta_bhs()
1027 ocfs2_set_new_buffer_uptodate(et->et_ci, bhs[i]); in ocfs2_create_new_meta_bhs()
1029 status = ocfs2_journal_access_eb(handle, et->et_ci, in ocfs2_create_new_meta_bhs()
1099 struct ocfs2_extent_tree *et) in ocfs2_adjust_rightmost_branch() argument
1106 path = ocfs2_new_path_from_et(et); in ocfs2_adjust_rightmost_branch()
1112 status = ocfs2_find_path(et->et_ci, path, UINT_MAX); in ocfs2_adjust_rightmost_branch()
1124 status = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_adjust_rightmost_branch()
1133 ocfs2_adjust_rightmost_records(handle, et, path, rec); in ocfs2_adjust_rightmost_branch()
1152 struct ocfs2_extent_tree *et, in ocfs2_add_branch() argument
1172 el = et->et_root_el; in ocfs2_add_branch()
1181 root_end = ocfs2_sum_rightmost_rec(et->et_root_el); in ocfs2_add_branch()
1193 ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_add_branch()
1196 status = ocfs2_adjust_rightmost_branch(handle, et); in ocfs2_add_branch()
1215 if (!ocfs2_is_dealloc_empty(et)) { in ocfs2_add_branch()
1216 status = ocfs2_reuse_blk_from_dealloc(handle, et, in ocfs2_add_branch()
1229 status = ocfs2_create_new_meta_bhs(handle, et, in ocfs2_add_branch()
1254 status = ocfs2_journal_access_eb(handle, et->et_ci, bh, in ocfs2_add_branch()
1289 status = ocfs2_journal_access_eb(handle, et->et_ci, *last_eb_bh, in ocfs2_add_branch()
1295 status = ocfs2_et_root_journal_access(handle, et, in ocfs2_add_branch()
1302 status = ocfs2_journal_access_eb(handle, et->et_ci, eb_bh, in ocfs2_add_branch()
1320 ocfs2_et_set_last_eb_blk(et, new_last_eb_blk); in ocfs2_add_branch()
1326 ocfs2_journal_dirty(handle, et->et_root_bh); in ocfs2_add_branch()
1355 struct ocfs2_extent_tree *et, in ocfs2_shift_tree_depth() argument
1366 if (!ocfs2_is_dealloc_empty(et)) { in ocfs2_shift_tree_depth()
1367 status = ocfs2_reuse_blk_from_dealloc(handle, et, in ocfs2_shift_tree_depth()
1371 status = ocfs2_create_new_meta_bhs(handle, et, 1, meta_ac, in ocfs2_shift_tree_depth()
1388 root_el = et->et_root_el; in ocfs2_shift_tree_depth()
1390 status = ocfs2_journal_access_eb(handle, et->et_ci, new_eb_bh, in ocfs2_shift_tree_depth()
1405 status = ocfs2_et_root_journal_access(handle, et, in ocfs2_shift_tree_depth()
1426 ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno)); in ocfs2_shift_tree_depth()
1428 ocfs2_journal_dirty(handle, et->et_root_bh); in ocfs2_shift_tree_depth()
1456 static int ocfs2_find_branch_target(struct ocfs2_extent_tree *et, in ocfs2_find_branch_target() argument
1468 el = et->et_root_el; in ocfs2_find_branch_target()
1472 status = ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_find_branch_target()
1474 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci)); in ocfs2_find_branch_target()
1480 status = ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_find_branch_target()
1482 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), i); in ocfs2_find_branch_target()
1489 status = ocfs2_read_extent_block(et->et_ci, blkno, &bh); in ocfs2_find_branch_target()
1508 el = et->et_root_el; in ocfs2_find_branch_target()
1529 static int ocfs2_grow_tree(handle_t *handle, struct ocfs2_extent_tree *et, in ocfs2_grow_tree() argument
1534 struct ocfs2_extent_list *el = et->et_root_el; in ocfs2_grow_tree()
1538 BUG_ON(meta_ac == NULL && ocfs2_is_dealloc_empty(et)); in ocfs2_grow_tree()
1540 shift = ocfs2_find_branch_target(et, &bh); in ocfs2_grow_tree()
1554 ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_grow_tree()
1560 ret = ocfs2_shift_tree_depth(handle, et, meta_ac, &bh); in ocfs2_grow_tree()
1585 ret = ocfs2_add_branch(handle, et, bh, last_eb_bh, in ocfs2_grow_tree()
1754 int ocfs2_find_subtree_root(struct ocfs2_extent_tree *et, in ocfs2_find_subtree_root() argument
1774 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_find_subtree_root()
2113 struct ocfs2_extent_tree *et, in ocfs2_rotate_subtree_right() argument
2129 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_rotate_subtree_right()
2131 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_subtree_right()
2147 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, right_path, in ocfs2_rotate_subtree_right()
2155 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_rotate_subtree_right()
2162 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_rotate_subtree_right()
2176 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_subtree_right()
2368 struct ocfs2_extent_tree *et, in ocfs2_rotate_tree_right() argument
2377 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in ocfs2_rotate_tree_right()
2395 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_tree_right()
2427 ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_tree_right()
2430 ret = ocfs2_find_path(et->et_ci, left_path, cpos); in ocfs2_rotate_tree_right()
2441 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_tree_right()
2468 start = ocfs2_find_subtree_root(et, left_path, right_path); in ocfs2_rotate_tree_right()
2482 ret = ocfs2_rotate_subtree_right(handle, et, left_path, in ocfs2_rotate_tree_right()
2529 struct ocfs2_extent_tree *et, in ocfs2_update_edge_lengths() argument
2538 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_update_edge_lengths()
2569 struct ocfs2_extent_tree *et, in ocfs2_unlink_path() argument
2591 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_unlink_path()
2596 ocfs2_remove_from_cache(et->et_ci, bh); in ocfs2_unlink_path()
2609 ocfs2_remove_from_cache(et->et_ci, bh); in ocfs2_unlink_path()
2614 struct ocfs2_extent_tree *et, in ocfs2_unlink_subtree() argument
2642 ocfs2_unlink_path(handle, et, dealloc, right_path, in ocfs2_unlink_subtree()
2647 struct ocfs2_extent_tree *et, in ocfs2_rotate_subtree_left() argument
2688 ret = ocfs2_journal_access_eb(handle, et->et_ci, in ocfs2_rotate_subtree_left()
2707 ret = ocfs2_et_root_journal_access(handle, et, in ocfs2_rotate_subtree_left()
2723 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, right_path, in ocfs2_rotate_subtree_left()
2731 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_rotate_subtree_left()
2738 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_rotate_subtree_left()
2771 ocfs2_unlink_subtree(handle, et, left_path, right_path, in ocfs2_rotate_subtree_left()
2773 ret = ocfs2_update_edge_lengths(handle, et, left_path); in ocfs2_rotate_subtree_left()
2780 ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno)); in ocfs2_rotate_subtree_left()
2880 struct ocfs2_extent_tree *et, in ocfs2_rotate_rightmost_leaf_left() argument
2890 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, path, in ocfs2_rotate_rightmost_leaf_left()
2905 struct ocfs2_extent_tree *et, in __ocfs2_rotate_tree_left() argument
2915 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in __ocfs2_rotate_tree_left()
2945 ret = ocfs2_find_path(et->et_ci, right_path, right_cpos); in __ocfs2_rotate_tree_left()
2951 subtree_root = ocfs2_find_subtree_root(et, left_path, in __ocfs2_rotate_tree_left()
2970 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in __ocfs2_rotate_tree_left()
2977 ret = ocfs2_rotate_subtree_left(handle, et, left_path, in __ocfs2_rotate_tree_left()
3022 struct ocfs2_extent_tree *et, in ocfs2_remove_rightmost_path() argument
3032 ret = ocfs2_et_sanity_check(et); in ocfs2_remove_rightmost_path()
3036 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_remove_rightmost_path()
3042 ret = ocfs2_find_cpos_for_left_leaf(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_remove_rightmost_path()
3061 ret = ocfs2_find_path(et->et_ci, left_path, cpos); in ocfs2_remove_rightmost_path()
3067 ret = ocfs2_journal_access_path(et->et_ci, handle, left_path); in ocfs2_remove_rightmost_path()
3073 subtree_index = ocfs2_find_subtree_root(et, left_path, path); in ocfs2_remove_rightmost_path()
3075 ocfs2_unlink_subtree(handle, et, left_path, path, in ocfs2_remove_rightmost_path()
3077 ret = ocfs2_update_edge_lengths(handle, et, left_path); in ocfs2_remove_rightmost_path()
3084 ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno)); in ocfs2_remove_rightmost_path()
3093 ocfs2_unlink_path(handle, et, dealloc, path, 1); in ocfs2_remove_rightmost_path()
3095 el = et->et_root_el; in ocfs2_remove_rightmost_path()
3100 ocfs2_et_set_last_eb_blk(et, 0); in ocfs2_remove_rightmost_path()
3111 struct ocfs2_extent_tree *et, in ocfs2_remove_rightmost_empty_extent() argument
3126 ret = ocfs2_remove_rightmost_path(handle, et, path, dealloc); in ocfs2_remove_rightmost_empty_extent()
3151 struct ocfs2_extent_tree *et, in ocfs2_rotate_tree_left() argument
3170 ret = ocfs2_rotate_rightmost_leaf_left(handle, et, path); in ocfs2_rotate_tree_left()
3201 ret = ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_rotate_tree_left()
3203 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_tree_left()
3217 ret = ocfs2_remove_rightmost_path(handle, et, path, in ocfs2_rotate_tree_left()
3229 ret = __ocfs2_rotate_tree_left(handle, et, orig_credits, path, in ocfs2_rotate_tree_left()
3240 ret = __ocfs2_rotate_tree_left(handle, et, orig_credits, in ocfs2_rotate_tree_left()
3293 static int ocfs2_get_right_path(struct ocfs2_extent_tree *et, in ocfs2_get_right_path() argument
3310 ret = ocfs2_find_cpos_for_right_leaf(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_get_right_path()
3327 ret = ocfs2_find_path(et->et_ci, right_path, right_cpos); in ocfs2_get_right_path()
3349 struct ocfs2_extent_tree *et, in ocfs2_merge_rec_right() argument
3370 ret = ocfs2_get_right_path(et, left_path, &right_path); in ocfs2_merge_rec_right()
3389 subtree_index = ocfs2_find_subtree_root(et, left_path, in ocfs2_merge_rec_right()
3403 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, right_path, in ocfs2_merge_rec_right()
3412 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_merge_rec_right()
3419 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_merge_rec_right()
3432 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, left_path, in ocfs2_merge_rec_right()
3443 -ocfs2_clusters_to_blocks(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_merge_rec_right()
3460 static int ocfs2_get_left_path(struct ocfs2_extent_tree *et, in ocfs2_get_left_path() argument
3473 ret = ocfs2_find_cpos_for_left_leaf(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_get_left_path()
3490 ret = ocfs2_find_path(et->et_ci, left_path, left_cpos); in ocfs2_get_left_path()
3515 struct ocfs2_extent_tree *et, in ocfs2_merge_rec_left() argument
3535 ret = ocfs2_get_left_path(et, right_path, &left_path); in ocfs2_merge_rec_left()
3551 subtree_index = ocfs2_find_subtree_root(et, left_path, in ocfs2_merge_rec_left()
3565 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, right_path, in ocfs2_merge_rec_left()
3574 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_merge_rec_left()
3581 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_merge_rec_left()
3594 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, right_path, in ocfs2_merge_rec_left()
3611 ocfs2_clusters_to_blocks(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_merge_rec_left()
3637 ret = ocfs2_remove_rightmost_path(handle, et, in ocfs2_merge_rec_left()
3660 struct ocfs2_extent_tree *et, in ocfs2_try_to_merge_extent() argument
3689 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3718 ret = ocfs2_merge_rec_right(path, handle, et, split_rec, in ocfs2_try_to_merge_extent()
3740 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3752 ret = ocfs2_merge_rec_left(path, handle, et, rec, in ocfs2_try_to_merge_extent()
3769 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3786 ret = ocfs2_merge_rec_left(path, handle, et, in ocfs2_try_to_merge_extent()
3795 et, split_rec, in ocfs2_try_to_merge_extent()
3818 ret = ocfs2_rotate_tree_left(handle, et, path, in ocfs2_try_to_merge_extent()
3865 static void ocfs2_insert_at_leaf(struct ocfs2_extent_tree *et, in ocfs2_insert_at_leaf() argument
3880 ocfs2_subtract_from_rec(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_insert_at_leaf()
3926 ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_insert_at_leaf()
3955 struct ocfs2_extent_tree *et, in ocfs2_adjust_rightmost_records() argument
3973 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_adjust_rightmost_records()
3975 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci)); in ocfs2_adjust_rightmost_records()
3992 struct ocfs2_extent_tree *et, in ocfs2_append_rec_to_path() argument
4020 ret = ocfs2_find_cpos_for_left_leaf(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_append_rec_to_path()
4029 ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_append_rec_to_path()
4045 ret = ocfs2_find_path(et->et_ci, left_path, in ocfs2_append_rec_to_path()
4059 ret = ocfs2_journal_access_path(et->et_ci, handle, right_path); in ocfs2_append_rec_to_path()
4065 ocfs2_adjust_rightmost_records(handle, et, right_path, insert_rec); in ocfs2_append_rec_to_path()
4076 static void ocfs2_split_record(struct ocfs2_extent_tree *et, in ocfs2_split_record() argument
4149 ocfs2_subtract_from_rec(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_split_record()
4163 struct ocfs2_extent_tree *et, in ocfs2_insert_path() argument
4185 ret = ocfs2_journal_access_path(et->et_ci, handle, left_path); in ocfs2_insert_path()
4196 ret = ocfs2_journal_access_path(et->et_ci, handle, right_path); in ocfs2_insert_path()
4208 ocfs2_split_record(et, left_path, right_path, in ocfs2_insert_path()
4220 ocfs2_insert_at_leaf(et, insert_rec, path_leaf_el(right_path), in ocfs2_insert_path()
4232 subtree_index = ocfs2_find_subtree_root(et, left_path, in ocfs2_insert_path()
4244 struct ocfs2_extent_tree *et, in ocfs2_do_insert_extent() argument
4254 el = et->et_root_el; in ocfs2_do_insert_extent()
4256 ret = ocfs2_et_root_journal_access(handle, et, in ocfs2_do_insert_extent()
4264 ocfs2_insert_at_leaf(et, insert_rec, el, type); in ocfs2_do_insert_extent()
4268 right_path = ocfs2_new_path_from_et(et); in ocfs2_do_insert_extent()
4287 ret = ocfs2_find_path(et->et_ci, right_path, cpos); in ocfs2_do_insert_extent()
4306 ret = ocfs2_rotate_tree_right(handle, et, type->ins_split, in ocfs2_do_insert_extent()
4318 ret = ocfs2_et_root_journal_access(handle, et, in ocfs2_do_insert_extent()
4326 ret = ocfs2_append_rec_to_path(handle, et, insert_rec, in ocfs2_do_insert_extent()
4334 ret = ocfs2_insert_path(handle, et, left_path, right_path, in ocfs2_do_insert_extent()
4343 ocfs2_et_update_clusters(et, in ocfs2_do_insert_extent()
4346 ocfs2_journal_dirty(handle, et->et_root_bh); in ocfs2_do_insert_extent()
4355 static int ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et, in ocfs2_figure_merge_contig_type() argument
4369 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in ocfs2_figure_merge_contig_type()
4386 status = ocfs2_find_path(et->et_ci, left_path, in ocfs2_figure_merge_contig_type()
4418 ret = ocfs2_et_extent_contig(et, rec, split_rec); in ocfs2_figure_merge_contig_type()
4441 status = ocfs2_find_path(et->et_ci, right_path, right_cpos); in ocfs2_figure_merge_contig_type()
4464 contig_type = ocfs2_et_extent_contig(et, rec, split_rec); in ocfs2_figure_merge_contig_type()
4483 static void ocfs2_figure_contig_type(struct ocfs2_extent_tree *et, in ocfs2_figure_contig_type() argument
4494 contig_type = ocfs2_et_extent_contig(et, &el->l_recs[i], in ocfs2_figure_contig_type()
4513 if (et->et_max_leaf_clusters && in ocfs2_figure_contig_type()
4514 (len > et->et_max_leaf_clusters)) in ocfs2_figure_contig_type()
4576 static int ocfs2_figure_insert_type(struct ocfs2_extent_tree *et, in ocfs2_figure_insert_type() argument
4590 el = et->et_root_el; in ocfs2_figure_insert_type()
4600 ret = ocfs2_read_extent_block(et->et_ci, in ocfs2_figure_insert_type()
4601 ocfs2_et_get_last_eb_blk(et), in ocfs2_figure_insert_type()
4623 ocfs2_figure_contig_type(et, insert, el, insert_rec); in ocfs2_figure_insert_type()
4628 path = ocfs2_new_path_from_et(et); in ocfs2_figure_insert_type()
4641 ret = ocfs2_find_path(et->et_ci, path, le32_to_cpu(insert_rec->e_cpos)); in ocfs2_figure_insert_type()
4657 ocfs2_figure_contig_type(et, insert, el, insert_rec); in ocfs2_figure_insert_type()
4678 if (ocfs2_et_get_last_eb_blk(et) == in ocfs2_figure_insert_type()
4707 struct ocfs2_extent_tree *et, in ocfs2_insert_extent() argument
4721 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_insert_extent()
4729 status = ocfs2_et_insert_check(et, &rec); in ocfs2_insert_extent()
4735 status = ocfs2_figure_insert_type(et, &last_eb_bh, &rec, in ocfs2_insert_extent()
4747 status = ocfs2_grow_tree(handle, et, in ocfs2_insert_extent()
4757 status = ocfs2_do_insert_extent(handle, et, &rec, &insert); in ocfs2_insert_extent()
4761 ocfs2_et_extent_map_insert(et, &rec); in ocfs2_insert_extent()
4772 * The extent b-tree's root is specified by et, and
4777 struct ocfs2_extent_tree *et, in ocfs2_add_clusters_in_btree() argument
4793 OCFS2_SB(ocfs2_metadata_cache_get_super(et->et_ci)); in ocfs2_add_clusters_in_btree()
4800 free_extents = ocfs2_num_free_extents(et); in ocfs2_add_clusters_in_btree()
4819 < ocfs2_extend_meta_needed(et->et_root_el))) { in ocfs2_add_clusters_in_btree()
4837 status = ocfs2_et_root_journal_access(handle, et, in ocfs2_add_clusters_in_btree()
4847 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_add_clusters_in_btree()
4849 status = ocfs2_insert_extent(handle, et, *logical_offset, block, in ocfs2_add_clusters_in_btree()
4857 ocfs2_journal_dirty(handle, et->et_root_bh); in ocfs2_add_clusters_in_btree()
4909 struct ocfs2_extent_tree *et, in ocfs2_split_and_insert() argument
4932 rightmost_el = et->et_root_el; in ocfs2_split_and_insert()
4943 ret = ocfs2_grow_tree(handle, et, in ocfs2_split_and_insert()
4972 ocfs2_make_right_split_rec(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_split_and_insert()
4981 ret = ocfs2_do_insert_extent(handle, et, &split_rec, &insert); in ocfs2_split_and_insert()
4997 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_split_and_insert()
5006 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_split_and_insert()
5008 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_split_and_insert()
5021 struct ocfs2_extent_tree *et, in ocfs2_replace_extent_rec() argument
5029 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, path, in ocfs2_replace_extent_rec()
5063 struct ocfs2_extent_tree *et, in ocfs2_split_extent() argument
5084 ret = ocfs2_figure_merge_contig_type(et, path, el, in ocfs2_split_extent()
5099 ret = ocfs2_read_extent_block(et->et_ci, in ocfs2_split_extent()
5100 ocfs2_et_get_last_eb_blk(et), in ocfs2_split_extent()
5122 ret = ocfs2_replace_extent_rec(handle, et, path, el, in ocfs2_split_extent()
5125 ret = ocfs2_split_and_insert(handle, et, path, in ocfs2_split_extent()
5131 ret = ocfs2_try_to_merge_extent(handle, et, path, in ocfs2_split_extent()
5156 struct ocfs2_extent_tree *et, in ocfs2_change_extent_flag() argument
5163 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in ocfs2_change_extent_flag()
5170 left_path = ocfs2_new_path_from_et(et); in ocfs2_change_extent_flag()
5177 ret = ocfs2_find_path(et->et_ci, left_path, cpos); in ocfs2_change_extent_flag()
5188 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_change_extent_flag()
5199 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_change_extent_flag()
5207 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_change_extent_flag()
5222 ret = ocfs2_split_extent(handle, et, left_path, in ocfs2_change_extent_flag()
5244 struct ocfs2_extent_tree *et, in ocfs2_mark_extent_written() argument
5266 ocfs2_et_extent_map_truncate(et, 0); in ocfs2_mark_extent_written()
5268 ret = ocfs2_change_extent_flag(handle, et, cpos, in ocfs2_mark_extent_written()
5278 static int ocfs2_split_tree(handle_t *handle, struct ocfs2_extent_tree *et, in ocfs2_split_tree() argument
5296 ocfs2_make_right_split_rec(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_split_tree()
5301 ret = ocfs2_read_extent_block(et->et_ci, in ocfs2_split_tree()
5302 ocfs2_et_get_last_eb_blk(et), in ocfs2_split_tree()
5315 ocfs2_extend_meta_needed(et->et_root_el); in ocfs2_split_tree()
5324 ret = ocfs2_grow_tree(handle, et, &depth, &last_eb_bh, in ocfs2_split_tree()
5338 ret = ocfs2_do_insert_extent(handle, et, &split_rec, &insert); in ocfs2_split_tree()
5348 struct ocfs2_extent_tree *et, in ocfs2_truncate_rec() argument
5356 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in ocfs2_truncate_rec()
5372 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_truncate_rec()
5424 ret = ocfs2_find_path(et->et_ci, left_path, in ocfs2_truncate_rec()
5441 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_truncate_rec()
5447 ret = ocfs2_journal_access_path(et->et_ci, handle, left_path); in ocfs2_truncate_rec()
5469 ocfs2_adjust_rightmost_records(handle, et, path, in ocfs2_truncate_rec()
5481 ocfs2_adjust_rightmost_records(handle, et, path, rec); in ocfs2_truncate_rec()
5486 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_truncate_rec()
5495 subtree_index = ocfs2_find_subtree_root(et, left_path, path); in ocfs2_truncate_rec()
5502 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_truncate_rec()
5512 struct ocfs2_extent_tree *et, in ocfs2_remove_extent() argument
5527 ocfs2_et_extent_map_truncate(et, 0); in ocfs2_remove_extent()
5529 path = ocfs2_new_path_from_et(et); in ocfs2_remove_extent()
5536 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_remove_extent()
5545 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_remove_extent()
5547 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_remove_extent()
5576 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_remove_extent()
5581 ret = ocfs2_truncate_rec(handle, et, path, index, dealloc, in ocfs2_remove_extent()
5588 ret = ocfs2_split_tree(handle, et, path, index, in ocfs2_remove_extent()
5601 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_remove_extent()
5610 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_remove_extent()
5612 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_remove_extent()
5626 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_remove_extent()
5628 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_remove_extent()
5635 ret = ocfs2_truncate_rec(handle, et, path, index, dealloc, in ocfs2_remove_extent()
5656 struct ocfs2_extent_tree *et, in ocfs2_reserve_blocks_for_rec_trunc() argument
5667 num_free_extents = ocfs2_num_free_extents(et); in ocfs2_reserve_blocks_for_rec_trunc()
5676 extra_blocks += ocfs2_extend_meta_needed(et->et_root_el); in ocfs2_reserve_blocks_for_rec_trunc()
5698 struct ocfs2_extent_tree *et, in ocfs2_remove_btree_range() argument
5735 ret = ocfs2_reserve_blocks_for_rec_trunc(inode, et, 1, &meta_ac, in ocfs2_remove_btree_range()
5760 ret = ocfs2_et_root_journal_access(handle, et, in ocfs2_remove_btree_range()
5770 ret = ocfs2_remove_extent(handle, et, cpos, len, meta_ac, dealloc); in ocfs2_remove_btree_range()
5776 ocfs2_et_update_clusters(et, -len); in ocfs2_remove_btree_range()
5779 ocfs2_journal_dirty(handle, et->et_root_bh); in ocfs2_remove_btree_range()
6635 static int ocfs2_is_dealloc_empty(struct ocfs2_extent_tree *et) in ocfs2_is_dealloc_empty() argument
6639 if (!et->et_dealloc) in ocfs2_is_dealloc_empty()
6642 fl = et->et_dealloc->c_first_suballocator; in ocfs2_is_dealloc_empty()
6659 struct ocfs2_extent_tree *et, in ocfs2_reuse_blk_from_dealloc() argument
6669 OCFS2_SB(ocfs2_metadata_cache_get_super(et->et_ci)); in ocfs2_reuse_blk_from_dealloc()
6677 dealloc = et->et_dealloc; in ocfs2_reuse_blk_from_dealloc()
6708 ocfs2_set_new_buffer_uptodate(et->et_ci, new_eb_bh[i]); in ocfs2_reuse_blk_from_dealloc()
6710 status = ocfs2_journal_access_eb(handle, et->et_ci, in ocfs2_reuse_blk_from_dealloc()
7072 struct ocfs2_extent_tree et; in ocfs2_convert_inline_data_to_extents() local
7165 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh); in ocfs2_convert_inline_data_to_extents()
7166 ret = ocfs2_insert_extent(handle, &et, 0, block, 1, 0, NULL); in ocfs2_convert_inline_data_to_extents()
7224 struct ocfs2_extent_tree et; in ocfs2_commit_truncate() local
7228 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh); in ocfs2_commit_truncate()
7304 &et, path, &dealloc); in ocfs2_commit_truncate()
7353 status = ocfs2_remove_btree_range(inode, &et, trunc_cpos, in ocfs2_commit_truncate()