Lines Matching refs:path
573 struct ocfs2_path *path,
580 void ocfs2_reinit_path(struct ocfs2_path *path, int keep_root) in ocfs2_reinit_path() argument
588 for(i = start; i < path_num_items(path); i++) { in ocfs2_reinit_path()
589 node = &path->p_node[i]; in ocfs2_reinit_path()
602 depth = le16_to_cpu(path_root_el(path)->l_tree_depth); in ocfs2_reinit_path()
604 path_root_access(path) = NULL; in ocfs2_reinit_path()
606 path->p_tree_depth = depth; in ocfs2_reinit_path()
609 void ocfs2_free_path(struct ocfs2_path *path) in ocfs2_free_path() argument
611 if (path) { in ocfs2_free_path()
612 ocfs2_reinit_path(path, 0); in ocfs2_free_path()
613 kfree(path); in ocfs2_free_path()
670 static inline void ocfs2_path_insert_eb(struct ocfs2_path *path, int index, in ocfs2_path_insert_eb() argument
683 path->p_node[index].bh = eb_bh; in ocfs2_path_insert_eb()
684 path->p_node[index].el = &eb->h_list; in ocfs2_path_insert_eb()
691 struct ocfs2_path *path; in ocfs2_new_path() local
695 path = kzalloc(sizeof(*path), GFP_NOFS); in ocfs2_new_path()
696 if (path) { in ocfs2_new_path()
697 path->p_tree_depth = le16_to_cpu(root_el->l_tree_depth); in ocfs2_new_path()
699 path_root_bh(path) = root_bh; in ocfs2_new_path()
700 path_root_el(path) = root_el; in ocfs2_new_path()
701 path_root_access(path) = access; in ocfs2_new_path()
704 return path; in ocfs2_new_path()
707 struct ocfs2_path *ocfs2_new_path_from_path(struct ocfs2_path *path) in ocfs2_new_path_from_path() argument
709 return ocfs2_new_path(path_root_bh(path), path_root_el(path), in ocfs2_new_path_from_path()
710 path_root_access(path)); in ocfs2_new_path_from_path()
728 struct ocfs2_path *path, in ocfs2_path_bh_journal_access() argument
731 ocfs2_journal_access_func access = path_root_access(path); in ocfs2_path_bh_journal_access()
739 return access(handle, ci, path->p_node[idx].bh, in ocfs2_path_bh_journal_access()
748 struct ocfs2_path *path) in ocfs2_journal_access_path() argument
752 if (!path) in ocfs2_journal_access_path()
755 for(i = 0; i < path_num_items(path); i++) { in ocfs2_journal_access_path()
756 ret = ocfs2_path_bh_journal_access(handle, ci, path, i); in ocfs2_journal_access_path()
1108 struct ocfs2_path *path = NULL; in ocfs2_adjust_rightmost_branch() local
1112 path = ocfs2_new_path_from_et(et); in ocfs2_adjust_rightmost_branch()
1113 if (!path) { in ocfs2_adjust_rightmost_branch()
1118 status = ocfs2_find_path(et->et_ci, path, UINT_MAX); in ocfs2_adjust_rightmost_branch()
1124 status = ocfs2_extend_trans(handle, path_num_items(path)); in ocfs2_adjust_rightmost_branch()
1130 status = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_adjust_rightmost_branch()
1136 el = path_leaf_el(path); in ocfs2_adjust_rightmost_branch()
1139 ocfs2_adjust_rightmost_records(handle, et, path, rec); in ocfs2_adjust_rightmost_branch()
1142 ocfs2_free_path(path); in ocfs2_adjust_rightmost_branch()
1875 struct ocfs2_path *path; member
1882 ocfs2_path_insert_eb(fp->path, fp->index, bh); in find_path_ins()
1886 struct ocfs2_path *path, u32 cpos) in ocfs2_find_path() argument
1891 data.path = path; in ocfs2_find_path()
1892 return __ocfs2_find_path(ci, path_root_el(path), cpos, in ocfs2_find_path()
2206 struct ocfs2_path *path, u32 *cpos) in ocfs2_find_cpos_for_left_leaf() argument
2212 BUG_ON(path->p_tree_depth == 0); in ocfs2_find_cpos_for_left_leaf()
2216 blkno = path_leaf_bh(path)->b_blocknr; in ocfs2_find_cpos_for_left_leaf()
2219 i = path->p_tree_depth - 1; in ocfs2_find_cpos_for_left_leaf()
2221 el = path->p_node[i].el; in ocfs2_find_cpos_for_left_leaf()
2266 blkno = path->p_node[i].bh->b_blocknr; in ocfs2_find_cpos_for_left_leaf()
2281 struct ocfs2_path *path) in ocfs2_extend_rotate_transaction() argument
2284 int credits = (path->p_tree_depth - subtree_depth) * 2 + 1 + op_credits; in ocfs2_extend_rotate_transaction()
2521 int subtree_index, struct ocfs2_path *path) in ocfs2_update_edge_lengths() argument
2544 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_update_edge_lengths()
2551 eb = (struct ocfs2_extent_block *)path_leaf_bh(path)->b_data; in ocfs2_update_edge_lengths()
2560 for (i = 0; i < path->p_tree_depth; i++) { in ocfs2_update_edge_lengths()
2561 el = path->p_node[i].el; in ocfs2_update_edge_lengths()
2568 ocfs2_journal_dirty(handle, path->p_node[i].bh); in ocfs2_update_edge_lengths()
2577 struct ocfs2_path *path, int unlink_start) in ocfs2_unlink_path() argument
2584 for(i = unlink_start; i < path_num_items(path); i++) { in ocfs2_unlink_path()
2585 bh = path->p_node[i].bh; in ocfs2_unlink_path()
2821 struct ocfs2_path *path, u32 *cpos) in ocfs2_find_cpos_for_right_leaf() argument
2829 if (path->p_tree_depth == 0) in ocfs2_find_cpos_for_right_leaf()
2832 blkno = path_leaf_bh(path)->b_blocknr; in ocfs2_find_cpos_for_right_leaf()
2835 i = path->p_tree_depth - 1; in ocfs2_find_cpos_for_right_leaf()
2839 el = path->p_node[i].el; in ocfs2_find_cpos_for_right_leaf()
2882 blkno = path->p_node[i].bh->b_blocknr; in ocfs2_find_cpos_for_right_leaf()
2892 struct ocfs2_path *path) in ocfs2_rotate_rightmost_leaf_left() argument
2895 struct buffer_head *bh = path_leaf_bh(path); in ocfs2_rotate_rightmost_leaf_left()
2896 struct ocfs2_extent_list *el = path_leaf_el(path); in ocfs2_rotate_rightmost_leaf_left()
2901 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, path, in ocfs2_rotate_rightmost_leaf_left()
2902 path_num_items(path) - 1); in ocfs2_rotate_rightmost_leaf_left()
2918 struct ocfs2_path *path, in __ocfs2_rotate_tree_left() argument
2928 BUG_ON(!ocfs2_is_empty_extent(&(path_leaf_el(path)->l_recs[0]))); in __ocfs2_rotate_tree_left()
2932 ret = ocfs2_find_cpos_for_right_leaf(sb, path, &right_cpos); in __ocfs2_rotate_tree_left()
2938 left_path = ocfs2_new_path_from_path(path); in __ocfs2_rotate_tree_left()
2945 ocfs2_cp_path(left_path, path); in __ocfs2_rotate_tree_left()
2947 right_path = ocfs2_new_path_from_path(path); in __ocfs2_rotate_tree_left()
3033 struct ocfs2_path *path, in ocfs2_remove_rightmost_path() argument
3052 path); in ocfs2_remove_rightmost_path()
3058 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_remove_rightmost_path()
3065 path, &cpos); in ocfs2_remove_rightmost_path()
3076 left_path = ocfs2_new_path_from_path(path); in ocfs2_remove_rightmost_path()
3095 subtree_index = ocfs2_find_subtree_root(et, left_path, path); in ocfs2_remove_rightmost_path()
3097 ocfs2_unlink_subtree(handle, et, left_path, path, in ocfs2_remove_rightmost_path()
3116 ocfs2_unlink_path(handle, et, dealloc, path, 1); in ocfs2_remove_rightmost_path()
3126 ocfs2_journal_dirty(handle, path_root_bh(path)); in ocfs2_remove_rightmost_path()
3151 struct ocfs2_path *path, in ocfs2_rotate_tree_left() argument
3159 el = path_leaf_el(path); in ocfs2_rotate_tree_left()
3163 if (path->p_tree_depth == 0) { in ocfs2_rotate_tree_left()
3169 ret = ocfs2_rotate_rightmost_leaf_left(handle, et, path); in ocfs2_rotate_tree_left()
3188 eb = (struct ocfs2_extent_block *)path_leaf_bh(path)->b_data; 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()
3655 struct ocfs2_path *path, in ocfs2_try_to_merge_extent() argument
3662 struct ocfs2_extent_list *el = path_leaf_el(path); in ocfs2_try_to_merge_extent()
3675 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3704 ret = ocfs2_merge_rec_right(path, handle, et, split_rec, in ocfs2_try_to_merge_extent()
3717 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3729 ret = ocfs2_merge_rec_left(path, handle, et, rec, in ocfs2_try_to_merge_extent()
3737 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3754 ret = ocfs2_merge_rec_left(path, handle, et, in ocfs2_try_to_merge_extent()
3762 ret = ocfs2_merge_rec_right(path, handle, in ocfs2_try_to_merge_extent()
3776 ret = ocfs2_rotate_tree_left(handle, et, path, in ocfs2_try_to_merge_extent()
3914 struct ocfs2_path *path, in ocfs2_adjust_rightmost_records() argument
3925 for (i = 0; i < path->p_tree_depth; i++) { in ocfs2_adjust_rightmost_records()
3926 bh = path->p_node[i].bh; in ocfs2_adjust_rightmost_records()
3927 el = path->p_node[i].el; in ocfs2_adjust_rightmost_records()
4316 struct ocfs2_path *path, in ocfs2_figure_merge_contig_type() argument
4332 } else if (path->p_tree_depth > 0) { in ocfs2_figure_merge_contig_type()
4333 status = ocfs2_find_cpos_for_left_leaf(sb, path, &left_cpos); in ocfs2_figure_merge_contig_type()
4338 left_path = ocfs2_new_path_from_path(path); in ocfs2_figure_merge_contig_type()
4386 path->p_tree_depth > 0) { in ocfs2_figure_merge_contig_type()
4387 status = ocfs2_find_cpos_for_right_leaf(sb, path, &right_cpos); in ocfs2_figure_merge_contig_type()
4394 right_path = ocfs2_new_path_from_path(path); in ocfs2_figure_merge_contig_type()
4541 struct ocfs2_path *path = NULL; in ocfs2_figure_insert_type() local
4584 path = ocfs2_new_path_from_et(et); in ocfs2_figure_insert_type()
4585 if (!path) { in ocfs2_figure_insert_type()
4597 ret = ocfs2_find_path(et->et_ci, path, le32_to_cpu(insert_rec->e_cpos)); in ocfs2_figure_insert_type()
4603 el = path_leaf_el(path); in ocfs2_figure_insert_type()
4635 path_leaf_bh(path)->b_blocknr) { in ocfs2_figure_insert_type()
4648 ocfs2_free_path(path); in ocfs2_figure_insert_type()
4866 struct ocfs2_path *path, in ocfs2_split_and_insert() argument
4886 rec = path_leaf_el(path)->l_recs[split_index]; in ocfs2_split_and_insert()
4950 ocfs2_reinit_path(path, 1); in ocfs2_split_and_insert()
4953 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_split_and_insert()
4959 el = path_leaf_el(path); in ocfs2_split_and_insert()
4979 struct ocfs2_path *path, in ocfs2_replace_extent_rec() argument
4986 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, path, in ocfs2_replace_extent_rec()
4987 path_num_items(path) - 1); in ocfs2_replace_extent_rec()
4995 ocfs2_journal_dirty(handle, path_leaf_bh(path)); in ocfs2_replace_extent_rec()
5021 struct ocfs2_path *path, in ocfs2_split_extent() argument
5028 struct ocfs2_extent_list *el = path_leaf_el(path); in ocfs2_split_extent()
5042 ctxt.c_contig_type = ocfs2_figure_merge_contig_type(et, path, el, in ocfs2_split_extent()
5051 if (path->p_tree_depth) { in ocfs2_split_extent()
5065 rightmost_el = path_root_el(path); in ocfs2_split_extent()
5081 ret = ocfs2_replace_extent_rec(handle, et, path, el, in ocfs2_split_extent()
5084 ret = ocfs2_split_and_insert(handle, et, path, in ocfs2_split_extent()
5090 ret = ocfs2_try_to_merge_extent(handle, et, path, in ocfs2_split_extent()
5241 struct ocfs2_path *path, in ocfs2_split_tree() argument
5256 el = path_leaf_el(path); in ocfs2_split_tree()
5261 depth = path->p_tree_depth; in ocfs2_split_tree()
5274 rightmost_el = path_leaf_el(path); in ocfs2_split_tree()
5276 credits = path->p_tree_depth + in ocfs2_split_tree()
5311 struct ocfs2_path *path, int index, in ocfs2_truncate_rec() argument
5320 struct ocfs2_extent_list *el = path_leaf_el(path); in ocfs2_truncate_rec()
5325 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_truncate_rec()
5335 path->p_tree_depth) { in ocfs2_truncate_rec()
5342 eb = (struct ocfs2_extent_block *)path_leaf_bh(path)->b_data; in ocfs2_truncate_rec()
5348 if (index == 0 && path->p_tree_depth && in ocfs2_truncate_rec()
5363 ret = ocfs2_find_cpos_for_left_leaf(sb, path, &left_cpos); in ocfs2_truncate_rec()
5370 left_path = ocfs2_new_path_from_path(path); in ocfs2_truncate_rec()
5388 path); in ocfs2_truncate_rec()
5394 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_truncate_rec()
5423 ocfs2_adjust_rightmost_records(handle, et, path, in ocfs2_truncate_rec()
5435 ocfs2_adjust_rightmost_records(handle, et, path, rec); in ocfs2_truncate_rec()
5449 subtree_index = ocfs2_find_subtree_root(et, left_path, path); in ocfs2_truncate_rec()
5450 ocfs2_complete_edge_insert(handle, left_path, path, in ocfs2_truncate_rec()
5454 ocfs2_journal_dirty(handle, path_leaf_bh(path)); in ocfs2_truncate_rec()
5456 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_truncate_rec()
5477 struct ocfs2_path *path = NULL; in ocfs2_remove_extent() local
5485 path = ocfs2_new_path_from_et(et); in ocfs2_remove_extent()
5486 if (!path) { in ocfs2_remove_extent()
5492 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_remove_extent()
5498 el = path_leaf_el(path); in ocfs2_remove_extent()
5538 ret = ocfs2_truncate_rec(handle, et, path, index, dealloc, in ocfs2_remove_extent()
5545 ret = ocfs2_split_tree(handle, et, path, index, in ocfs2_remove_extent()
5556 ocfs2_reinit_path(path, 1); in ocfs2_remove_extent()
5558 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_remove_extent()
5564 el = path_leaf_el(path); in ocfs2_remove_extent()
5593 ret = ocfs2_truncate_rec(handle, et, path, index, dealloc, in ocfs2_remove_extent()
5602 ocfs2_free_path(path); in ocfs2_remove_extent()
7016 struct ocfs2_path *path = NULL; in ocfs2_commit_truncate() local
7030 path = ocfs2_new_path(di_bh, &di->id2.i_list, in ocfs2_commit_truncate()
7032 if (!path) { in ocfs2_commit_truncate()
7052 status = ocfs2_find_path(INODE_CACHE(inode), path, UINT_MAX); in ocfs2_commit_truncate()
7062 path->p_tree_depth); in ocfs2_commit_truncate()
7075 el = path_leaf_el(path); in ocfs2_commit_truncate()
7080 (unsigned long long)path_leaf_bh(path)->b_blocknr); in ocfs2_commit_truncate()
7149 ocfs2_reinit_path(path, 1); in ocfs2_commit_truncate()
7165 ocfs2_free_path(path); in ocfs2_commit_truncate()