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()
1106 struct ocfs2_path *path = NULL; in ocfs2_adjust_rightmost_branch() local
1110 path = ocfs2_new_path_from_et(et); in ocfs2_adjust_rightmost_branch()
1111 if (!path) { in ocfs2_adjust_rightmost_branch()
1116 status = ocfs2_find_path(et->et_ci, path, UINT_MAX); in ocfs2_adjust_rightmost_branch()
1122 status = ocfs2_extend_trans(handle, path_num_items(path)); in ocfs2_adjust_rightmost_branch()
1128 status = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_adjust_rightmost_branch()
1134 el = path_leaf_el(path); in ocfs2_adjust_rightmost_branch()
1137 ocfs2_adjust_rightmost_records(handle, et, path, rec); in ocfs2_adjust_rightmost_branch()
1140 ocfs2_free_path(path); in ocfs2_adjust_rightmost_branch()
1867 struct ocfs2_path *path; member
1874 ocfs2_path_insert_eb(fp->path, fp->index, bh); in find_path_ins()
1878 struct ocfs2_path *path, u32 cpos) in ocfs2_find_path() argument
1883 data.path = path; in ocfs2_find_path()
1884 return __ocfs2_find_path(ci, path_root_el(path), cpos, in ocfs2_find_path()
2197 struct ocfs2_path *path, u32 *cpos) in ocfs2_find_cpos_for_left_leaf() argument
2203 BUG_ON(path->p_tree_depth == 0); in ocfs2_find_cpos_for_left_leaf()
2207 blkno = path_leaf_bh(path)->b_blocknr; in ocfs2_find_cpos_for_left_leaf()
2210 i = path->p_tree_depth - 1; in ocfs2_find_cpos_for_left_leaf()
2212 el = path->p_node[i].el; in ocfs2_find_cpos_for_left_leaf()
2256 blkno = path->p_node[i].bh->b_blocknr; in ocfs2_find_cpos_for_left_leaf()
2271 struct ocfs2_path *path) in ocfs2_extend_rotate_transaction() argument
2274 int credits = (path->p_tree_depth - subtree_depth) * 2 + 1 + op_credits; in ocfs2_extend_rotate_transaction()
2511 int subtree_index, struct ocfs2_path *path) in ocfs2_update_edge_lengths() argument
2534 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_update_edge_lengths()
2541 eb = (struct ocfs2_extent_block *)path_leaf_bh(path)->b_data; in ocfs2_update_edge_lengths()
2550 for (i = 0; i < path->p_tree_depth; i++) { in ocfs2_update_edge_lengths()
2551 el = path->p_node[i].el; in ocfs2_update_edge_lengths()
2558 ocfs2_journal_dirty(handle, path->p_node[i].bh); in ocfs2_update_edge_lengths()
2567 struct ocfs2_path *path, int unlink_start) in ocfs2_unlink_path() argument
2574 for(i = unlink_start; i < path_num_items(path); i++) { in ocfs2_unlink_path()
2575 bh = path->p_node[i].bh; in ocfs2_unlink_path()
2811 struct ocfs2_path *path, u32 *cpos) in ocfs2_find_cpos_for_right_leaf() argument
2819 if (path->p_tree_depth == 0) in ocfs2_find_cpos_for_right_leaf()
2822 blkno = path_leaf_bh(path)->b_blocknr; in ocfs2_find_cpos_for_right_leaf()
2825 i = path->p_tree_depth - 1; in ocfs2_find_cpos_for_right_leaf()
2829 el = path->p_node[i].el; in ocfs2_find_cpos_for_right_leaf()
2871 blkno = path->p_node[i].bh->b_blocknr; in ocfs2_find_cpos_for_right_leaf()
2881 struct ocfs2_path *path) in ocfs2_rotate_rightmost_leaf_left() argument
2884 struct buffer_head *bh = path_leaf_bh(path); in ocfs2_rotate_rightmost_leaf_left()
2885 struct ocfs2_extent_list *el = path_leaf_el(path); in ocfs2_rotate_rightmost_leaf_left()
2890 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, path, in ocfs2_rotate_rightmost_leaf_left()
2891 path_num_items(path) - 1); in ocfs2_rotate_rightmost_leaf_left()
2907 struct ocfs2_path *path, in __ocfs2_rotate_tree_left() argument
2917 if (!ocfs2_is_empty_extent(&(path_leaf_el(path)->l_recs[0]))) in __ocfs2_rotate_tree_left()
2922 ret = ocfs2_find_cpos_for_right_leaf(sb, path, &right_cpos); in __ocfs2_rotate_tree_left()
2928 left_path = ocfs2_new_path_from_path(path); in __ocfs2_rotate_tree_left()
2935 ocfs2_cp_path(left_path, path); in __ocfs2_rotate_tree_left()
2937 right_path = ocfs2_new_path_from_path(path); in __ocfs2_rotate_tree_left()
3023 struct ocfs2_path *path, in ocfs2_remove_rightmost_path() argument
3042 path); in ocfs2_remove_rightmost_path()
3048 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_remove_rightmost_path()
3055 path, &cpos); in ocfs2_remove_rightmost_path()
3066 left_path = ocfs2_new_path_from_path(path); in ocfs2_remove_rightmost_path()
3085 subtree_index = ocfs2_find_subtree_root(et, left_path, path); in ocfs2_remove_rightmost_path()
3087 ocfs2_unlink_subtree(handle, et, left_path, path, in ocfs2_remove_rightmost_path()
3106 ocfs2_unlink_path(handle, et, dealloc, path, 1); in ocfs2_remove_rightmost_path()
3116 ocfs2_journal_dirty(handle, path_root_bh(path)); in ocfs2_remove_rightmost_path()
3125 struct ocfs2_path *path, in ocfs2_remove_rightmost_empty_extent() argument
3130 int credits = path->p_tree_depth * 2 + 1; in ocfs2_remove_rightmost_empty_extent()
3139 ret = ocfs2_remove_rightmost_path(handle, et, path, dealloc); in ocfs2_remove_rightmost_empty_extent()
3165 struct ocfs2_path *path, in ocfs2_rotate_tree_left() argument
3173 el = path_leaf_el(path); in ocfs2_rotate_tree_left()
3177 if (path->p_tree_depth == 0) { in ocfs2_rotate_tree_left()
3183 ret = ocfs2_rotate_rightmost_leaf_left(handle, et, path); in ocfs2_rotate_tree_left()
3202 eb = (struct ocfs2_extent_block *)path_leaf_bh(path)->b_data; in ocfs2_rotate_tree_left()
3231 ret = ocfs2_remove_rightmost_path(handle, et, path, in ocfs2_rotate_tree_left()
3243 ret = __ocfs2_rotate_tree_left(handle, et, orig_credits, path, in ocfs2_rotate_tree_left()
3669 struct ocfs2_path *path, in ocfs2_try_to_merge_extent() argument
3676 struct ocfs2_extent_list *el = path_leaf_el(path); in ocfs2_try_to_merge_extent()
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()
3731 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3743 ret = ocfs2_merge_rec_left(path, handle, et, rec, in ocfs2_try_to_merge_extent()
3751 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_try_to_merge_extent()
3768 ret = ocfs2_merge_rec_left(path, handle, et, in ocfs2_try_to_merge_extent()
3776 ret = ocfs2_merge_rec_right(path, handle, in ocfs2_try_to_merge_extent()
3790 ret = ocfs2_rotate_tree_left(handle, et, path, in ocfs2_try_to_merge_extent()
3928 struct ocfs2_path *path, in ocfs2_adjust_rightmost_records() argument
3939 for (i = 0; i < path->p_tree_depth; i++) { in ocfs2_adjust_rightmost_records()
3940 bh = path->p_node[i].bh; in ocfs2_adjust_rightmost_records()
3941 el = path->p_node[i].el; in ocfs2_adjust_rightmost_records()
4329 struct ocfs2_path *path, in ocfs2_figure_merge_contig_type() argument
4346 } else if (path->p_tree_depth > 0) { in ocfs2_figure_merge_contig_type()
4347 status = ocfs2_find_cpos_for_left_leaf(sb, path, &left_cpos); in ocfs2_figure_merge_contig_type()
4352 left_path = ocfs2_new_path_from_path(path); in ocfs2_figure_merge_contig_type()
4400 path->p_tree_depth > 0) { in ocfs2_figure_merge_contig_type()
4401 status = ocfs2_find_cpos_for_right_leaf(sb, path, &right_cpos); in ocfs2_figure_merge_contig_type()
4408 right_path = ocfs2_new_path_from_path(path); in ocfs2_figure_merge_contig_type()
4560 struct ocfs2_path *path = NULL; in ocfs2_figure_insert_type() local
4603 path = ocfs2_new_path_from_et(et); in ocfs2_figure_insert_type()
4604 if (!path) { in ocfs2_figure_insert_type()
4616 ret = ocfs2_find_path(et->et_ci, path, le32_to_cpu(insert_rec->e_cpos)); in ocfs2_figure_insert_type()
4622 el = path_leaf_el(path); in ocfs2_figure_insert_type()
4654 path_leaf_bh(path)->b_blocknr) { in ocfs2_figure_insert_type()
4667 ocfs2_free_path(path); in ocfs2_figure_insert_type()
4885 struct ocfs2_path *path, in ocfs2_split_and_insert() argument
4905 rec = path_leaf_el(path)->l_recs[split_index]; in ocfs2_split_and_insert()
4969 ocfs2_reinit_path(path, 1); in ocfs2_split_and_insert()
4972 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_split_and_insert()
4978 el = path_leaf_el(path); in ocfs2_split_and_insert()
4997 struct ocfs2_path *path, in ocfs2_replace_extent_rec() argument
5004 ret = ocfs2_path_bh_journal_access(handle, et->et_ci, path, in ocfs2_replace_extent_rec()
5005 path_num_items(path) - 1); in ocfs2_replace_extent_rec()
5013 ocfs2_journal_dirty(handle, path_leaf_bh(path)); in ocfs2_replace_extent_rec()
5039 struct ocfs2_path *path, in ocfs2_split_extent() argument
5046 struct ocfs2_extent_list *el = path_leaf_el(path); in ocfs2_split_extent()
5060 ret = ocfs2_figure_merge_contig_type(et, path, el, in ocfs2_split_extent()
5074 if (path->p_tree_depth) { in ocfs2_split_extent()
5088 rightmost_el = path_root_el(path); in ocfs2_split_extent()
5104 ret = ocfs2_replace_extent_rec(handle, et, path, el, in ocfs2_split_extent()
5107 ret = ocfs2_split_and_insert(handle, et, path, in ocfs2_split_extent()
5113 ret = ocfs2_try_to_merge_extent(handle, et, path, in ocfs2_split_extent()
5261 struct ocfs2_path *path, in ocfs2_split_tree() argument
5276 el = path_leaf_el(path); in ocfs2_split_tree()
5281 depth = path->p_tree_depth; in ocfs2_split_tree()
5294 rightmost_el = path_leaf_el(path); in ocfs2_split_tree()
5296 credits = path->p_tree_depth + in ocfs2_split_tree()
5331 struct ocfs2_path *path, int index, in ocfs2_truncate_rec() argument
5340 struct ocfs2_extent_list *el = path_leaf_el(path); in ocfs2_truncate_rec()
5345 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_truncate_rec()
5355 path->p_tree_depth) { in ocfs2_truncate_rec()
5362 eb = (struct ocfs2_extent_block *)path_leaf_bh(path)->b_data; in ocfs2_truncate_rec()
5368 if (index == 0 && path->p_tree_depth && in ocfs2_truncate_rec()
5383 ret = ocfs2_find_cpos_for_left_leaf(sb, path, &left_cpos); in ocfs2_truncate_rec()
5390 left_path = ocfs2_new_path_from_path(path); in ocfs2_truncate_rec()
5408 path); in ocfs2_truncate_rec()
5414 ret = ocfs2_journal_access_path(et->et_ci, handle, path); in ocfs2_truncate_rec()
5443 ocfs2_adjust_rightmost_records(handle, et, path, in ocfs2_truncate_rec()
5455 ocfs2_adjust_rightmost_records(handle, et, path, rec); in ocfs2_truncate_rec()
5469 subtree_index = ocfs2_find_subtree_root(et, left_path, path); in ocfs2_truncate_rec()
5470 ocfs2_complete_edge_insert(handle, left_path, path, in ocfs2_truncate_rec()
5474 ocfs2_journal_dirty(handle, path_leaf_bh(path)); in ocfs2_truncate_rec()
5476 ret = ocfs2_rotate_tree_left(handle, et, path, dealloc); in ocfs2_truncate_rec()
5497 struct ocfs2_path *path = NULL; in ocfs2_remove_extent() local
5505 path = ocfs2_new_path_from_et(et); in ocfs2_remove_extent()
5506 if (!path) { in ocfs2_remove_extent()
5512 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_remove_extent()
5518 el = path_leaf_el(path); in ocfs2_remove_extent()
5557 ret = ocfs2_truncate_rec(handle, et, path, index, dealloc, in ocfs2_remove_extent()
5564 ret = ocfs2_split_tree(handle, et, path, index, in ocfs2_remove_extent()
5575 ocfs2_reinit_path(path, 1); in ocfs2_remove_extent()
5577 ret = ocfs2_find_path(et->et_ci, path, cpos); in ocfs2_remove_extent()
5583 el = path_leaf_el(path); in ocfs2_remove_extent()
5611 ret = ocfs2_truncate_rec(handle, et, path, index, dealloc, in ocfs2_remove_extent()
5620 ocfs2_free_path(path); in ocfs2_remove_extent()
7034 struct ocfs2_path *path = NULL; in ocfs2_commit_truncate() local
7048 path = ocfs2_new_path(di_bh, &di->id2.i_list, in ocfs2_commit_truncate()
7050 if (!path) { in ocfs2_commit_truncate()
7070 status = ocfs2_find_path(INODE_CACHE(inode), path, UINT_MAX); in ocfs2_commit_truncate()
7080 path->p_tree_depth); in ocfs2_commit_truncate()
7093 el = path_leaf_el(path); in ocfs2_commit_truncate()
7098 (unsigned long long)path_leaf_bh(path)->b_blocknr); in ocfs2_commit_truncate()
7118 &et, path, &dealloc); in ocfs2_commit_truncate()
7124 ocfs2_reinit_path(path, 1); in ocfs2_commit_truncate()
7175 ocfs2_reinit_path(path, 1); in ocfs2_commit_truncate()
7191 ocfs2_free_path(path); in ocfs2_commit_truncate()