Lines Matching refs:depth

111 	int depth, i;  in ext4_ext_drop_refs()  local
115 depth = path->p_depth; in ext4_ext_drop_refs()
116 for (i = 0; i <= depth; i++, path++) { in ext4_ext_drop_refs()
215 int depth = path->p_depth; in ext4_ext_find_goal() local
235 ex = path[depth].p_ext; in ext4_ext_find_goal()
248 if (path[depth].p_bh) in ext4_ext_find_goal()
249 return path[depth].p_bh->b_blocknr; in ext4_ext_find_goal()
344 ext4_ext_max_entries(struct inode *inode, int depth) in ext4_ext_max_entries() argument
348 if (depth == ext_depth(inode)) { in ext4_ext_max_entries()
349 if (depth == 0) in ext4_ext_max_entries()
354 if (depth == 0) in ext4_ext_max_entries()
390 int depth) in ext4_valid_extent_entries() argument
401 if (depth == 0) { in ext4_valid_extent_entries()
409 if (depth != ext_depth(inode) && in ext4_valid_extent_entries()
433 if (depth != ext_depth(inode) && in ext4_valid_extent_entries()
456 int depth, ext4_fsblk_t pblk, ext4_lblk_t lblk) in __ext4_ext_check() argument
465 if (unlikely(le16_to_cpu(eh->eh_depth) != depth)) { in __ext4_ext_check()
473 max = ext4_ext_max_entries(inode, depth); in __ext4_ext_check()
482 if (unlikely((eh->eh_entries == 0) && (depth > 0))) { in __ext4_ext_check()
486 if (!ext4_valid_extent_entries(inode, eh, lblk, &pblk, depth)) { in __ext4_ext_check()
490 if (unlikely(depth > 32)) { in __ext4_ext_check()
495 if (ext_depth(inode) != depth && in __ext4_ext_check()
511 max, le16_to_cpu(eh->eh_depth), depth); in __ext4_ext_check()
515 #define ext4_ext_check(inode, eh, depth, pblk) \ argument
516 __ext4_ext_check(__func__, __LINE__, (inode), (eh), (depth), (pblk), 0)
550 int depth, int flags) in __read_extent_tree_block() argument
574 depth, pblk, le32_to_cpu(idx->ei_block)); in __read_extent_tree_block()
581 if (!(flags & EXT4_EX_NOCACHE) && depth == 0) { in __read_extent_tree_block()
592 #define read_extent_tree_block(inode, idx, depth, flags) \ argument
594 (depth), (flags))
605 int i = 0, depth, ret = 0; in ext4_ext_precache() local
611 depth = ext_depth(inode); in ext4_ext_precache()
614 if (!depth) { in ext4_ext_precache()
619 path = kcalloc(depth + 1, sizeof(struct ext4_ext_path), in ext4_ext_precache()
627 ret = ext4_ext_check(inode, path[0].p_hdr, depth, 0); in ext4_ext_precache()
636 if ((i == depth) || in ext4_ext_precache()
644 depth - i - 1, in ext4_ext_precache()
687 int depth = ext_depth(inode); in ext4_ext_show_leaf() local
695 eh = path[depth].p_hdr; in ext4_ext_show_leaf()
711 int depth = ext_depth(inode); in ext4_ext_show_move() local
714 if (depth != level) { in ext4_ext_show_move()
727 ex = path[depth].p_ext; in ext4_ext_show_move()
728 while (ex <= EXT_MAX_EXTENT(path[depth].p_hdr)) { in ext4_ext_show_move()
889 short int depth, i, ppos = 0; in ext4_find_extent() local
897 depth = ext_depth(inode); in ext4_find_extent()
898 if (depth < 0 || depth > EXT4_MAX_EXTENT_DEPTH) { in ext4_find_extent()
900 depth); in ext4_find_extent()
907 if (depth > path[0].p_maxdepth) { in ext4_find_extent()
914 path = kcalloc(depth + 2, sizeof(struct ext4_ext_path), in ext4_find_extent()
918 path[0].p_maxdepth = depth + 1; in ext4_find_extent()
923 i = depth; in ext4_find_extent()
924 if (!(flags & EXT4_EX_NOCACHE) && depth == 0) in ext4_find_extent()
1058 int depth = ext_depth(inode); in ext4_ext_split() local
1077 if (unlikely(path[depth].p_ext > EXT_MAX_EXTENT(path[depth].p_hdr))) { in ext4_ext_split()
1081 if (path[depth].p_ext != EXT_MAX_EXTENT(path[depth].p_hdr)) { in ext4_ext_split()
1082 border = path[depth].p_ext[1].ee_block; in ext4_ext_split()
1105 ablocks = kcalloc(depth, sizeof(ext4_fsblk_t), gfp_flags); in ext4_ext_split()
1110 ext_debug(inode, "allocate %d blocks for indexes/leaf\n", depth - at); in ext4_ext_split()
1111 for (a = 0; a < depth - at; a++) { in ext4_ext_split()
1146 if (unlikely(path[depth].p_hdr->eh_entries != in ext4_ext_split()
1147 path[depth].p_hdr->eh_max)) { in ext4_ext_split()
1149 path[depth].p_hdr->eh_entries, in ext4_ext_split()
1150 path[depth].p_hdr->eh_max); in ext4_ext_split()
1155 m = EXT_MAX_EXTENT(path[depth].p_hdr) - path[depth].p_ext++; in ext4_ext_split()
1156 ext4_ext_show_move(inode, path, newblock, depth); in ext4_ext_split()
1160 memmove(ex, path[depth].p_ext, sizeof(struct ext4_extent) * m); in ext4_ext_split()
1180 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_split()
1183 le16_add_cpu(&path[depth].p_hdr->eh_entries, -m); in ext4_ext_split()
1184 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_split()
1191 k = depth - at - 1; in ext4_ext_split()
1201 i = depth - 1; in ext4_ext_split()
1221 neh->eh_depth = cpu_to_le16(depth - i); in ext4_ext_split()
1291 for (i = 0; i < depth; i++) { in ext4_ext_split()
1406 int depth, i, err = 0; in ext4_ext_create_new_leaf() local
1409 i = depth = ext_depth(inode); in ext4_ext_create_new_leaf()
1412 curp = path + depth; in ext4_ext_create_new_leaf()
1452 depth = ext_depth(inode); in ext4_ext_create_new_leaf()
1453 if (path[depth].p_hdr->eh_entries == path[depth].p_hdr->eh_max) { in ext4_ext_create_new_leaf()
1476 int depth, ee_len; in ext4_ext_search_left() local
1482 depth = path->p_depth; in ext4_ext_search_left()
1485 if (depth == 0 && path->p_ext == NULL) in ext4_ext_search_left()
1492 ex = path[depth].p_ext; in ext4_ext_search_left()
1495 if (unlikely(EXT_FIRST_EXTENT(path[depth].p_hdr) != ex)) { in ext4_ext_search_left()
1501 while (--depth >= 0) { in ext4_ext_search_left()
1502 ix = path[depth].p_idx; in ext4_ext_search_left()
1503 if (unlikely(ix != EXT_FIRST_INDEX(path[depth].p_hdr))) { in ext4_ext_search_left()
1507 le32_to_cpu(EXT_FIRST_INDEX(path[depth].p_hdr)->ei_block), in ext4_ext_search_left()
1508 depth); in ext4_ext_search_left()
1543 int depth; /* Note, NOT eh_depth; depth from top of tree */ in ext4_ext_search_right() local
1550 depth = path->p_depth; in ext4_ext_search_right()
1553 if (depth == 0 && path->p_ext == NULL) in ext4_ext_search_right()
1560 ex = path[depth].p_ext; in ext4_ext_search_right()
1563 if (unlikely(EXT_FIRST_EXTENT(path[depth].p_hdr) != ex)) { in ext4_ext_search_right()
1566 depth); in ext4_ext_search_right()
1569 while (--depth >= 0) { in ext4_ext_search_right()
1570 ix = path[depth].p_idx; in ext4_ext_search_right()
1571 if (unlikely(ix != EXT_FIRST_INDEX(path[depth].p_hdr))) { in ext4_ext_search_right()
1588 if (ex != EXT_LAST_EXTENT(path[depth].p_hdr)) { in ext4_ext_search_right()
1595 while (--depth >= 0) { in ext4_ext_search_right()
1596 ix = path[depth].p_idx; in ext4_ext_search_right()
1597 if (ix != EXT_LAST_INDEX(path[depth].p_hdr)) in ext4_ext_search_right()
1609 while (++depth < path->p_depth) { in ext4_ext_search_right()
1611 bh = read_extent_tree_block(inode, ix, path->p_depth - depth, 0); in ext4_ext_search_right()
1619 bh = read_extent_tree_block(inode, ix, path->p_depth - depth, 0); in ext4_ext_search_right()
1644 int depth; in ext4_ext_next_allocated_block() local
1647 depth = path->p_depth; in ext4_ext_next_allocated_block()
1649 if (depth == 0 && path->p_ext == NULL) in ext4_ext_next_allocated_block()
1652 while (depth >= 0) { in ext4_ext_next_allocated_block()
1653 struct ext4_ext_path *p = &path[depth]; in ext4_ext_next_allocated_block()
1655 if (depth == path->p_depth) { in ext4_ext_next_allocated_block()
1664 depth--; in ext4_ext_next_allocated_block()
1676 int depth; in ext4_ext_next_leaf_block() local
1679 depth = path->p_depth; in ext4_ext_next_leaf_block()
1682 if (depth == 0) in ext4_ext_next_leaf_block()
1686 depth--; in ext4_ext_next_leaf_block()
1688 while (depth >= 0) { in ext4_ext_next_leaf_block()
1689 if (path[depth].p_idx != in ext4_ext_next_leaf_block()
1690 EXT_LAST_INDEX(path[depth].p_hdr)) in ext4_ext_next_leaf_block()
1692 le32_to_cpu(path[depth].p_idx[1].ei_block); in ext4_ext_next_leaf_block()
1693 depth--; in ext4_ext_next_leaf_block()
1709 int depth = ext_depth(inode); in ext4_ext_correct_indexes() local
1714 eh = path[depth].p_hdr; in ext4_ext_correct_indexes()
1715 ex = path[depth].p_ext; in ext4_ext_correct_indexes()
1723 if (depth == 0) { in ext4_ext_correct_indexes()
1736 k = depth - 1; in ext4_ext_correct_indexes()
1737 border = path[depth].p_ext->ee_block; in ext4_ext_correct_indexes()
1806 unsigned int depth, len; in ext4_ext_try_to_merge_right() local
1809 depth = ext_depth(inode); in ext4_ext_try_to_merge_right()
1810 BUG_ON(path[depth].p_hdr == NULL); in ext4_ext_try_to_merge_right()
1811 eh = path[depth].p_hdr; in ext4_ext_try_to_merge_right()
1894 unsigned int depth; in ext4_ext_try_to_merge() local
1897 depth = ext_depth(inode); in ext4_ext_try_to_merge()
1898 BUG_ON(path[depth].p_hdr == NULL); in ext4_ext_try_to_merge()
1899 eh = path[depth].p_hdr; in ext4_ext_try_to_merge()
1924 unsigned int depth, len1; in ext4_ext_check_overlap() local
1929 depth = ext_depth(inode); in ext4_ext_check_overlap()
1930 if (!path[depth].p_ext) in ext4_ext_check_overlap()
1932 b2 = EXT4_LBLK_CMASK(sbi, le32_to_cpu(path[depth].p_ext->ee_block)); in ext4_ext_check_overlap()
1976 int depth, len, err; in ext4_ext_insert_extent() local
1986 depth = ext_depth(inode); in ext4_ext_insert_extent()
1987 ex = path[depth].p_ext; in ext4_ext_insert_extent()
1988 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
1989 if (unlikely(path[depth].p_hdr == NULL)) { in ext4_ext_insert_extent()
1990 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth); in ext4_ext_insert_extent()
2027 path + depth); in ext4_ext_insert_extent()
2052 path + depth); in ext4_ext_insert_extent()
2068 depth = ext_depth(inode); in ext4_ext_insert_extent()
2069 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2085 eh = npath[depth].p_hdr; in ext4_ext_insert_extent()
2106 depth = ext_depth(inode); in ext4_ext_insert_extent()
2107 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2110 nearex = path[depth].p_ext; in ext4_ext_insert_extent()
2112 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_insert_extent()
2162 path[depth].p_ext = nearex; in ext4_ext_insert_extent()
2248 int depth = ext_depth(inode); in ext4_ext_find_hole() local
2252 ex = path[depth].p_ext; in ext4_ext_find_hole()
2278 struct ext4_ext_path *path, int depth) in ext4_ext_rm_idx() argument
2284 depth--; in ext4_ext_rm_idx()
2285 path = path + depth; in ext4_ext_rm_idx()
2311 while (--depth >= 0) { in ext4_ext_rm_idx()
2337 int depth = ext_depth(inode); in ext4_ext_calc_credits_for_single_extent() local
2341 if (le16_to_cpu(path[depth].p_hdr->eh_entries) in ext4_ext_calc_credits_for_single_extent()
2342 < le16_to_cpu(path[depth].p_hdr->eh_max)) { in ext4_ext_calc_credits_for_single_extent()
2373 int depth; in ext4_ext_index_trans_blocks() local
2379 depth = ext_depth(inode); in ext4_ext_index_trans_blocks()
2382 index = depth * 2; in ext4_ext_index_trans_blocks()
2384 index = depth * 3; in ext4_ext_index_trans_blocks()
2573 int depth = ext_depth(inode), credits, revoke_credits; in ext4_ext_rm_leaf() local
2585 if (!path[depth].p_hdr) in ext4_ext_rm_leaf()
2586 path[depth].p_hdr = ext_block_hdr(path[depth].p_bh); in ext4_ext_rm_leaf()
2587 eh = path[depth].p_hdr; in ext4_ext_rm_leaf()
2588 if (unlikely(path[depth].p_hdr == NULL)) { in ext4_ext_rm_leaf()
2589 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth); in ext4_ext_rm_leaf()
2593 ex = path[depth].p_ext; in ext4_ext_rm_leaf()
2612 path[depth].p_ext = ex; in ext4_ext_rm_leaf()
2682 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_rm_leaf()
2722 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_rm_leaf()
2761 if (err == 0 && eh->eh_entries == 0 && path[depth].p_bh != NULL) in ext4_ext_rm_leaf()
2762 err = ext4_ext_rm_idx(handle, inode, path, depth); in ext4_ext_rm_leaf()
2793 int depth = ext_depth(inode); in ext4_ext_remove_space() local
2807 depth + 1, in ext4_ext_remove_space()
2808 ext4_free_metadata_revoke_credits(inode->i_sb, depth)); in ext4_ext_remove_space()
2813 trace_ext4_ext_remove_space(inode, start, end, depth); in ext4_ext_remove_space()
2834 depth = ext_depth(inode); in ext4_ext_remove_space()
2836 ex = path[depth].p_ext; in ext4_ext_remove_space()
2838 if (depth) { in ext4_ext_remove_space()
2841 depth); in ext4_ext_remove_space()
2907 depth = ext_depth(inode); in ext4_ext_remove_space()
2909 int k = i = depth; in ext4_ext_remove_space()
2914 path = kcalloc(depth + 1, sizeof(struct ext4_ext_path), in ext4_ext_remove_space()
2920 path[0].p_maxdepth = path[0].p_depth = depth; in ext4_ext_remove_space()
2924 if (ext4_ext_check(inode, path[0].p_hdr, depth, 0)) { in ext4_ext_remove_space()
2932 if (i == depth) { in ext4_ext_remove_space()
2971 depth - i - 1, in ext4_ext_remove_space()
2981 if (WARN_ON(i + 1 > depth)) { in ext4_ext_remove_space()
3007 trace_ext4_ext_remove_space_done(inode, start, end, depth, &partial, in ext4_ext_remove_space()
3164 unsigned int ee_len, depth; in ext4_split_extent_at() local
3174 depth = ext_depth(inode); in ext4_split_extent_at()
3175 ex = path[depth].p_ext; in ext4_split_extent_at()
3186 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_split_extent_at()
3218 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_split_extent_at()
3310 unsigned int ee_len, depth; in ext4_split_extent() local
3316 depth = ext_depth(inode); in ext4_split_extent()
3317 ex = path[depth].p_ext; in ext4_split_extent()
3344 depth = ext_depth(inode); in ext4_split_extent()
3345 ex = path[depth].p_ext; in ext4_split_extent()
3404 unsigned int ee_len, depth, map_len = map->m_len; in ext4_ext_convert_to_initialized() local
3418 depth = ext_depth(inode); in ext4_ext_convert_to_initialized()
3419 eh = path[depth].p_hdr; in ext4_ext_convert_to_initialized()
3420 ex = path[depth].p_ext; in ext4_ext_convert_to_initialized()
3474 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3520 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3542 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3545 path[depth].p_ext = abut_ex; in ext4_ext_convert_to_initialized()
3660 int split_flag = 0, depth; in ext4_split_convert_extents() local
3673 depth = ext_depth(inode); in ext4_split_convert_extents()
3674 ex = path[depth].p_ext; in ext4_split_convert_extents()
3700 int depth; in ext4_convert_unwritten_extents_endio() local
3703 depth = ext_depth(inode); in ext4_convert_unwritten_extents_endio()
3704 ex = path[depth].p_ext; in ext4_convert_unwritten_extents_endio()
3731 depth = ext_depth(inode); in ext4_convert_unwritten_extents_endio()
3732 ex = path[depth].p_ext; in ext4_convert_unwritten_extents_endio()
3735 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_convert_unwritten_extents_endio()
3763 int depth; in convert_initialized_extent() local
3773 depth = ext_depth(inode); in convert_initialized_extent()
3774 ex = path[depth].p_ext; in convert_initialized_extent()
3789 depth = ext_depth(inode); in convert_initialized_extent()
3790 ex = path[depth].p_ext; in convert_initialized_extent()
3798 err = ext4_ext_get_access(handle, inode, path + depth); in convert_initialized_extent()
4130 int err = 0, depth, ret; in ext4_ext_map_blocks() local
4147 depth = ext_depth(inode); in ext4_ext_map_blocks()
4154 if (unlikely(path[depth].p_ext == NULL && depth != 0)) { in ext4_ext_map_blocks()
4157 (unsigned long) map->m_lblk, depth, in ext4_ext_map_blocks()
4158 path[depth].p_block); in ext4_ext_map_blocks()
4163 ex = path[depth].p_ext; in ext4_ext_map_blocks()
4453 int depth = 0; in ext4_alloc_file_blocks() local
4473 depth = ext_depth(inode); in ext4_alloc_file_blocks()
4480 if (depth != ext_depth(inode)) { in ext4_alloc_file_blocks()
4482 depth = ext_depth(inode); in ext4_alloc_file_blocks()
5059 int depth, err = 0; in ext4_ext_shift_path_extents() local
5063 depth = path->p_depth; in ext4_ext_shift_path_extents()
5065 while (depth >= 0) { in ext4_ext_shift_path_extents()
5066 if (depth == path->p_depth) { in ext4_ext_shift_path_extents()
5067 ex_start = path[depth].p_ext; in ext4_ext_shift_path_extents()
5071 ex_last = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_path_extents()
5074 if (ex_start == EXT_FIRST_EXTENT(path[depth].p_hdr)) { in ext4_ext_shift_path_extents()
5077 credits = depth + 2; in ext4_ext_shift_path_extents()
5089 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5099 EXT_FIRST_EXTENT(path[depth].p_hdr)) in ext4_ext_shift_path_extents()
5113 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5117 if (--depth < 0 || !update) in ext4_ext_shift_path_extents()
5122 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5127 le32_add_cpu(&path[depth].p_idx->ei_block, -shift); in ext4_ext_shift_path_extents()
5129 le32_add_cpu(&path[depth].p_idx->ei_block, shift); in ext4_ext_shift_path_extents()
5130 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5135 if (path[depth].p_idx != EXT_FIRST_INDEX(path[depth].p_hdr)) in ext4_ext_shift_path_extents()
5138 depth--; in ext4_ext_shift_path_extents()
5158 int ret = 0, depth; in ext4_ext_shift_extents() local
5169 depth = path->p_depth; in ext4_ext_shift_extents()
5170 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5186 depth = path->p_depth; in ext4_ext_shift_extents()
5187 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5235 depth = path->p_depth; in ext4_ext_shift_extents()
5236 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5245 if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) { in ext4_ext_shift_extents()
5246 path[depth].p_ext++; in ext4_ext_shift_extents()
5255 extent = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5259 extent = EXT_FIRST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5265 extent = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5269 if (extent == EXT_LAST_EXTENT(path[depth].p_hdr)) in ext4_ext_shift_extents()
5275 path[depth].p_ext = extent; in ext4_ext_shift_extents()
5443 int ret = 0, depth, split_flag = 0; in ext4_insert_range() local
5536 depth = ext_depth(inode); in ext4_insert_range()
5537 extent = path[depth].p_ext; in ext4_insert_range()
5797 int depth, mapped = 0, err = 0; in ext4_clu_mapped() local
5818 depth = ext_depth(inode); in ext4_clu_mapped()
5825 if (unlikely(path[depth].p_ext == NULL && depth != 0)) { in ext4_clu_mapped()
5829 depth, path[depth].p_block); in ext4_clu_mapped()
5834 extent = path[depth].p_ext; in ext4_clu_mapped()