Lines Matching refs:path
89 struct ext4_ext_path *path,
108 static inline void ext4_ext_path_brelse(struct ext4_ext_path *path) in ext4_ext_path_brelse() argument
110 brelse(path->p_bh); in ext4_ext_path_brelse()
111 path->p_bh = NULL; in ext4_ext_path_brelse()
114 static void ext4_ext_drop_refs(struct ext4_ext_path *path) in ext4_ext_drop_refs() argument
118 if (IS_ERR_OR_NULL(path)) in ext4_ext_drop_refs()
120 depth = path->p_depth; in ext4_ext_drop_refs()
121 for (i = 0; i <= depth; i++, path++) in ext4_ext_drop_refs()
122 ext4_ext_path_brelse(path); in ext4_ext_drop_refs()
125 void ext4_free_ext_path(struct ext4_ext_path *path) in ext4_free_ext_path() argument
127 if (IS_ERR_OR_NULL(path)) in ext4_free_ext_path()
129 ext4_ext_drop_refs(path); in ext4_free_ext_path()
130 kfree(path); in ext4_free_ext_path()
161 struct ext4_ext_path *path) in ext4_ext_get_access() argument
165 if (path->p_bh) { in ext4_ext_get_access()
167 BUFFER_TRACE(path->p_bh, "get_write_access"); in ext4_ext_get_access()
169 path->p_bh, EXT4_JTR_NONE); in ext4_ext_get_access()
177 clear_buffer_verified(path->p_bh); in ext4_ext_get_access()
192 struct ext4_ext_path *path) in __ext4_ext_dirty() argument
197 if (path->p_bh) { in __ext4_ext_dirty()
198 ext4_extent_block_csum_set(inode, ext_block_hdr(path->p_bh)); in __ext4_ext_dirty()
201 inode, path->p_bh); in __ext4_ext_dirty()
204 set_buffer_verified(path->p_bh); in __ext4_ext_dirty()
212 #define ext4_ext_dirty(handle, inode, path) \ argument
213 __ext4_ext_dirty(__func__, __LINE__, (handle), (inode), (path))
216 struct ext4_ext_path *path, in ext4_ext_find_goal() argument
219 if (path) { in ext4_ext_find_goal()
220 int depth = path->p_depth; in ext4_ext_find_goal()
240 ex = path[depth].p_ext; in ext4_ext_find_goal()
253 if (path[depth].p_bh) in ext4_ext_find_goal()
254 return path[depth].p_bh->b_blocknr; in ext4_ext_find_goal()
266 struct ext4_ext_path *path, in ext4_ext_new_meta_block() argument
271 goal = ext4_ext_find_goal(inode, path, le32_to_cpu(ex->ee_block)); in ext4_ext_new_meta_block()
333 struct ext4_ext_path *path, ext4_lblk_t lblk, in ext4_force_split_extent_at() argument
336 int unwritten = ext4_ext_is_unwritten(path[path->p_depth].p_ext); in ext4_force_split_extent_at()
342 return ext4_split_extent_at(handle, inode, path, lblk, unwritten ? in ext4_force_split_extent_at()
607 struct ext4_ext_path *path = NULL; in ext4_ext_precache() local
623 path = kcalloc(depth + 1, sizeof(struct ext4_ext_path), in ext4_ext_precache()
625 if (path == NULL) { in ext4_ext_precache()
630 path[0].p_hdr = ext_inode_hdr(inode); in ext4_ext_precache()
631 ret = ext4_ext_check(inode, path[0].p_hdr, depth, 0); in ext4_ext_precache()
634 path[0].p_idx = EXT_FIRST_INDEX(path[0].p_hdr); in ext4_ext_precache()
641 path[i].p_idx > EXT_LAST_INDEX(path[i].p_hdr)) { in ext4_ext_precache()
642 ext4_ext_path_brelse(path + i); in ext4_ext_precache()
646 bh = read_extent_tree_block(inode, path[i].p_idx++, in ext4_ext_precache()
654 path[i].p_bh = bh; in ext4_ext_precache()
655 path[i].p_hdr = ext_block_hdr(bh); in ext4_ext_precache()
656 path[i].p_idx = EXT_FIRST_INDEX(path[i].p_hdr); in ext4_ext_precache()
661 ext4_free_ext_path(path); in ext4_ext_precache()
666 static void ext4_ext_show_path(struct inode *inode, struct ext4_ext_path *path) in ext4_ext_show_path() argument
668 int k, l = path->p_depth; in ext4_ext_show_path()
671 for (k = 0; k <= l; k++, path++) { in ext4_ext_show_path()
672 if (path->p_idx) { in ext4_ext_show_path()
674 le32_to_cpu(path->p_idx->ei_block), in ext4_ext_show_path()
675 ext4_idx_pblock(path->p_idx)); in ext4_ext_show_path()
676 } else if (path->p_ext) { in ext4_ext_show_path()
678 le32_to_cpu(path->p_ext->ee_block), in ext4_ext_show_path()
679 ext4_ext_is_unwritten(path->p_ext), in ext4_ext_show_path()
680 ext4_ext_get_actual_len(path->p_ext), in ext4_ext_show_path()
681 ext4_ext_pblock(path->p_ext)); in ext4_ext_show_path()
688 static void ext4_ext_show_leaf(struct inode *inode, struct ext4_ext_path *path) in ext4_ext_show_leaf() argument
695 if (IS_ERR_OR_NULL(path)) in ext4_ext_show_leaf()
698 eh = path[depth].p_hdr; in ext4_ext_show_leaf()
711 static void ext4_ext_show_move(struct inode *inode, struct ext4_ext_path *path, in ext4_ext_show_move() argument
719 idx = path[level].p_idx; in ext4_ext_show_move()
720 while (idx <= EXT_MAX_INDEX(path[level].p_hdr)) { in ext4_ext_show_move()
730 ex = path[depth].p_ext; in ext4_ext_show_move()
731 while (ex <= EXT_MAX_EXTENT(path[depth].p_hdr)) { in ext4_ext_show_move()
743 #define ext4_ext_show_path(inode, path) argument
744 #define ext4_ext_show_leaf(inode, path) argument
745 #define ext4_ext_show_move(inode, path, newblock, level) argument
755 struct ext4_ext_path *path, ext4_lblk_t block) in ext4_ext_binsearch_idx() argument
757 struct ext4_extent_header *eh = path->p_hdr; in ext4_ext_binsearch_idx()
777 path->p_idx = l - 1; in ext4_ext_binsearch_idx()
778 ext_debug(inode, " -> %u->%lld ", le32_to_cpu(path->p_idx->ei_block), in ext4_ext_binsearch_idx()
779 ext4_idx_pblock(path->p_idx)); in ext4_ext_binsearch_idx()
803 BUG_ON(chix != path->p_idx); in ext4_ext_binsearch_idx()
816 struct ext4_ext_path *path, ext4_lblk_t block) in ext4_ext_binsearch() argument
818 struct ext4_extent_header *eh = path->p_hdr; in ext4_ext_binsearch()
846 path->p_ext = l - 1; in ext4_ext_binsearch()
848 le32_to_cpu(path->p_ext->ee_block), in ext4_ext_binsearch()
849 ext4_ext_pblock(path->p_ext), in ext4_ext_binsearch()
850 ext4_ext_is_unwritten(path->p_ext), in ext4_ext_binsearch()
851 ext4_ext_get_actual_len(path->p_ext)); in ext4_ext_binsearch()
866 BUG_ON(chex != path->p_ext); in ext4_ext_binsearch()
887 struct ext4_ext_path *path, int flags) in ext4_find_extent() argument
907 if (path) { in ext4_find_extent()
908 ext4_ext_drop_refs(path); in ext4_find_extent()
909 if (depth > path[0].p_maxdepth) { in ext4_find_extent()
910 kfree(path); in ext4_find_extent()
911 path = NULL; in ext4_find_extent()
914 if (!path) { in ext4_find_extent()
916 path = kcalloc(depth + 2, sizeof(struct ext4_ext_path), in ext4_find_extent()
918 if (unlikely(!path)) in ext4_find_extent()
920 path[0].p_maxdepth = depth + 1; in ext4_find_extent()
922 path[0].p_hdr = eh; in ext4_find_extent()
923 path[0].p_bh = NULL; in ext4_find_extent()
933 ext4_ext_binsearch_idx(inode, path + ppos, block); in ext4_find_extent()
934 path[ppos].p_block = ext4_idx_pblock(path[ppos].p_idx); in ext4_find_extent()
935 path[ppos].p_depth = i; in ext4_find_extent()
936 path[ppos].p_ext = NULL; in ext4_find_extent()
938 bh = read_extent_tree_block(inode, path[ppos].p_idx, --i, flags); in ext4_find_extent()
946 path[ppos].p_bh = bh; in ext4_find_extent()
947 path[ppos].p_hdr = eh; in ext4_find_extent()
950 path[ppos].p_depth = i; in ext4_find_extent()
951 path[ppos].p_ext = NULL; in ext4_find_extent()
952 path[ppos].p_idx = NULL; in ext4_find_extent()
955 ext4_ext_binsearch(inode, path + ppos, block); in ext4_find_extent()
957 if (path[ppos].p_ext) in ext4_find_extent()
958 path[ppos].p_block = ext4_ext_pblock(path[ppos].p_ext); in ext4_find_extent()
960 ext4_ext_show_path(inode, path); in ext4_find_extent()
962 return path; in ext4_find_extent()
965 ext4_free_ext_path(path); in ext4_find_extent()
1054 struct ext4_ext_path *path, in ext4_ext_split() argument
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()
1112 newblock = ext4_ext_new_meta_block(handle, inode, path, 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()
1231 if (unlikely(EXT_MAX_INDEX(path[i].p_hdr) != in ext4_ext_split()
1232 EXT_LAST_INDEX(path[i].p_hdr))) { in ext4_ext_split()
1235 le32_to_cpu(path[i].p_ext->ee_block)); in ext4_ext_split()
1240 m = EXT_MAX_INDEX(path[i].p_hdr) - path[i].p_idx++; in ext4_ext_split()
1241 ext_debug(inode, "cur 0x%p, last 0x%p\n", path[i].p_idx, in ext4_ext_split()
1242 EXT_MAX_INDEX(path[i].p_hdr)); in ext4_ext_split()
1243 ext4_ext_show_move(inode, path, newblock, i); in ext4_ext_split()
1245 memmove(++fidx, path[i].p_idx, in ext4_ext_split()
1266 err = ext4_ext_get_access(handle, inode, path + i); in ext4_ext_split()
1269 le16_add_cpu(&path[i].p_hdr->eh_entries, -m); in ext4_ext_split()
1270 err = ext4_ext_dirty(handle, inode, path + i); in ext4_ext_split()
1279 err = ext4_ext_insert_index(handle, inode, path + at, in ext4_ext_split()
1401 struct ext4_ext_path *path, in ext4_ext_create_new_leaf() argument
1412 curp = path + depth; in ext4_ext_create_new_leaf()
1423 err = ext4_ext_split(handle, inode, mb_flags, path, newext, i); in ext4_ext_create_new_leaf()
1428 path = ext4_find_extent(inode, ee_block, path, gb_flags); in ext4_ext_create_new_leaf()
1429 return path; in ext4_ext_create_new_leaf()
1438 path = ext4_find_extent(inode, ee_block, path, gb_flags); in ext4_ext_create_new_leaf()
1439 if (IS_ERR(path)) in ext4_ext_create_new_leaf()
1440 return path; in ext4_ext_create_new_leaf()
1447 if (path[depth].p_hdr->eh_entries == path[depth].p_hdr->eh_max) { in ext4_ext_create_new_leaf()
1452 return path; in ext4_ext_create_new_leaf()
1455 ext4_free_ext_path(path); in ext4_ext_create_new_leaf()
1467 struct ext4_ext_path *path, in ext4_ext_search_left() argument
1474 if (unlikely(path == NULL)) { in ext4_ext_search_left()
1478 depth = path->p_depth; in ext4_ext_search_left()
1481 if (depth == 0 && path->p_ext == NULL) in ext4_ext_search_left()
1488 ex = path[depth].p_ext; in ext4_ext_search_left()
1491 if (unlikely(EXT_FIRST_EXTENT(path[depth].p_hdr) != ex)) { in ext4_ext_search_left()
1498 ix = path[depth].p_idx; in ext4_ext_search_left()
1499 if (unlikely(ix != EXT_FIRST_INDEX(path[depth].p_hdr))) { in ext4_ext_search_left()
1503 le32_to_cpu(EXT_FIRST_INDEX(path[depth].p_hdr)->ei_block), in ext4_ext_search_left()
1531 struct ext4_ext_path *path, in ext4_ext_search_right() argument
1542 if (unlikely(path == NULL)) { in ext4_ext_search_right()
1546 depth = path->p_depth; in ext4_ext_search_right()
1549 if (depth == 0 && path->p_ext == NULL) in ext4_ext_search_right()
1556 ex = path[depth].p_ext; in ext4_ext_search_right()
1559 if (unlikely(EXT_FIRST_EXTENT(path[depth].p_hdr) != ex)) { in ext4_ext_search_right()
1566 ix = path[depth].p_idx; in ext4_ext_search_right()
1567 if (unlikely(ix != EXT_FIRST_INDEX(path[depth].p_hdr))) { in ext4_ext_search_right()
1584 if (ex != EXT_LAST_EXTENT(path[depth].p_hdr)) { in ext4_ext_search_right()
1592 ix = path[depth].p_idx; in ext4_ext_search_right()
1593 if (ix != EXT_LAST_INDEX(path[depth].p_hdr)) in ext4_ext_search_right()
1605 while (++depth < path->p_depth) { in ext4_ext_search_right()
1607 bh = read_extent_tree_block(inode, ix, path->p_depth - depth, 0); in ext4_ext_search_right()
1615 bh = read_extent_tree_block(inode, ix, path->p_depth - depth, 0); in ext4_ext_search_right()
1638 ext4_ext_next_allocated_block(struct ext4_ext_path *path) in ext4_ext_next_allocated_block() argument
1642 BUG_ON(path == NULL); in ext4_ext_next_allocated_block()
1643 depth = path->p_depth; in ext4_ext_next_allocated_block()
1645 if (depth == 0 && path->p_ext == NULL) in ext4_ext_next_allocated_block()
1649 struct ext4_ext_path *p = &path[depth]; in ext4_ext_next_allocated_block()
1651 if (depth == path->p_depth) { in ext4_ext_next_allocated_block()
1670 static ext4_lblk_t ext4_ext_next_leaf_block(struct ext4_ext_path *path) in ext4_ext_next_leaf_block() argument
1674 BUG_ON(path == NULL); in ext4_ext_next_leaf_block()
1675 depth = path->p_depth; in ext4_ext_next_leaf_block()
1685 if (path[depth].p_idx != in ext4_ext_next_leaf_block()
1686 EXT_LAST_INDEX(path[depth].p_hdr)) in ext4_ext_next_leaf_block()
1688 le32_to_cpu(path[depth].p_idx[1].ei_block); in ext4_ext_next_leaf_block()
1702 struct ext4_ext_path *path) in ext4_ext_correct_indexes() argument
1710 eh = path[depth].p_hdr; in ext4_ext_correct_indexes()
1711 ex = path[depth].p_ext; in ext4_ext_correct_indexes()
1733 border = path[depth].p_ext->ee_block; in ext4_ext_correct_indexes()
1734 err = ext4_ext_get_access(handle, inode, path + k); in ext4_ext_correct_indexes()
1737 path[k].p_idx->ei_block = border; in ext4_ext_correct_indexes()
1738 err = ext4_ext_dirty(handle, inode, path + k); in ext4_ext_correct_indexes()
1744 if (path[k+1].p_idx != EXT_FIRST_INDEX(path[k+1].p_hdr)) in ext4_ext_correct_indexes()
1746 err = ext4_ext_get_access(handle, inode, path + k); in ext4_ext_correct_indexes()
1749 path[k].p_idx->ei_block = border; in ext4_ext_correct_indexes()
1750 err = ext4_ext_dirty(handle, inode, path + k); in ext4_ext_correct_indexes()
1764 clear_buffer_verified(path[k].p_bh); in ext4_ext_correct_indexes()
1809 struct ext4_ext_path *path, in ext4_ext_try_to_merge_right() argument
1817 BUG_ON(path[depth].p_hdr == NULL); in ext4_ext_try_to_merge_right()
1818 eh = path[depth].p_hdr; in ext4_ext_try_to_merge_right()
1851 struct ext4_ext_path *path) in ext4_ext_try_to_merge_up() argument
1857 if ((path[0].p_depth != 1) || in ext4_ext_try_to_merge_up()
1858 (le16_to_cpu(path[0].p_hdr->eh_entries) != 1) || in ext4_ext_try_to_merge_up()
1859 (le16_to_cpu(path[1].p_hdr->eh_entries) > max_root)) in ext4_ext_try_to_merge_up()
1874 blk = ext4_idx_pblock(path[0].p_idx); in ext4_ext_try_to_merge_up()
1875 s = le16_to_cpu(path[1].p_hdr->eh_entries) * in ext4_ext_try_to_merge_up()
1879 path[1].p_maxdepth = path[0].p_maxdepth; in ext4_ext_try_to_merge_up()
1880 memcpy(path[0].p_hdr, path[1].p_hdr, s); in ext4_ext_try_to_merge_up()
1881 path[0].p_depth = 0; in ext4_ext_try_to_merge_up()
1882 path[0].p_ext = EXT_FIRST_EXTENT(path[0].p_hdr) + in ext4_ext_try_to_merge_up()
1883 (path[1].p_ext - EXT_FIRST_EXTENT(path[1].p_hdr)); in ext4_ext_try_to_merge_up()
1884 path[0].p_hdr->eh_max = cpu_to_le16(max_root); in ext4_ext_try_to_merge_up()
1886 ext4_ext_path_brelse(path + 1); in ext4_ext_try_to_merge_up()
1897 struct ext4_ext_path *path, in ext4_ext_try_to_merge() argument
1905 BUG_ON(path[depth].p_hdr == NULL); in ext4_ext_try_to_merge()
1906 eh = path[depth].p_hdr; in ext4_ext_try_to_merge()
1909 merge_done = ext4_ext_try_to_merge_right(inode, path, ex - 1); in ext4_ext_try_to_merge()
1912 (void) ext4_ext_try_to_merge_right(inode, path, ex); in ext4_ext_try_to_merge()
1914 ext4_ext_try_to_merge_up(handle, inode, path); in ext4_ext_try_to_merge()
1928 struct ext4_ext_path *path) in ext4_ext_check_overlap() argument
1937 if (!path[depth].p_ext) in ext4_ext_check_overlap()
1939 b2 = EXT4_LBLK_CMASK(sbi, le32_to_cpu(path[depth].p_ext->ee_block)); in ext4_ext_check_overlap()
1946 b2 = ext4_ext_next_allocated_block(path); in ext4_ext_check_overlap()
1976 struct ext4_ext_path *path, in ext4_ext_insert_extent() argument
1994 ex = path[depth].p_ext; in ext4_ext_insert_extent()
1995 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
1996 if (unlikely(path[depth].p_hdr == NULL)) { in ext4_ext_insert_extent()
2035 path + depth); in ext4_ext_insert_extent()
2060 path + depth); in ext4_ext_insert_extent()
2077 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2085 next = ext4_ext_next_leaf_block(path); in ext4_ext_insert_extent()
2095 BUG_ON(npath->p_depth != path->p_depth); in ext4_ext_insert_extent()
2100 ext4_free_ext_path(path); in ext4_ext_insert_extent()
2101 path = npath; in ext4_ext_insert_extent()
2115 path = ext4_ext_create_new_leaf(handle, inode, mb_flags, gb_flags, in ext4_ext_insert_extent()
2116 path, newext); in ext4_ext_insert_extent()
2117 if (IS_ERR(path)) in ext4_ext_insert_extent()
2118 return path; in ext4_ext_insert_extent()
2120 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2123 nearex = path[depth].p_ext; in ext4_ext_insert_extent()
2125 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_insert_extent()
2175 path[depth].p_ext = nearex; in ext4_ext_insert_extent()
2183 ext4_ext_try_to_merge(handle, inode, path, nearex); in ext4_ext_insert_extent()
2186 err = ext4_ext_correct_indexes(handle, inode, path); in ext4_ext_insert_extent()
2190 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_ext_insert_extent()
2194 return path; in ext4_ext_insert_extent()
2197 ext4_free_ext_path(path); in ext4_ext_insert_extent()
2261 struct ext4_ext_path *path, in ext4_ext_find_hole() argument
2268 ex = path[depth].p_ext; in ext4_ext_find_hole()
2280 next = ext4_ext_next_allocated_block(path); in ext4_ext_find_hole()
2294 struct ext4_ext_path *path, int depth) in ext4_ext_rm_idx() argument
2301 leaf = ext4_idx_pblock(path[k].p_idx); in ext4_ext_rm_idx()
2302 if (unlikely(path[k].p_hdr->eh_entries == 0)) { in ext4_ext_rm_idx()
2306 err = ext4_ext_get_access(handle, inode, path + k); in ext4_ext_rm_idx()
2310 if (path[k].p_idx != EXT_LAST_INDEX(path[k].p_hdr)) { in ext4_ext_rm_idx()
2311 int len = EXT_LAST_INDEX(path[k].p_hdr) - path[k].p_idx; in ext4_ext_rm_idx()
2313 memmove(path[k].p_idx, path[k].p_idx + 1, len); in ext4_ext_rm_idx()
2316 le16_add_cpu(&path[k].p_hdr->eh_entries, -1); in ext4_ext_rm_idx()
2317 err = ext4_ext_dirty(handle, inode, path + k); in ext4_ext_rm_idx()
2327 if (path[k + 1].p_idx != EXT_FIRST_INDEX(path[k + 1].p_hdr)) in ext4_ext_rm_idx()
2329 err = ext4_ext_get_access(handle, inode, path + k); in ext4_ext_rm_idx()
2332 path[k].p_idx->ei_block = path[k + 1].p_idx->ei_block; in ext4_ext_rm_idx()
2333 err = ext4_ext_dirty(handle, inode, path + k); in ext4_ext_rm_idx()
2347 clear_buffer_verified(path[k].p_bh); in ext4_ext_rm_idx()
2360 struct ext4_ext_path *path) in ext4_ext_calc_credits_for_single_extent() argument
2362 if (path) { in ext4_ext_calc_credits_for_single_extent()
2367 if (le16_to_cpu(path[depth].p_hdr->eh_entries) in ext4_ext_calc_credits_for_single_extent()
2368 < le16_to_cpu(path[depth].p_hdr->eh_max)) { in ext4_ext_calc_credits_for_single_extent()
2593 struct ext4_ext_path *path, in ext4_ext_rm_leaf() argument
2611 if (!path[depth].p_hdr) in ext4_ext_rm_leaf()
2612 path[depth].p_hdr = ext_block_hdr(path[depth].p_bh); in ext4_ext_rm_leaf()
2613 eh = path[depth].p_hdr; in ext4_ext_rm_leaf()
2614 if (unlikely(path[depth].p_hdr == NULL)) { in ext4_ext_rm_leaf()
2619 ex = path[depth].p_ext; in ext4_ext_rm_leaf()
2638 path[depth].p_ext = ex; in ext4_ext_rm_leaf()
2708 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_rm_leaf()
2748 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_rm_leaf()
2760 err = ext4_ext_correct_indexes(handle, inode, path); in ext4_ext_rm_leaf()
2787 if (err == 0 && eh->eh_entries == 0 && path[depth].p_bh != NULL) in ext4_ext_rm_leaf()
2788 err = ext4_ext_rm_idx(handle, inode, path, depth); in ext4_ext_rm_leaf()
2799 ext4_ext_more_to_rm(struct ext4_ext_path *path) in ext4_ext_more_to_rm() argument
2801 BUG_ON(path->p_idx == NULL); in ext4_ext_more_to_rm()
2803 if (path->p_idx < EXT_FIRST_INDEX(path->p_hdr)) in ext4_ext_more_to_rm()
2810 if (le16_to_cpu(path->p_hdr->eh_entries) == path->p_block) in ext4_ext_more_to_rm()
2820 struct ext4_ext_path *path = NULL; in ext4_ext_remove_space() local
2854 path = ext4_find_extent(inode, end, NULL, in ext4_ext_remove_space()
2856 if (IS_ERR(path)) { in ext4_ext_remove_space()
2858 return PTR_ERR(path); in ext4_ext_remove_space()
2862 ex = path[depth].p_ext; in ext4_ext_remove_space()
2901 path = ext4_force_split_extent_at(handle, inode, path, in ext4_ext_remove_space()
2903 if (IS_ERR(path)) { in ext4_ext_remove_space()
2904 err = PTR_ERR(path); in ext4_ext_remove_space()
2920 err = ext4_ext_search_right(inode, path, &lblk, &pblk, in ext4_ext_remove_space()
2935 if (path) { in ext4_ext_remove_space()
2938 path[k].p_block = in ext4_ext_remove_space()
2939 le16_to_cpu(path[k].p_hdr->eh_entries)+1; in ext4_ext_remove_space()
2941 path = kcalloc(depth + 1, sizeof(struct ext4_ext_path), in ext4_ext_remove_space()
2943 if (path == NULL) { in ext4_ext_remove_space()
2947 path[0].p_maxdepth = path[0].p_depth = depth; in ext4_ext_remove_space()
2948 path[0].p_hdr = ext_inode_hdr(inode); in ext4_ext_remove_space()
2951 if (ext4_ext_check(inode, path[0].p_hdr, depth, 0)) { in ext4_ext_remove_space()
2961 err = ext4_ext_rm_leaf(handle, inode, path, in ext4_ext_remove_space()
2964 ext4_ext_path_brelse(path + i); in ext4_ext_remove_space()
2970 if (!path[i].p_hdr) { in ext4_ext_remove_space()
2972 path[i].p_hdr = ext_block_hdr(path[i].p_bh); in ext4_ext_remove_space()
2975 if (!path[i].p_idx) { in ext4_ext_remove_space()
2977 path[i].p_idx = EXT_LAST_INDEX(path[i].p_hdr); in ext4_ext_remove_space()
2978 path[i].p_block = le16_to_cpu(path[i].p_hdr->eh_entries)+1; in ext4_ext_remove_space()
2980 path[i].p_hdr, in ext4_ext_remove_space()
2981 le16_to_cpu(path[i].p_hdr->eh_entries)); in ext4_ext_remove_space()
2984 path[i].p_idx--; in ext4_ext_remove_space()
2988 i, EXT_FIRST_INDEX(path[i].p_hdr), in ext4_ext_remove_space()
2989 path[i].p_idx); in ext4_ext_remove_space()
2990 if (ext4_ext_more_to_rm(path + i)) { in ext4_ext_remove_space()
2994 i + 1, ext4_idx_pblock(path[i].p_idx)); in ext4_ext_remove_space()
2995 memset(path + i + 1, 0, sizeof(*path)); in ext4_ext_remove_space()
2996 bh = read_extent_tree_block(inode, path[i].p_idx, in ext4_ext_remove_space()
3011 path[i + 1].p_bh = bh; in ext4_ext_remove_space()
3015 path[i].p_block = le16_to_cpu(path[i].p_hdr->eh_entries); in ext4_ext_remove_space()
3019 if (path[i].p_hdr->eh_entries == 0 && i > 0) { in ext4_ext_remove_space()
3023 err = ext4_ext_rm_idx(handle, inode, path, i); in ext4_ext_remove_space()
3026 ext4_ext_path_brelse(path + i); in ext4_ext_remove_space()
3033 path->p_hdr->eh_entries); in ext4_ext_remove_space()
3053 if (path->p_hdr->eh_entries == 0) { in ext4_ext_remove_space()
3058 err = ext4_ext_get_access(handle, inode, path); in ext4_ext_remove_space()
3063 err = ext4_ext_dirty(handle, inode, path); in ext4_ext_remove_space()
3067 ext4_free_ext_path(path); in ext4_ext_remove_space()
3068 path = NULL; in ext4_ext_remove_space()
3179 struct ext4_ext_path *path, in ext4_split_extent_at() argument
3195 ext4_ext_show_leaf(inode, path); in ext4_split_extent_at()
3198 ex = path[depth].p_ext; in ext4_split_extent_at()
3209 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_split_extent_at()
3225 ext4_ext_try_to_merge(handle, inode, path, ex); in ext4_split_extent_at()
3227 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_split_extent_at()
3241 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_split_extent_at()
3252 path = ext4_ext_insert_extent(handle, inode, path, &newex, flags); in ext4_split_extent_at()
3253 if (!IS_ERR(path)) in ext4_split_extent_at()
3256 err = PTR_ERR(path); in ext4_split_extent_at()
3258 return path; in ext4_split_extent_at()
3268 path = ext4_find_extent(inode, ee_block, NULL, flags | EXT4_EX_NOFAIL); in ext4_split_extent_at()
3269 if (IS_ERR(path)) { in ext4_split_extent_at()
3271 split, PTR_ERR(path)); in ext4_split_extent_at()
3272 return path; in ext4_split_extent_at()
3275 ex = path[depth].p_ext; in ext4_split_extent_at()
3306 ext4_ext_try_to_merge(handle, inode, path, ex); in ext4_split_extent_at()
3307 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_split_extent_at()
3326 ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_split_extent_at()
3329 ext4_free_ext_path(path); in ext4_split_extent_at()
3330 path = ERR_PTR(err); in ext4_split_extent_at()
3332 ext4_ext_show_leaf(inode, path); in ext4_split_extent_at()
3333 return path; in ext4_split_extent_at()
3349 struct ext4_ext_path *path, in ext4_split_extent() argument
3361 ex = path[depth].p_ext; in ext4_split_extent()
3374 path = ext4_split_extent_at(handle, inode, path, in ext4_split_extent()
3376 if (IS_ERR(path)) in ext4_split_extent()
3377 return path; in ext4_split_extent()
3382 path = ext4_find_extent(inode, map->m_lblk, path, flags); in ext4_split_extent()
3383 if (IS_ERR(path)) in ext4_split_extent()
3384 return path; in ext4_split_extent()
3386 ex = path[depth].p_ext; in ext4_split_extent()
3390 ext4_free_ext_path(path); in ext4_split_extent()
3403 path = ext4_split_extent_at(handle, inode, path, in ext4_split_extent()
3405 if (IS_ERR(path)) in ext4_split_extent()
3406 return path; in ext4_split_extent()
3415 ext4_ext_show_leaf(inode, path); in ext4_split_extent()
3416 return path; in ext4_split_extent()
3441 struct ext4_map_blocks *map, struct ext4_ext_path *path, in ext4_ext_convert_to_initialized() argument
3465 eh = path[depth].p_hdr; in ext4_ext_convert_to_initialized()
3466 ex = path[depth].p_ext; in ext4_ext_convert_to_initialized()
3521 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3567 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3589 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3592 path[depth].p_ext = abut_ex; in ext4_ext_convert_to_initialized()
3661 path = ext4_split_extent(handle, inode, path, &split_map, split_flag, in ext4_ext_convert_to_initialized()
3663 if (IS_ERR(path)) in ext4_ext_convert_to_initialized()
3664 return path; in ext4_ext_convert_to_initialized()
3669 return path; in ext4_ext_convert_to_initialized()
3672 ext4_free_ext_path(path); in ext4_ext_convert_to_initialized()
3705 struct ext4_ext_path *path, in ext4_split_convert_extents() argument
3726 ex = path[depth].p_ext; in ext4_split_convert_extents()
3740 return ext4_split_extent(handle, inode, path, map, split_flag, flags, in ext4_split_convert_extents()
3747 struct ext4_ext_path *path) in ext4_convert_unwritten_extents_endio() argument
3756 ex = path[depth].p_ext; in ext4_convert_unwritten_extents_endio()
3776 path = ext4_split_convert_extents(handle, inode, map, path, in ext4_convert_unwritten_extents_endio()
3778 if (IS_ERR(path)) in ext4_convert_unwritten_extents_endio()
3779 return path; in ext4_convert_unwritten_extents_endio()
3781 path = ext4_find_extent(inode, map->m_lblk, path, 0); in ext4_convert_unwritten_extents_endio()
3782 if (IS_ERR(path)) in ext4_convert_unwritten_extents_endio()
3783 return path; in ext4_convert_unwritten_extents_endio()
3785 ex = path[depth].p_ext; in ext4_convert_unwritten_extents_endio()
3788 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_convert_unwritten_extents_endio()
3797 ext4_ext_try_to_merge(handle, inode, path, ex); in ext4_convert_unwritten_extents_endio()
3800 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_convert_unwritten_extents_endio()
3804 ext4_ext_show_leaf(inode, path); in ext4_convert_unwritten_extents_endio()
3805 return path; in ext4_convert_unwritten_extents_endio()
3808 ext4_free_ext_path(path); in ext4_convert_unwritten_extents_endio()
3815 struct ext4_ext_path *path, in convert_initialized_extent() argument
3832 ex = path[depth].p_ext; in convert_initialized_extent()
3840 path = ext4_split_convert_extents(handle, inode, map, path, in convert_initialized_extent()
3842 if (IS_ERR(path)) in convert_initialized_extent()
3843 return path; in convert_initialized_extent()
3845 path = ext4_find_extent(inode, map->m_lblk, path, 0); in convert_initialized_extent()
3846 if (IS_ERR(path)) in convert_initialized_extent()
3847 return path; in convert_initialized_extent()
3849 ex = path[depth].p_ext; in convert_initialized_extent()
3858 err = ext4_ext_get_access(handle, inode, path + depth); in convert_initialized_extent()
3867 ext4_ext_try_to_merge(handle, inode, path, ex); in convert_initialized_extent()
3870 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in convert_initialized_extent()
3873 ext4_ext_show_leaf(inode, path); in convert_initialized_extent()
3881 return path; in convert_initialized_extent()
3884 ext4_free_ext_path(path); in convert_initialized_extent()
3891 struct ext4_ext_path *path, int flags, in ext4_ext_handle_unwritten_extents() argument
3899 ext4_ext_show_leaf(inode, path); in ext4_ext_handle_unwritten_extents()
3912 path = ext4_split_convert_extents(handle, inode, map, path, in ext4_ext_handle_unwritten_extents()
3914 if (IS_ERR(path)) in ext4_ext_handle_unwritten_extents()
3915 return path; in ext4_ext_handle_unwritten_extents()
3932 path = ext4_convert_unwritten_extents_endio(handle, inode, in ext4_ext_handle_unwritten_extents()
3933 map, path); in ext4_ext_handle_unwritten_extents()
3934 if (IS_ERR(path)) in ext4_ext_handle_unwritten_extents()
3935 return path; in ext4_ext_handle_unwritten_extents()
3967 path = ext4_ext_convert_to_initialized(handle, inode, map, path, in ext4_ext_handle_unwritten_extents()
3969 if (IS_ERR(path)) in ext4_ext_handle_unwritten_extents()
3970 return path; in ext4_ext_handle_unwritten_extents()
3992 ext4_ext_show_leaf(inode, path); in ext4_ext_handle_unwritten_extents()
3993 return path; in ext4_ext_handle_unwritten_extents()
3996 ext4_free_ext_path(path); in ext4_ext_handle_unwritten_extents()
4044 struct ext4_ext_path *path) in get_implied_cluster_alloc() argument
4090 ext4_lblk_t next = ext4_ext_next_allocated_block(path); in get_implied_cluster_alloc()
4110 struct ext4_ext_path *path, in ext4_ext_determine_insert_hole() argument
4117 len = ext4_ext_find_hole(inode, path, &hole_start); in ext4_ext_determine_insert_hole()
4191 struct ext4_ext_path *path = NULL; in ext4_ext_map_blocks() local
4205 path = ext4_find_extent(inode, map->m_lblk, NULL, 0); in ext4_ext_map_blocks()
4206 if (IS_ERR(path)) { in ext4_ext_map_blocks()
4207 err = PTR_ERR(path); in ext4_ext_map_blocks()
4218 if (unlikely(path[depth].p_ext == NULL && depth != 0)) { in ext4_ext_map_blocks()
4222 path[depth].p_block); in ext4_ext_map_blocks()
4227 ex = path[depth].p_ext; in ext4_ext_map_blocks()
4256 path = convert_initialized_extent(handle, in ext4_ext_map_blocks()
4257 inode, map, path, &allocated); in ext4_ext_map_blocks()
4258 if (IS_ERR(path)) in ext4_ext_map_blocks()
4259 err = PTR_ERR(path); in ext4_ext_map_blocks()
4267 ext4_ext_show_leaf(inode, path); in ext4_ext_map_blocks()
4271 path = ext4_ext_handle_unwritten_extents( in ext4_ext_map_blocks()
4272 handle, inode, map, path, flags, in ext4_ext_map_blocks()
4274 if (IS_ERR(path)) in ext4_ext_map_blocks()
4275 err = PTR_ERR(path); in ext4_ext_map_blocks()
4287 len = ext4_ext_determine_insert_hole(inode, path, map->m_lblk); in ext4_ext_map_blocks()
4305 get_implied_cluster_alloc(inode->i_sb, map, ex, path)) { in ext4_ext_map_blocks()
4313 err = ext4_ext_search_left(inode, path, &ar.lleft, &ar.pleft); in ext4_ext_map_blocks()
4317 err = ext4_ext_search_right(inode, path, &ar.lright, &ar.pright, &ex2); in ext4_ext_map_blocks()
4324 get_implied_cluster_alloc(inode->i_sb, map, &ex2, path)) { in ext4_ext_map_blocks()
4346 err = ext4_ext_check_overlap(sbi, inode, &newex, path); in ext4_ext_map_blocks()
4354 ar.goal = ext4_ext_find_goal(inode, path, map->m_lblk); in ext4_ext_map_blocks()
4400 path = ext4_ext_insert_extent(handle, inode, path, &newex, flags); in ext4_ext_map_blocks()
4401 if (IS_ERR(path)) { in ext4_ext_map_blocks()
4402 err = PTR_ERR(path); in ext4_ext_map_blocks()
4434 ext4_ext_show_leaf(inode, path); in ext4_ext_map_blocks()
4436 ext4_free_ext_path(path); in ext4_ext_map_blocks()
5085 ext4_ext_shift_path_extents(struct ext4_ext_path *path, ext4_lblk_t shift, in ext4_ext_shift_path_extents() argument
5093 depth = path->p_depth; in ext4_ext_shift_path_extents()
5096 if (depth == path->p_depth) { in ext4_ext_shift_path_extents()
5097 ex_start = path[depth].p_ext; in ext4_ext_shift_path_extents()
5101 ex_last = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_path_extents()
5104 if (ex_start == EXT_FIRST_EXTENT(path[depth].p_hdr)) { in ext4_ext_shift_path_extents()
5119 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5129 EXT_FIRST_EXTENT(path[depth].p_hdr)) in ext4_ext_shift_path_extents()
5132 path, ex_start - 1)) in ext4_ext_shift_path_extents()
5138 ext4_ext_try_to_merge_right(inode, path, in ext4_ext_shift_path_extents()
5143 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5152 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5157 le32_add_cpu(&path[depth].p_idx->ei_block, -shift); in ext4_ext_shift_path_extents()
5159 le32_add_cpu(&path[depth].p_idx->ei_block, shift); in ext4_ext_shift_path_extents()
5160 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5165 if (path[depth].p_idx != EXT_FIRST_INDEX(path[depth].p_hdr)) in ext4_ext_shift_path_extents()
5187 struct ext4_ext_path *path; in ext4_ext_shift_extents() local
5194 path = ext4_find_extent(inode, EXT_MAX_BLOCKS - 1, NULL, in ext4_ext_shift_extents()
5196 if (IS_ERR(path)) in ext4_ext_shift_extents()
5197 return PTR_ERR(path); in ext4_ext_shift_extents()
5199 depth = path->p_depth; in ext4_ext_shift_extents()
5200 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5212 path = ext4_find_extent(inode, start - 1, path, in ext4_ext_shift_extents()
5214 if (IS_ERR(path)) in ext4_ext_shift_extents()
5215 return PTR_ERR(path); in ext4_ext_shift_extents()
5216 depth = path->p_depth; in ext4_ext_shift_extents()
5217 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5261 path = ext4_find_extent(inode, *iterator, path, in ext4_ext_shift_extents()
5263 if (IS_ERR(path)) in ext4_ext_shift_extents()
5264 return PTR_ERR(path); in ext4_ext_shift_extents()
5265 depth = path->p_depth; in ext4_ext_shift_extents()
5266 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5275 if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) { in ext4_ext_shift_extents()
5276 path[depth].p_ext++; in ext4_ext_shift_extents()
5278 *iterator = ext4_ext_next_allocated_block(path); in ext4_ext_shift_extents()
5285 extent = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5289 extent = EXT_FIRST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5295 extent = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5299 if (extent == EXT_LAST_EXTENT(path[depth].p_hdr)) in ext4_ext_shift_extents()
5305 path[depth].p_ext = extent; in ext4_ext_shift_extents()
5307 ret = ext4_ext_shift_path_extents(path, shift, inode, in ext4_ext_shift_extents()
5316 ext4_free_ext_path(path); in ext4_ext_shift_extents()
5469 struct ext4_ext_path *path; in ext4_insert_range() local
5560 path = ext4_find_extent(inode, offset_lblk, NULL, 0); in ext4_insert_range()
5561 if (IS_ERR(path)) { in ext4_insert_range()
5563 ret = PTR_ERR(path); in ext4_insert_range()
5568 extent = path[depth].p_ext; in ext4_insert_range()
5582 path = ext4_split_extent_at(handle, inode, path, in ext4_insert_range()
5589 if (IS_ERR(path)) { in ext4_insert_range()
5591 ret = PTR_ERR(path); in ext4_insert_range()
5596 ext4_free_ext_path(path); in ext4_insert_range()
5830 struct ext4_ext_path *path; in ext4_clu_mapped() local
5845 path = ext4_find_extent(inode, EXT4_C2B(sbi, lclu), NULL, 0); in ext4_clu_mapped()
5846 if (IS_ERR(path)) in ext4_clu_mapped()
5847 return PTR_ERR(path); in ext4_clu_mapped()
5856 if (unlikely(path[depth].p_ext == NULL && depth != 0)) { in ext4_clu_mapped()
5860 depth, path[depth].p_block); in ext4_clu_mapped()
5865 extent = path[depth].p_ext; in ext4_clu_mapped()
5886 first_lblk = ext4_ext_next_allocated_block(path); in ext4_clu_mapped()
5894 ext4_free_ext_path(path); in ext4_clu_mapped()
5909 struct ext4_ext_path *path; in ext4_ext_replay_update_ex() local
5913 path = ext4_find_extent(inode, start, NULL, 0); in ext4_ext_replay_update_ex()
5914 if (IS_ERR(path)) in ext4_ext_replay_update_ex()
5915 return PTR_ERR(path); in ext4_ext_replay_update_ex()
5916 ex = path[path->p_depth].p_ext; in ext4_ext_replay_update_ex()
5926 path = ext4_force_split_extent_at(NULL, inode, path, start, 1); in ext4_ext_replay_update_ex()
5928 if (IS_ERR(path)) { in ext4_ext_replay_update_ex()
5929 ret = PTR_ERR(path); in ext4_ext_replay_update_ex()
5933 path = ext4_find_extent(inode, start, path, 0); in ext4_ext_replay_update_ex()
5934 if (IS_ERR(path)) in ext4_ext_replay_update_ex()
5935 return PTR_ERR(path); in ext4_ext_replay_update_ex()
5937 ex = path[path->p_depth].p_ext; in ext4_ext_replay_update_ex()
5942 path = ext4_force_split_extent_at(NULL, inode, path, in ext4_ext_replay_update_ex()
5945 if (IS_ERR(path)) { in ext4_ext_replay_update_ex()
5946 ret = PTR_ERR(path); in ext4_ext_replay_update_ex()
5950 path = ext4_find_extent(inode, start, path, 0); in ext4_ext_replay_update_ex()
5951 if (IS_ERR(path)) in ext4_ext_replay_update_ex()
5952 return PTR_ERR(path); in ext4_ext_replay_update_ex()
5953 ex = path[path->p_depth].p_ext; in ext4_ext_replay_update_ex()
5962 ret = ext4_ext_dirty(NULL, inode, &path[path->p_depth]); in ext4_ext_replay_update_ex()
5965 ext4_free_ext_path(path); in ext4_ext_replay_update_ex()
5973 struct ext4_ext_path *path = NULL; in ext4_ext_replay_shrink_inode() local
5978 path = ext4_find_extent(inode, cur, NULL, 0); in ext4_ext_replay_shrink_inode()
5979 if (IS_ERR(path)) in ext4_ext_replay_shrink_inode()
5981 ex = path[path->p_depth].p_ext; in ext4_ext_replay_shrink_inode()
5983 ext4_free_ext_path(path); in ext4_ext_replay_shrink_inode()
5991 ext4_ext_try_to_merge(NULL, inode, path, ex); in ext4_ext_replay_shrink_inode()
5993 ext4_ext_dirty(NULL, inode, &path[path->p_depth]); in ext4_ext_replay_shrink_inode()
5996 ext4_free_ext_path(path); in ext4_ext_replay_shrink_inode()
6021 struct ext4_ext_path *path = NULL, *path2 = NULL; in ext4_ext_replay_set_iblocks() local
6029 path = ext4_find_extent(inode, EXT_MAX_BLOCKS - 1, NULL, in ext4_ext_replay_set_iblocks()
6031 if (IS_ERR(path)) in ext4_ext_replay_set_iblocks()
6032 return PTR_ERR(path); in ext4_ext_replay_set_iblocks()
6033 ex = path[path->p_depth].p_ext; in ext4_ext_replay_set_iblocks()
6062 path = ext4_find_extent(inode, cur, path, 0); in ext4_ext_replay_set_iblocks()
6063 if (IS_ERR(path)) in ext4_ext_replay_set_iblocks()
6065 numblks += path->p_depth; in ext4_ext_replay_set_iblocks()
6067 path = ext4_find_extent(inode, cur, path, 0); in ext4_ext_replay_set_iblocks()
6068 if (IS_ERR(path)) in ext4_ext_replay_set_iblocks()
6070 ex = path[path->p_depth].p_ext; in ext4_ext_replay_set_iblocks()
6084 for (i = 0; i <= max(path->p_depth, path2->p_depth); i++) { in ext4_ext_replay_set_iblocks()
6086 if (i <= path->p_depth) in ext4_ext_replay_set_iblocks()
6087 cmp1 = path[i].p_bh ? in ext4_ext_replay_set_iblocks()
6088 path[i].p_bh->b_blocknr : 0; in ext4_ext_replay_set_iblocks()
6101 ext4_free_ext_path(path); in ext4_ext_replay_set_iblocks()
6108 struct ext4_ext_path *path = NULL; in ext4_ext_clear_bb() local
6118 path = ext4_find_extent(inode, EXT_MAX_BLOCKS - 1, NULL, in ext4_ext_clear_bb()
6120 if (IS_ERR(path)) in ext4_ext_clear_bb()
6121 return PTR_ERR(path); in ext4_ext_clear_bb()
6122 ex = path[path->p_depth].p_ext; in ext4_ext_clear_bb()
6135 path = ext4_find_extent(inode, map.m_lblk, path, 0); in ext4_ext_clear_bb()
6136 if (!IS_ERR(path)) { in ext4_ext_clear_bb()
6137 for (j = 0; j < path->p_depth; j++) { in ext4_ext_clear_bb()
6139 path[j].p_block, 1, false); in ext4_ext_clear_bb()
6141 0, path[j].p_block, 1, 1); in ext4_ext_clear_bb()
6144 path = NULL; in ext4_ext_clear_bb()
6154 ext4_free_ext_path(path); in ext4_ext_clear_bb()