Lines Matching refs: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);
114 void (*eo_fill_root_el)(struct ocfs2_extent_tree *et);
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()
986 struct ocfs2_extent_tree *et, in ocfs2_create_new_meta_bhs() argument
996 OCFS2_SB(ocfs2_metadata_cache_get_super(et->et_ci)); in ocfs2_create_new_meta_bhs()
1020 ocfs2_set_new_buffer_uptodate(et->et_ci, bhs[i]); in ocfs2_create_new_meta_bhs()
1022 status = ocfs2_journal_access_eb(handle, et->et_ci, in ocfs2_create_new_meta_bhs()
1092 struct ocfs2_extent_tree *et) in ocfs2_adjust_rightmost_branch() argument
1099 path = ocfs2_new_path_from_et(et); in ocfs2_adjust_rightmost_branch()
1105 status = ocfs2_find_path(et->et_ci, path, UINT_MAX); in ocfs2_adjust_rightmost_branch()
1117 status = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_adjust_rightmost_branch()
1126 ocfs2_adjust_rightmost_records(handle, et, path, rec); in ocfs2_adjust_rightmost_branch()
1145 struct ocfs2_extent_tree *et, in ocfs2_add_branch() argument
1165 el = et->et_root_el; in ocfs2_add_branch()
1174 root_end = ocfs2_sum_rightmost_rec(et->et_root_el); in ocfs2_add_branch()
1186 ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_add_branch()
1189 status = ocfs2_adjust_rightmost_branch(handle, et); in ocfs2_add_branch()
1208 if (!ocfs2_is_dealloc_empty(et)) { in ocfs2_add_branch()
1209 status = ocfs2_reuse_blk_from_dealloc(handle, et, in ocfs2_add_branch()
1222 status = ocfs2_create_new_meta_bhs(handle, et, in ocfs2_add_branch()
1247 status = ocfs2_journal_access_eb(handle, et->et_ci, bh, in ocfs2_add_branch()
1282 status = ocfs2_journal_access_eb(handle, et->et_ci, *last_eb_bh, in ocfs2_add_branch()
1288 status = ocfs2_et_root_journal_access(handle, et, in ocfs2_add_branch()
1295 status = ocfs2_journal_access_eb(handle, et->et_ci, eb_bh, in ocfs2_add_branch()
1313 ocfs2_et_set_last_eb_blk(et, new_last_eb_blk); in ocfs2_add_branch()
1319 ocfs2_journal_dirty(handle, et->et_root_bh); in ocfs2_add_branch()
1348 struct ocfs2_extent_tree *et, in ocfs2_shift_tree_depth() argument
1359 if (!ocfs2_is_dealloc_empty(et)) { in ocfs2_shift_tree_depth()
1360 status = ocfs2_reuse_blk_from_dealloc(handle, et, in ocfs2_shift_tree_depth()
1364 status = ocfs2_create_new_meta_bhs(handle, et, 1, meta_ac, in ocfs2_shift_tree_depth()
1381 root_el = et->et_root_el; in ocfs2_shift_tree_depth()
1383 status = ocfs2_journal_access_eb(handle, et->et_ci, new_eb_bh, in ocfs2_shift_tree_depth()
1398 status = ocfs2_et_root_journal_access(handle, et, in ocfs2_shift_tree_depth()
1419 ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno)); in ocfs2_shift_tree_depth()
1421 ocfs2_journal_dirty(handle, et->et_root_bh); in ocfs2_shift_tree_depth()
1449 static int ocfs2_find_branch_target(struct ocfs2_extent_tree *et, in ocfs2_find_branch_target() argument
1461 el = et->et_root_el; in ocfs2_find_branch_target()
1465 status = ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_find_branch_target()
1467 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci)); in ocfs2_find_branch_target()
1473 status = ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_find_branch_target()
1475 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), i); in ocfs2_find_branch_target()
1482 status = ocfs2_read_extent_block(et->et_ci, blkno, &bh); in ocfs2_find_branch_target()
1501 el = et->et_root_el; in ocfs2_find_branch_target()
1522 static int ocfs2_grow_tree(handle_t *handle, struct ocfs2_extent_tree *et, in ocfs2_grow_tree() argument
1527 struct ocfs2_extent_list *el = et->et_root_el; in ocfs2_grow_tree()
1531 BUG_ON(meta_ac == NULL && ocfs2_is_dealloc_empty(et)); in ocfs2_grow_tree()
1533 shift = ocfs2_find_branch_target(et, &bh); in ocfs2_grow_tree()
1547 ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_grow_tree()
1553 ret = ocfs2_shift_tree_depth(handle, et, meta_ac, &bh); in ocfs2_grow_tree()
1578 ret = ocfs2_add_branch(handle, et, bh, last_eb_bh, in ocfs2_grow_tree()
1747 int ocfs2_find_subtree_root(struct ocfs2_extent_tree *et, in ocfs2_find_subtree_root() argument
1767 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_find_subtree_root()
2106 struct ocfs2_extent_tree *et, in ocfs2_rotate_subtree_right() argument
2122 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_rotate_subtree_right()
2124 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_subtree_right()
2140 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, right_path, in ocfs2_rotate_subtree_right()
2148 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_rotate_subtree_right()
2155 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_rotate_subtree_right()
2169 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_subtree_right()
2361 struct ocfs2_extent_tree *et, in ocfs2_rotate_tree_right() argument
2370 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in ocfs2_rotate_tree_right()
2388 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_tree_right()
2420 ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_tree_right()
2423 ret = ocfs2_find_path(et->et_ci, left_path, cpos); in ocfs2_rotate_tree_right()
2434 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_tree_right()
2461 start = ocfs2_find_subtree_root(et, left_path, right_path); in ocfs2_rotate_tree_right()
2475 ret = ocfs2_rotate_subtree_right(handle, et, left_path, in ocfs2_rotate_tree_right()
2522 struct ocfs2_extent_tree *et, in ocfs2_update_edge_lengths() argument
2531 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_update_edge_lengths()
2562 struct ocfs2_extent_tree *et, in ocfs2_unlink_path() argument
2584 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_unlink_path()
2589 ocfs2_remove_from_cache(et->et_ci, bh); in ocfs2_unlink_path()
2602 ocfs2_remove_from_cache(et->et_ci, bh); in ocfs2_unlink_path()
2607 struct ocfs2_extent_tree *et, in ocfs2_unlink_subtree() argument
2635 ocfs2_unlink_path(handle, et, dealloc, right_path, in ocfs2_unlink_subtree()
2640 struct ocfs2_extent_tree *et, in ocfs2_rotate_subtree_left() argument
2681 ret = ocfs2_journal_access_eb(handle, et->et_ci, in ocfs2_rotate_subtree_left()
2700 ret = ocfs2_et_root_journal_access(handle, et, in ocfs2_rotate_subtree_left()
2716 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, right_path, in ocfs2_rotate_subtree_left()
2724 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_rotate_subtree_left()
2731 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_rotate_subtree_left()
2764 ocfs2_unlink_subtree(handle, et, left_path, right_path, in ocfs2_rotate_subtree_left()
2766 ret = ocfs2_update_edge_lengths(handle, et, left_path); in ocfs2_rotate_subtree_left()
2773 ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno)); in ocfs2_rotate_subtree_left()
2873 struct ocfs2_extent_tree *et, in ocfs2_rotate_rightmost_leaf_left() argument
2883 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, path, in ocfs2_rotate_rightmost_leaf_left()
2898 struct ocfs2_extent_tree *et, in __ocfs2_rotate_tree_left() argument
2908 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in __ocfs2_rotate_tree_left()
2938 ret = ocfs2_find_path(et->et_ci, right_path, right_cpos); in __ocfs2_rotate_tree_left()
2944 subtree_root = ocfs2_find_subtree_root(et, left_path, in __ocfs2_rotate_tree_left()
2963 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in __ocfs2_rotate_tree_left()
2970 ret = ocfs2_rotate_subtree_left(handle, et, left_path, in __ocfs2_rotate_tree_left()
3015 struct ocfs2_extent_tree *et, in ocfs2_remove_rightmost_path() argument
3025 ret = ocfs2_et_sanity_check(et); in ocfs2_remove_rightmost_path()
3029 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_remove_rightmost_path()
3035 ret = ocfs2_find_cpos_for_left_leaf(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_remove_rightmost_path()
3054 ret = ocfs2_find_path(et->et_ci, left_path, cpos); in ocfs2_remove_rightmost_path()
3060 ret = ocfs2_journal_access_path(et->et_ci, handle, left_path); in ocfs2_remove_rightmost_path()
3066 subtree_index = ocfs2_find_subtree_root(et, left_path, path); in ocfs2_remove_rightmost_path()
3068 ocfs2_unlink_subtree(handle, et, left_path, path, in ocfs2_remove_rightmost_path()
3070 ret = ocfs2_update_edge_lengths(handle, et, left_path); in ocfs2_remove_rightmost_path()
3077 ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno)); in ocfs2_remove_rightmost_path()
3086 ocfs2_unlink_path(handle, et, dealloc, path, 1); in ocfs2_remove_rightmost_path()
3088 el = et->et_root_el; in ocfs2_remove_rightmost_path()
3093 ocfs2_et_set_last_eb_blk(et, 0); in ocfs2_remove_rightmost_path()
3104 struct ocfs2_extent_tree *et, in ocfs2_remove_rightmost_empty_extent() argument
3119 ret = ocfs2_remove_rightmost_path(handle, et, path, dealloc); in ocfs2_remove_rightmost_empty_extent()
3144 struct ocfs2_extent_tree *et, in ocfs2_rotate_tree_left() argument
3163 ret = ocfs2_rotate_rightmost_leaf_left(handle, et, path); in ocfs2_rotate_tree_left()
3194 ret = ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_rotate_tree_left()
3196 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_rotate_tree_left()
3210 ret = ocfs2_remove_rightmost_path(handle, et, path, in ocfs2_rotate_tree_left()
3222 ret = __ocfs2_rotate_tree_left(handle, et, orig_credits, path, in ocfs2_rotate_tree_left()
3233 ret = __ocfs2_rotate_tree_left(handle, et, orig_credits, in ocfs2_rotate_tree_left()
3286 static int ocfs2_get_right_path(struct ocfs2_extent_tree *et, in ocfs2_get_right_path() argument
3303 ret = ocfs2_find_cpos_for_right_leaf(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_get_right_path()
3320 ret = ocfs2_find_path(et->et_ci, right_path, right_cpos); in ocfs2_get_right_path()
3342 struct ocfs2_extent_tree *et, in ocfs2_merge_rec_right() argument
3363 ret = ocfs2_get_right_path(et, left_path, &right_path); in ocfs2_merge_rec_right()
3382 subtree_index = ocfs2_find_subtree_root(et, left_path, in ocfs2_merge_rec_right()
3396 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, right_path, in ocfs2_merge_rec_right()
3405 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_merge_rec_right()
3412 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_merge_rec_right()
3425 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, left_path, in ocfs2_merge_rec_right()
3436 -ocfs2_clusters_to_blocks(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_merge_rec_right()
3453 static int ocfs2_get_left_path(struct ocfs2_extent_tree *et, in ocfs2_get_left_path() argument
3466 ret = ocfs2_find_cpos_for_left_leaf(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_get_left_path()
3483 ret = ocfs2_find_path(et->et_ci, left_path, left_cpos); in ocfs2_get_left_path()
3508 struct ocfs2_extent_tree *et, in ocfs2_merge_rec_left() argument
3528 ret = ocfs2_get_left_path(et, right_path, &left_path); in ocfs2_merge_rec_left()
3544 subtree_index = ocfs2_find_subtree_root(et, left_path, in ocfs2_merge_rec_left()
3558 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, right_path, in ocfs2_merge_rec_left()
3567 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_merge_rec_left()
3574 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, in ocfs2_merge_rec_left()
3587 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, right_path, in ocfs2_merge_rec_left()
3604 ocfs2_clusters_to_blocks(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_merge_rec_left()
3630 ret = ocfs2_remove_rightmost_path(handle, et, in ocfs2_merge_rec_left()
3653 struct ocfs2_extent_tree *et, in ocfs2_try_to_merge_extent() argument
3682 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3711 ret = ocfs2_merge_rec_right(path, handle, et, split_rec, in ocfs2_try_to_merge_extent()
3733 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3745 ret = ocfs2_merge_rec_left(path, handle, et, rec, in ocfs2_try_to_merge_extent()
3762 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3779 ret = ocfs2_merge_rec_left(path, handle, et, in ocfs2_try_to_merge_extent()
3788 et, split_rec, in ocfs2_try_to_merge_extent()
3811 ret = ocfs2_rotate_tree_left(handle, et, path, in ocfs2_try_to_merge_extent()
3858 static void ocfs2_insert_at_leaf(struct ocfs2_extent_tree *et, in ocfs2_insert_at_leaf() argument
3873 ocfs2_subtract_from_rec(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_insert_at_leaf()
3919 ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_insert_at_leaf()
3948 struct ocfs2_extent_tree *et, in ocfs2_adjust_rightmost_records() argument
3966 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_adjust_rightmost_records()
3968 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci)); in ocfs2_adjust_rightmost_records()
3985 struct ocfs2_extent_tree *et, in ocfs2_append_rec_to_path() argument
4013 ret = ocfs2_find_cpos_for_left_leaf(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_append_rec_to_path()
4022 ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_append_rec_to_path()
4038 ret = ocfs2_find_path(et->et_ci, left_path, in ocfs2_append_rec_to_path()
4052 ret = ocfs2_journal_access_path(et->et_ci, handle, right_path); in ocfs2_append_rec_to_path()
4058 ocfs2_adjust_rightmost_records(handle, et, right_path, insert_rec); in ocfs2_append_rec_to_path()
4069 static void ocfs2_split_record(struct ocfs2_extent_tree *et, in ocfs2_split_record() argument
4142 ocfs2_subtract_from_rec(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_split_record()
4156 struct ocfs2_extent_tree *et, in ocfs2_insert_path() argument
4178 ret = ocfs2_journal_access_path(et->et_ci, handle, left_path); in ocfs2_insert_path()
4189 ret = ocfs2_journal_access_path(et->et_ci, handle, right_path); in ocfs2_insert_path()
4201 ocfs2_split_record(et, left_path, right_path, in ocfs2_insert_path()
4213 ocfs2_insert_at_leaf(et, insert_rec, path_leaf_el(right_path), in ocfs2_insert_path()
4225 subtree_index = ocfs2_find_subtree_root(et, left_path, in ocfs2_insert_path()
4237 struct ocfs2_extent_tree *et, in ocfs2_do_insert_extent() argument
4247 el = et->et_root_el; in ocfs2_do_insert_extent()
4249 ret = ocfs2_et_root_journal_access(handle, et, in ocfs2_do_insert_extent()
4257 ocfs2_insert_at_leaf(et, insert_rec, el, type); in ocfs2_do_insert_extent()
4261 right_path = ocfs2_new_path_from_et(et); in ocfs2_do_insert_extent()
4280 ret = ocfs2_find_path(et->et_ci, right_path, cpos); in ocfs2_do_insert_extent()
4299 ret = ocfs2_rotate_tree_right(handle, et, type->ins_split, in ocfs2_do_insert_extent()
4311 ret = ocfs2_et_root_journal_access(handle, et, in ocfs2_do_insert_extent()
4319 ret = ocfs2_append_rec_to_path(handle, et, insert_rec, in ocfs2_do_insert_extent()
4327 ret = ocfs2_insert_path(handle, et, left_path, right_path, in ocfs2_do_insert_extent()
4336 ocfs2_et_update_clusters(et, in ocfs2_do_insert_extent()
4339 ocfs2_journal_dirty(handle, et->et_root_bh); in ocfs2_do_insert_extent()
4348 static int ocfs2_figure_merge_contig_type(struct ocfs2_extent_tree *et, in ocfs2_figure_merge_contig_type() argument
4362 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in ocfs2_figure_merge_contig_type()
4379 status = ocfs2_find_path(et->et_ci, left_path, in ocfs2_figure_merge_contig_type()
4411 ret = ocfs2_et_extent_contig(et, rec, split_rec); in ocfs2_figure_merge_contig_type()
4434 status = ocfs2_find_path(et->et_ci, right_path, right_cpos); in ocfs2_figure_merge_contig_type()
4457 contig_type = ocfs2_et_extent_contig(et, rec, split_rec); in ocfs2_figure_merge_contig_type()
4476 static void ocfs2_figure_contig_type(struct ocfs2_extent_tree *et, in ocfs2_figure_contig_type() argument
4487 contig_type = ocfs2_et_extent_contig(et, &el->l_recs[i], in ocfs2_figure_contig_type()
4506 if (et->et_max_leaf_clusters && in ocfs2_figure_contig_type()
4507 (len > et->et_max_leaf_clusters)) in ocfs2_figure_contig_type()
4569 static int ocfs2_figure_insert_type(struct ocfs2_extent_tree *et, in ocfs2_figure_insert_type() argument
4583 el = et->et_root_el; in ocfs2_figure_insert_type()
4593 ret = ocfs2_read_extent_block(et->et_ci, in ocfs2_figure_insert_type()
4594 ocfs2_et_get_last_eb_blk(et), in ocfs2_figure_insert_type()
4616 ocfs2_figure_contig_type(et, insert, el, insert_rec); in ocfs2_figure_insert_type()
4621 path = ocfs2_new_path_from_et(et); in ocfs2_figure_insert_type()
4634 ret = ocfs2_find_path(et->et_ci, path, le32_to_cpu(insert_rec->e_cpos)); in ocfs2_figure_insert_type()
4650 ocfs2_figure_contig_type(et, insert, el, insert_rec); in ocfs2_figure_insert_type()
4671 if (ocfs2_et_get_last_eb_blk(et) == in ocfs2_figure_insert_type()
4700 struct ocfs2_extent_tree *et, in ocfs2_insert_extent() argument
4714 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_insert_extent()
4722 status = ocfs2_et_insert_check(et, &rec); in ocfs2_insert_extent()
4728 status = ocfs2_figure_insert_type(et, &last_eb_bh, &rec, in ocfs2_insert_extent()
4740 status = ocfs2_grow_tree(handle, et, in ocfs2_insert_extent()
4750 status = ocfs2_do_insert_extent(handle, et, &rec, &insert); in ocfs2_insert_extent()
4754 ocfs2_et_extent_map_insert(et, &rec); in ocfs2_insert_extent()
4770 struct ocfs2_extent_tree *et, in ocfs2_add_clusters_in_btree() argument
4786 OCFS2_SB(ocfs2_metadata_cache_get_super(et->et_ci)); in ocfs2_add_clusters_in_btree()
4793 free_extents = ocfs2_num_free_extents(et); in ocfs2_add_clusters_in_btree()
4812 < ocfs2_extend_meta_needed(et->et_root_el))) { in ocfs2_add_clusters_in_btree()
4830 status = ocfs2_et_root_journal_access(handle, et, in ocfs2_add_clusters_in_btree()
4840 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_add_clusters_in_btree()
4842 status = ocfs2_insert_extent(handle, et, *logical_offset, block, in ocfs2_add_clusters_in_btree()
4850 ocfs2_journal_dirty(handle, et->et_root_bh); in ocfs2_add_clusters_in_btree()
4902 struct ocfs2_extent_tree *et, in ocfs2_split_and_insert() argument
4925 rightmost_el = et->et_root_el; in ocfs2_split_and_insert()
4936 ret = ocfs2_grow_tree(handle, et, in ocfs2_split_and_insert()
4965 ocfs2_make_right_split_rec(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_split_and_insert()
4974 ret = ocfs2_do_insert_extent(handle, et, &split_rec, &insert); in ocfs2_split_and_insert()
4990 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_split_and_insert()
4999 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_split_and_insert()
5001 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_split_and_insert()
5014 struct ocfs2_extent_tree *et, in ocfs2_replace_extent_rec() argument
5022 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, path, in ocfs2_replace_extent_rec()
5056 struct ocfs2_extent_tree *et, in ocfs2_split_extent() argument
5077 ret = ocfs2_figure_merge_contig_type(et, path, el, in ocfs2_split_extent()
5092 ret = ocfs2_read_extent_block(et->et_ci, in ocfs2_split_extent()
5093 ocfs2_et_get_last_eb_blk(et), in ocfs2_split_extent()
5115 ret = ocfs2_replace_extent_rec(handle, et, path, el, in ocfs2_split_extent()
5118 ret = ocfs2_split_and_insert(handle, et, path, in ocfs2_split_extent()
5124 ret = ocfs2_try_to_merge_extent(handle, et, path, in ocfs2_split_extent()
5149 struct ocfs2_extent_tree *et, in ocfs2_change_extent_flag() argument
5156 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in ocfs2_change_extent_flag()
5163 left_path = ocfs2_new_path_from_et(et); in ocfs2_change_extent_flag()
5170 ret = ocfs2_find_path(et->et_ci, left_path, cpos); in ocfs2_change_extent_flag()
5181 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_change_extent_flag()
5192 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_change_extent_flag()
5200 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_change_extent_flag()
5215 ret = ocfs2_split_extent(handle, et, left_path, in ocfs2_change_extent_flag()
5237 struct ocfs2_extent_tree *et, in ocfs2_mark_extent_written() argument
5259 ocfs2_et_extent_map_truncate(et, 0); in ocfs2_mark_extent_written()
5261 ret = ocfs2_change_extent_flag(handle, et, cpos, in ocfs2_mark_extent_written()
5271 static int ocfs2_split_tree(handle_t *handle, struct ocfs2_extent_tree *et, in ocfs2_split_tree() argument
5289 ocfs2_make_right_split_rec(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_split_tree()
5294 ret = ocfs2_read_extent_block(et->et_ci, in ocfs2_split_tree()
5295 ocfs2_et_get_last_eb_blk(et), in ocfs2_split_tree()
5308 ocfs2_extend_meta_needed(et->et_root_el); in ocfs2_split_tree()
5317 ret = ocfs2_grow_tree(handle, et, &depth, &last_eb_bh, in ocfs2_split_tree()
5331 ret = ocfs2_do_insert_extent(handle, et, &split_rec, &insert); in ocfs2_split_tree()
5341 struct ocfs2_extent_tree *et, in ocfs2_truncate_rec() argument
5349 struct super_block *sb = ocfs2_metadata_cache_get_super(et->et_ci); in ocfs2_truncate_rec()
5365 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_truncate_rec()
5417 ret = ocfs2_find_path(et->et_ci, left_path, in ocfs2_truncate_rec()
5434 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_truncate_rec()
5440 ret = ocfs2_journal_access_path(et->et_ci, handle, left_path); in ocfs2_truncate_rec()
5462 ocfs2_adjust_rightmost_records(handle, et, path, in ocfs2_truncate_rec()
5474 ocfs2_adjust_rightmost_records(handle, et, path, rec); in ocfs2_truncate_rec()
5479 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_truncate_rec()
5488 subtree_index = ocfs2_find_subtree_root(et, left_path, path); in ocfs2_truncate_rec()
5495 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_truncate_rec()
5505 struct ocfs2_extent_tree *et, in ocfs2_remove_extent() argument
5520 ocfs2_et_extent_map_truncate(et, 0); in ocfs2_remove_extent()
5522 path = ocfs2_new_path_from_et(et); in ocfs2_remove_extent()
5529 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_remove_extent()
5538 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_remove_extent()
5540 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_remove_extent()
5569 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_remove_extent()
5574 ret = ocfs2_truncate_rec(handle, et, path, index, dealloc, in ocfs2_remove_extent()
5581 ret = ocfs2_split_tree(handle, et, path, index, in ocfs2_remove_extent()
5594 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_remove_extent()
5603 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_remove_extent()
5605 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_remove_extent()
5619 ocfs2_error(ocfs2_metadata_cache_get_super(et->et_ci), in ocfs2_remove_extent()
5621 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci), in ocfs2_remove_extent()
5628 ret = ocfs2_truncate_rec(handle, et, path, index, dealloc, in ocfs2_remove_extent()
5649 struct ocfs2_extent_tree *et, in ocfs2_reserve_blocks_for_rec_trunc() argument
5660 num_free_extents = ocfs2_num_free_extents(et); in ocfs2_reserve_blocks_for_rec_trunc()
5669 extra_blocks += ocfs2_extend_meta_needed(et->et_root_el); in ocfs2_reserve_blocks_for_rec_trunc()
5691 struct ocfs2_extent_tree *et, in ocfs2_remove_btree_range() argument
5728 ret = ocfs2_reserve_blocks_for_rec_trunc(inode, et, 1, &meta_ac, in ocfs2_remove_btree_range()
5753 ret = ocfs2_et_root_journal_access(handle, et, in ocfs2_remove_btree_range()
5763 ret = ocfs2_remove_extent(handle, et, cpos, len, meta_ac, dealloc); in ocfs2_remove_btree_range()
5769 ocfs2_et_update_clusters(et, -len); in ocfs2_remove_btree_range()
5772 ocfs2_journal_dirty(handle, et->et_root_bh); in ocfs2_remove_btree_range()
6628 static int ocfs2_is_dealloc_empty(struct ocfs2_extent_tree *et) in ocfs2_is_dealloc_empty() argument
6632 if (!et->et_dealloc) in ocfs2_is_dealloc_empty()
6635 fl = et->et_dealloc->c_first_suballocator; in ocfs2_is_dealloc_empty()
6652 struct ocfs2_extent_tree *et, in ocfs2_reuse_blk_from_dealloc() argument
6662 OCFS2_SB(ocfs2_metadata_cache_get_super(et->et_ci)); in ocfs2_reuse_blk_from_dealloc()
6670 dealloc = et->et_dealloc; in ocfs2_reuse_blk_from_dealloc()
6701 ocfs2_set_new_buffer_uptodate(et->et_ci, new_eb_bh[i]); in ocfs2_reuse_blk_from_dealloc()
6703 status = ocfs2_journal_access_eb(handle, et->et_ci, in ocfs2_reuse_blk_from_dealloc()
7065 struct ocfs2_extent_tree et; in ocfs2_convert_inline_data_to_extents() local
7158 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh); in ocfs2_convert_inline_data_to_extents()
7159 ret = ocfs2_insert_extent(handle, &et, 0, block, 1, 0, NULL); in ocfs2_convert_inline_data_to_extents()
7217 struct ocfs2_extent_tree et; in ocfs2_commit_truncate() local
7221 ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh); in ocfs2_commit_truncate()
7297 &et, path, &dealloc); in ocfs2_commit_truncate()
7346 status = ocfs2_remove_btree_range(inode, &et, trunc_cpos, in ocfs2_commit_truncate()