Lines Matching full:path

137 				struct ext4_ext_path *path)  in ext4_ext_get_access()  argument
139 if (path->p_bh) { in ext4_ext_get_access()
140 /* path points to block */ in ext4_ext_get_access()
141 BUFFER_TRACE(path->p_bh, "get_write_access"); in ext4_ext_get_access()
143 path->p_bh, EXT4_JTR_NONE); in ext4_ext_get_access()
145 /* path points to leaf/index in inode body */ in ext4_ext_get_access()
158 struct ext4_ext_path *path) in __ext4_ext_dirty() argument
163 if (path->p_bh) { in __ext4_ext_dirty()
164 ext4_extent_block_csum_set(inode, ext_block_hdr(path->p_bh)); in __ext4_ext_dirty()
165 /* path points to block */ in __ext4_ext_dirty()
167 inode, path->p_bh); in __ext4_ext_dirty()
169 /* path points to leaf/index in inode body */ in __ext4_ext_dirty()
175 #define ext4_ext_dirty(handle, inode, path) \ argument
176 __ext4_ext_dirty(__func__, __LINE__, (handle), (inode), (path))
179 struct ext4_ext_path *path, in ext4_ext_find_goal() argument
182 if (path) { in ext4_ext_find_goal()
183 int depth = path->p_depth; in ext4_ext_find_goal()
203 ex = path[depth].p_ext; in ext4_ext_find_goal()
216 if (path[depth].p_bh) in ext4_ext_find_goal()
217 return path[depth].p_bh->b_blocknr; in ext4_ext_find_goal()
229 struct ext4_ext_path *path, in ext4_ext_new_meta_block() argument
234 goal = ext4_ext_find_goal(inode, path, le32_to_cpu(ex->ee_block)); in ext4_ext_new_meta_block()
299 struct ext4_ext_path *path = *ppath; in ext4_force_split_extent_at() local
300 int unwritten = ext4_ext_is_unwritten(path[path->p_depth].p_ext); in ext4_force_split_extent_at()
541 struct ext4_ext_path *path = NULL; in ext4_ext_precache() local
557 path = kcalloc(depth + 1, sizeof(struct ext4_ext_path), in ext4_ext_precache()
559 if (path == NULL) { in ext4_ext_precache()
564 path[0].p_hdr = ext_inode_hdr(inode); in ext4_ext_precache()
565 ret = ext4_ext_check(inode, path[0].p_hdr, depth, 0); in ext4_ext_precache()
568 path[0].p_idx = EXT_FIRST_INDEX(path[0].p_hdr); in ext4_ext_precache()
575 path[i].p_idx > EXT_LAST_INDEX(path[i].p_hdr)) { in ext4_ext_precache()
576 brelse(path[i].p_bh); in ext4_ext_precache()
577 path[i].p_bh = NULL; in ext4_ext_precache()
582 ext4_idx_pblock(path[i].p_idx++), in ext4_ext_precache()
590 path[i].p_bh = bh; in ext4_ext_precache()
591 path[i].p_hdr = ext_block_hdr(bh); in ext4_ext_precache()
592 path[i].p_idx = EXT_FIRST_INDEX(path[i].p_hdr); in ext4_ext_precache()
597 ext4_ext_drop_refs(path); in ext4_ext_precache()
598 kfree(path); in ext4_ext_precache()
603 static void ext4_ext_show_path(struct inode *inode, struct ext4_ext_path *path) in ext4_ext_show_path() argument
605 int k, l = path->p_depth; in ext4_ext_show_path()
607 ext_debug(inode, "path:"); in ext4_ext_show_path()
608 for (k = 0; k <= l; k++, path++) { in ext4_ext_show_path()
609 if (path->p_idx) { in ext4_ext_show_path()
611 le32_to_cpu(path->p_idx->ei_block), in ext4_ext_show_path()
612 ext4_idx_pblock(path->p_idx)); in ext4_ext_show_path()
613 } else if (path->p_ext) { in ext4_ext_show_path()
615 le32_to_cpu(path->p_ext->ee_block), in ext4_ext_show_path()
616 ext4_ext_is_unwritten(path->p_ext), in ext4_ext_show_path()
617 ext4_ext_get_actual_len(path->p_ext), in ext4_ext_show_path()
618 ext4_ext_pblock(path->p_ext)); in ext4_ext_show_path()
625 static void ext4_ext_show_leaf(struct inode *inode, struct ext4_ext_path *path) in ext4_ext_show_leaf() argument
632 if (!path) in ext4_ext_show_leaf()
635 eh = path[depth].p_hdr; in ext4_ext_show_leaf()
648 static void ext4_ext_show_move(struct inode *inode, struct ext4_ext_path *path, in ext4_ext_show_move() argument
656 idx = path[level].p_idx; in ext4_ext_show_move()
657 while (idx <= EXT_MAX_INDEX(path[level].p_hdr)) { in ext4_ext_show_move()
667 ex = path[depth].p_ext; in ext4_ext_show_move()
668 while (ex <= EXT_MAX_EXTENT(path[depth].p_hdr)) { in ext4_ext_show_move()
680 #define ext4_ext_show_path(inode, path) argument
681 #define ext4_ext_show_leaf(inode, path) argument
682 #define ext4_ext_show_move(inode, path, newblock, level) argument
685 void ext4_ext_drop_refs(struct ext4_ext_path *path) in ext4_ext_drop_refs() argument
689 if (!path) in ext4_ext_drop_refs()
691 depth = path->p_depth; in ext4_ext_drop_refs()
692 for (i = 0; i <= depth; i++, path++) { in ext4_ext_drop_refs()
693 brelse(path->p_bh); in ext4_ext_drop_refs()
694 path->p_bh = NULL; in ext4_ext_drop_refs()
705 struct ext4_ext_path *path, ext4_lblk_t block) in ext4_ext_binsearch_idx() argument
707 struct ext4_extent_header *eh = path->p_hdr; in ext4_ext_binsearch_idx()
726 path->p_idx = l - 1; in ext4_ext_binsearch_idx()
727 ext_debug(inode, " -> %u->%lld ", le32_to_cpu(path->p_idx->ei_block), in ext4_ext_binsearch_idx()
728 ext4_idx_pblock(path->p_idx)); in ext4_ext_binsearch_idx()
752 BUG_ON(chix != path->p_idx); in ext4_ext_binsearch_idx()
765 struct ext4_ext_path *path, ext4_lblk_t block) in ext4_ext_binsearch() argument
767 struct ext4_extent_header *eh = path->p_hdr; in ext4_ext_binsearch()
794 path->p_ext = l - 1; in ext4_ext_binsearch()
796 le32_to_cpu(path->p_ext->ee_block), in ext4_ext_binsearch()
797 ext4_ext_pblock(path->p_ext), in ext4_ext_binsearch()
798 ext4_ext_is_unwritten(path->p_ext), in ext4_ext_binsearch()
799 ext4_ext_get_actual_len(path->p_ext)); in ext4_ext_binsearch()
814 BUG_ON(chex != path->p_ext); in ext4_ext_binsearch()
839 struct ext4_ext_path *path = orig_path ? *orig_path : NULL; in ext4_find_extent() local
856 if (path) { in ext4_find_extent()
857 ext4_ext_drop_refs(path); in ext4_find_extent()
858 if (depth > path[0].p_maxdepth) { in ext4_find_extent()
859 kfree(path); in ext4_find_extent()
860 *orig_path = path = NULL; in ext4_find_extent()
863 if (!path) { in ext4_find_extent()
865 path = kcalloc(depth + 2, sizeof(struct ext4_ext_path), in ext4_find_extent()
867 if (unlikely(!path)) in ext4_find_extent()
869 path[0].p_maxdepth = depth + 1; in ext4_find_extent()
871 path[0].p_hdr = eh; in ext4_find_extent()
872 path[0].p_bh = NULL; in ext4_find_extent()
882 ext4_ext_binsearch_idx(inode, path + ppos, block); in ext4_find_extent()
883 path[ppos].p_block = ext4_idx_pblock(path[ppos].p_idx); in ext4_find_extent()
884 path[ppos].p_depth = i; in ext4_find_extent()
885 path[ppos].p_ext = NULL; in ext4_find_extent()
887 bh = read_extent_tree_block(inode, path[ppos].p_block, --i, in ext4_find_extent()
896 path[ppos].p_bh = bh; in ext4_find_extent()
897 path[ppos].p_hdr = eh; in ext4_find_extent()
900 path[ppos].p_depth = i; in ext4_find_extent()
901 path[ppos].p_ext = NULL; in ext4_find_extent()
902 path[ppos].p_idx = NULL; in ext4_find_extent()
905 ext4_ext_binsearch(inode, path + ppos, block); in ext4_find_extent()
907 if (path[ppos].p_ext) in ext4_find_extent()
908 path[ppos].p_block = ext4_ext_pblock(path[ppos].p_ext); in ext4_find_extent()
910 ext4_ext_show_path(inode, path); in ext4_find_extent()
912 return path; in ext4_find_extent()
915 ext4_ext_drop_refs(path); in ext4_find_extent()
916 kfree(path); in ext4_find_extent()
997 * inserts new subtree into the path, using free index entry
1007 struct ext4_ext_path *path, in ext4_ext_split() argument
1030 if (unlikely(path[depth].p_ext > EXT_MAX_EXTENT(path[depth].p_hdr))) { in ext4_ext_split()
1034 if (path[depth].p_ext != EXT_MAX_EXTENT(path[depth].p_hdr)) { in ext4_ext_split()
1035 border = path[depth].p_ext[1].ee_block; in ext4_ext_split()
1065 newblock = ext4_ext_new_meta_block(handle, inode, path, in ext4_ext_split()
1098 /* move remainder of path[depth] to the new leaf */ in ext4_ext_split()
1099 if (unlikely(path[depth].p_hdr->eh_entries != in ext4_ext_split()
1100 path[depth].p_hdr->eh_max)) { in ext4_ext_split()
1102 path[depth].p_hdr->eh_entries, in ext4_ext_split()
1103 path[depth].p_hdr->eh_max); in ext4_ext_split()
1108 m = EXT_MAX_EXTENT(path[depth].p_hdr) - path[depth].p_ext++; in ext4_ext_split()
1109 ext4_ext_show_move(inode, path, newblock, depth); in ext4_ext_split()
1113 memmove(ex, path[depth].p_ext, sizeof(struct ext4_extent) * m); in ext4_ext_split()
1133 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_split()
1136 le16_add_cpu(&path[depth].p_hdr->eh_entries, -m); in ext4_ext_split()
1137 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_split()
1183 /* move remainder of path[i] to the new index block */ in ext4_ext_split()
1184 if (unlikely(EXT_MAX_INDEX(path[i].p_hdr) != in ext4_ext_split()
1185 EXT_LAST_INDEX(path[i].p_hdr))) { in ext4_ext_split()
1188 le32_to_cpu(path[i].p_ext->ee_block)); in ext4_ext_split()
1193 m = EXT_MAX_INDEX(path[i].p_hdr) - path[i].p_idx++; in ext4_ext_split()
1194 ext_debug(inode, "cur 0x%p, last 0x%p\n", path[i].p_idx, in ext4_ext_split()
1195 EXT_MAX_INDEX(path[i].p_hdr)); in ext4_ext_split()
1196 ext4_ext_show_move(inode, path, newblock, i); in ext4_ext_split()
1198 memmove(++fidx, path[i].p_idx, in ext4_ext_split()
1219 err = ext4_ext_get_access(handle, inode, path + i); in ext4_ext_split()
1222 le16_add_cpu(&path[i].p_hdr->eh_entries, -m); in ext4_ext_split()
1223 err = ext4_ext_dirty(handle, inode, path + i); in ext4_ext_split()
1232 err = ext4_ext_insert_index(handle, inode, path + at, in ext4_ext_split()
1357 struct ext4_ext_path *path = *ppath; in ext4_ext_create_new_leaf() local
1365 curp = path + depth; in ext4_ext_create_new_leaf()
1376 err = ext4_ext_split(handle, inode, mb_flags, path, newext, i); in ext4_ext_create_new_leaf()
1380 /* refill path */ in ext4_ext_create_new_leaf()
1381 path = ext4_find_extent(inode, in ext4_ext_create_new_leaf()
1384 if (IS_ERR(path)) in ext4_ext_create_new_leaf()
1385 err = PTR_ERR(path); in ext4_ext_create_new_leaf()
1392 /* refill path */ in ext4_ext_create_new_leaf()
1393 path = ext4_find_extent(inode, in ext4_ext_create_new_leaf()
1396 if (IS_ERR(path)) { in ext4_ext_create_new_leaf()
1397 err = PTR_ERR(path); in ext4_ext_create_new_leaf()
1406 if (path[depth].p_hdr->eh_entries == path[depth].p_hdr->eh_max) { in ext4_ext_create_new_leaf()
1424 struct ext4_ext_path *path, in ext4_ext_search_left() argument
1431 if (unlikely(path == NULL)) { in ext4_ext_search_left()
1432 EXT4_ERROR_INODE(inode, "path == NULL *logical %d!", *logical); in ext4_ext_search_left()
1435 depth = path->p_depth; in ext4_ext_search_left()
1438 if (depth == 0 && path->p_ext == NULL) in ext4_ext_search_left()
1441 /* usually extent in the path covers blocks smaller in ext4_ext_search_left()
1445 ex = path[depth].p_ext; in ext4_ext_search_left()
1448 if (unlikely(EXT_FIRST_EXTENT(path[depth].p_hdr) != ex)) { in ext4_ext_search_left()
1455 ix = path[depth].p_idx; in ext4_ext_search_left()
1456 if (unlikely(ix != EXT_FIRST_INDEX(path[depth].p_hdr))) { in ext4_ext_search_left()
1460 EXT_FIRST_INDEX(path[depth].p_hdr) != NULL ? in ext4_ext_search_left()
1461 le32_to_cpu(EXT_FIRST_INDEX(path[depth].p_hdr)->ei_block) : 0, in ext4_ext_search_left()
1489 struct ext4_ext_path *path, in ext4_ext_search_right() argument
1501 if (unlikely(path == NULL)) { in ext4_ext_search_right()
1502 EXT4_ERROR_INODE(inode, "path == NULL *logical %d!", *logical); in ext4_ext_search_right()
1505 depth = path->p_depth; in ext4_ext_search_right()
1508 if (depth == 0 && path->p_ext == NULL) in ext4_ext_search_right()
1511 /* usually extent in the path covers blocks smaller in ext4_ext_search_right()
1515 ex = path[depth].p_ext; in ext4_ext_search_right()
1518 if (unlikely(EXT_FIRST_EXTENT(path[depth].p_hdr) != ex)) { in ext4_ext_search_right()
1520 "first_extent(path[%d].p_hdr) != ex", in ext4_ext_search_right()
1525 ix = path[depth].p_idx; in ext4_ext_search_right()
1526 if (unlikely(ix != EXT_FIRST_INDEX(path[depth].p_hdr))) { in ext4_ext_search_right()
1543 if (ex != EXT_LAST_EXTENT(path[depth].p_hdr)) { in ext4_ext_search_right()
1551 ix = path[depth].p_idx; in ext4_ext_search_right()
1552 if (ix != EXT_LAST_INDEX(path[depth].p_hdr)) in ext4_ext_search_right()
1565 while (++depth < path->p_depth) { in ext4_ext_search_right()
1568 path->p_depth - depth, 0); in ext4_ext_search_right()
1577 bh = read_extent_tree_block(inode, block, path->p_depth - depth, 0); in ext4_ext_search_right()
1600 ext4_ext_next_allocated_block(struct ext4_ext_path *path) in ext4_ext_next_allocated_block() argument
1604 BUG_ON(path == NULL); in ext4_ext_next_allocated_block()
1605 depth = path->p_depth; in ext4_ext_next_allocated_block()
1607 if (depth == 0 && path->p_ext == NULL) in ext4_ext_next_allocated_block()
1611 struct ext4_ext_path *p = &path[depth]; in ext4_ext_next_allocated_block()
1613 if (depth == path->p_depth) { in ext4_ext_next_allocated_block()
1632 static ext4_lblk_t ext4_ext_next_leaf_block(struct ext4_ext_path *path) in ext4_ext_next_leaf_block() argument
1636 BUG_ON(path == NULL); in ext4_ext_next_leaf_block()
1637 depth = path->p_depth; in ext4_ext_next_leaf_block()
1647 if (path[depth].p_idx != in ext4_ext_next_leaf_block()
1648 EXT_LAST_INDEX(path[depth].p_hdr)) in ext4_ext_next_leaf_block()
1650 le32_to_cpu(path[depth].p_idx[1].ei_block); in ext4_ext_next_leaf_block()
1664 struct ext4_ext_path *path) in ext4_ext_correct_indexes() argument
1672 eh = path[depth].p_hdr; in ext4_ext_correct_indexes()
1673 ex = path[depth].p_ext; in ext4_ext_correct_indexes()
1695 border = path[depth].p_ext->ee_block; in ext4_ext_correct_indexes()
1696 err = ext4_ext_get_access(handle, inode, path + k); in ext4_ext_correct_indexes()
1699 path[k].p_idx->ei_block = border; in ext4_ext_correct_indexes()
1700 err = ext4_ext_dirty(handle, inode, path + k); in ext4_ext_correct_indexes()
1706 if (path[k+1].p_idx != EXT_FIRST_INDEX(path[k+1].p_hdr)) in ext4_ext_correct_indexes()
1708 err = ext4_ext_get_access(handle, inode, path + k); in ext4_ext_correct_indexes()
1711 path[k].p_idx->ei_block = border; in ext4_ext_correct_indexes()
1712 err = ext4_ext_dirty(handle, inode, path + k); in ext4_ext_correct_indexes()
1760 struct ext4_ext_path *path, in ext4_ext_try_to_merge_right() argument
1768 BUG_ON(path[depth].p_hdr == NULL); in ext4_ext_try_to_merge_right()
1769 eh = path[depth].p_hdr; in ext4_ext_try_to_merge_right()
1802 struct ext4_ext_path *path) in ext4_ext_try_to_merge_up() argument
1808 if ((path[0].p_depth != 1) || in ext4_ext_try_to_merge_up()
1809 (le16_to_cpu(path[0].p_hdr->eh_entries) != 1) || in ext4_ext_try_to_merge_up()
1810 (le16_to_cpu(path[1].p_hdr->eh_entries) > max_root)) in ext4_ext_try_to_merge_up()
1825 blk = ext4_idx_pblock(path[0].p_idx); in ext4_ext_try_to_merge_up()
1826 s = le16_to_cpu(path[1].p_hdr->eh_entries) * in ext4_ext_try_to_merge_up()
1830 path[1].p_maxdepth = path[0].p_maxdepth; in ext4_ext_try_to_merge_up()
1831 memcpy(path[0].p_hdr, path[1].p_hdr, s); in ext4_ext_try_to_merge_up()
1832 path[0].p_depth = 0; in ext4_ext_try_to_merge_up()
1833 path[0].p_ext = EXT_FIRST_EXTENT(path[0].p_hdr) + in ext4_ext_try_to_merge_up()
1834 (path[1].p_ext - EXT_FIRST_EXTENT(path[1].p_hdr)); in ext4_ext_try_to_merge_up()
1835 path[0].p_hdr->eh_max = cpu_to_le16(max_root); in ext4_ext_try_to_merge_up()
1837 brelse(path[1].p_bh); in ext4_ext_try_to_merge_up()
1848 struct ext4_ext_path *path, in ext4_ext_try_to_merge() argument
1856 BUG_ON(path[depth].p_hdr == NULL); in ext4_ext_try_to_merge()
1857 eh = path[depth].p_hdr; in ext4_ext_try_to_merge()
1860 merge_done = ext4_ext_try_to_merge_right(inode, path, ex - 1); in ext4_ext_try_to_merge()
1863 (void) ext4_ext_try_to_merge_right(inode, path, ex); in ext4_ext_try_to_merge()
1865 ext4_ext_try_to_merge_up(handle, inode, path); in ext4_ext_try_to_merge()
1879 struct ext4_ext_path *path) in ext4_ext_check_overlap() argument
1888 if (!path[depth].p_ext) in ext4_ext_check_overlap()
1890 b2 = EXT4_LBLK_CMASK(sbi, le32_to_cpu(path[depth].p_ext->ee_block)); in ext4_ext_check_overlap()
1893 * get the next allocated block if the extent in the path in ext4_ext_check_overlap()
1897 b2 = ext4_ext_next_allocated_block(path); in ext4_ext_check_overlap()
1929 struct ext4_ext_path *path = *ppath; in ext4_ext_insert_extent() local
1945 ex = path[depth].p_ext; in ext4_ext_insert_extent()
1946 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
1947 if (unlikely(path[depth].p_hdr == NULL)) { in ext4_ext_insert_extent()
1948 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth); in ext4_ext_insert_extent()
1985 path + depth); in ext4_ext_insert_extent()
1993 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2011 path + depth); in ext4_ext_insert_extent()
2022 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2029 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2037 next = ext4_ext_next_leaf_block(path); in ext4_ext_insert_extent()
2044 BUG_ON(npath->p_depth != path->p_depth); in ext4_ext_insert_extent()
2049 path = npath; in ext4_ext_insert_extent()
2067 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2070 nearex = path[depth].p_ext; in ext4_ext_insert_extent()
2072 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_insert_extent()
2122 path[depth].p_ext = nearex; in ext4_ext_insert_extent()
2130 ext4_ext_try_to_merge(handle, inode, path, nearex); in ext4_ext_insert_extent()
2134 err = ext4_ext_correct_indexes(handle, inode, path); in ext4_ext_insert_extent()
2138 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_ext_insert_extent()
2195 * @path: path in extent tree to @lblk
2199 * block. We don't try too hard to find the beginning of the hole but @path
2206 struct ext4_ext_path *path, in ext4_ext_determine_hole() argument
2213 ex = path[depth].p_ext; in ext4_ext_determine_hole()
2225 next = ext4_ext_next_allocated_block(path); in ext4_ext_determine_hole()
2263 struct ext4_ext_path *path, int depth) in ext4_ext_rm_idx() argument
2270 path = path + depth; in ext4_ext_rm_idx()
2271 leaf = ext4_idx_pblock(path->p_idx); in ext4_ext_rm_idx()
2272 if (unlikely(path->p_hdr->eh_entries == 0)) { in ext4_ext_rm_idx()
2273 EXT4_ERROR_INODE(inode, "path->p_hdr->eh_entries == 0"); in ext4_ext_rm_idx()
2276 err = ext4_ext_get_access(handle, inode, path); in ext4_ext_rm_idx()
2280 if (path->p_idx != EXT_LAST_INDEX(path->p_hdr)) { in ext4_ext_rm_idx()
2281 int len = EXT_LAST_INDEX(path->p_hdr) - path->p_idx; in ext4_ext_rm_idx()
2283 memmove(path->p_idx, path->p_idx + 1, len); in ext4_ext_rm_idx()
2286 le16_add_cpu(&path->p_hdr->eh_entries, -1); in ext4_ext_rm_idx()
2287 err = ext4_ext_dirty(handle, inode, path); in ext4_ext_rm_idx()
2297 if (path->p_idx != EXT_FIRST_INDEX(path->p_hdr)) in ext4_ext_rm_idx()
2299 path--; in ext4_ext_rm_idx()
2300 err = ext4_ext_get_access(handle, inode, path); in ext4_ext_rm_idx()
2303 path->p_idx->ei_block = (path+1)->p_idx->ei_block; in ext4_ext_rm_idx()
2304 err = ext4_ext_dirty(handle, inode, path); in ext4_ext_rm_idx()
2315 * When pass the actual path, the caller should calculate credits
2319 struct ext4_ext_path *path) in ext4_ext_calc_credits_for_single_extent() argument
2321 if (path) { in ext4_ext_calc_credits_for_single_extent()
2326 if (le16_to_cpu(path[depth].p_hdr->eh_entries) in ext4_ext_calc_credits_for_single_extent()
2327 < le16_to_cpu(path[depth].p_hdr->eh_max)) { in ext4_ext_calc_credits_for_single_extent()
2542 * @path: The path to the leaf
2552 struct ext4_ext_path *path, in ext4_ext_rm_leaf() argument
2570 if (!path[depth].p_hdr) in ext4_ext_rm_leaf()
2571 path[depth].p_hdr = ext_block_hdr(path[depth].p_bh); in ext4_ext_rm_leaf()
2572 eh = path[depth].p_hdr; in ext4_ext_rm_leaf()
2573 if (unlikely(path[depth].p_hdr == NULL)) { in ext4_ext_rm_leaf()
2574 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth); in ext4_ext_rm_leaf()
2578 ex = path[depth].p_ext; in ext4_ext_rm_leaf()
2597 path[depth].p_ext = ex; in ext4_ext_rm_leaf()
2668 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_rm_leaf()
2708 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_rm_leaf()
2720 err = ext4_ext_correct_indexes(handle, inode, path); in ext4_ext_rm_leaf()
2747 if (err == 0 && eh->eh_entries == 0 && path[depth].p_bh != NULL) in ext4_ext_rm_leaf()
2748 err = ext4_ext_rm_idx(handle, inode, path, depth); in ext4_ext_rm_leaf()
2759 ext4_ext_more_to_rm(struct ext4_ext_path *path) in ext4_ext_more_to_rm() argument
2761 BUG_ON(path->p_idx == NULL); in ext4_ext_more_to_rm()
2763 if (path->p_idx < EXT_FIRST_INDEX(path->p_hdr)) in ext4_ext_more_to_rm()
2770 if (le16_to_cpu(path->p_hdr->eh_entries) == path->p_block) in ext4_ext_more_to_rm()
2780 struct ext4_ext_path *path = NULL; in ext4_ext_remove_space() local
2814 path = ext4_find_extent(inode, end, NULL, in ext4_ext_remove_space()
2816 if (IS_ERR(path)) { in ext4_ext_remove_space()
2818 return PTR_ERR(path); in ext4_ext_remove_space()
2822 ex = path[depth].p_ext; in ext4_ext_remove_space()
2826 "path[%d].p_hdr == NULL", in ext4_ext_remove_space()
2861 err = ext4_force_split_extent_at(handle, inode, &path, in ext4_ext_remove_space()
2879 err = ext4_ext_search_right(inode, path, &lblk, &pblk, in ext4_ext_remove_space()
2894 if (path) { in ext4_ext_remove_space()
2897 path[k].p_block = in ext4_ext_remove_space()
2898 le16_to_cpu(path[k].p_hdr->eh_entries)+1; in ext4_ext_remove_space()
2900 path = kcalloc(depth + 1, sizeof(struct ext4_ext_path), in ext4_ext_remove_space()
2902 if (path == NULL) { in ext4_ext_remove_space()
2906 path[0].p_maxdepth = path[0].p_depth = depth; in ext4_ext_remove_space()
2907 path[0].p_hdr = ext_inode_hdr(inode); in ext4_ext_remove_space()
2910 if (ext4_ext_check(inode, path[0].p_hdr, depth, 0)) { in ext4_ext_remove_space()
2920 err = ext4_ext_rm_leaf(handle, inode, path, in ext4_ext_remove_space()
2923 brelse(path[i].p_bh); in ext4_ext_remove_space()
2924 path[i].p_bh = NULL; in ext4_ext_remove_space()
2930 if (!path[i].p_hdr) { in ext4_ext_remove_space()
2932 path[i].p_hdr = ext_block_hdr(path[i].p_bh); in ext4_ext_remove_space()
2935 if (!path[i].p_idx) { in ext4_ext_remove_space()
2937 path[i].p_idx = EXT_LAST_INDEX(path[i].p_hdr); in ext4_ext_remove_space()
2938 path[i].p_block = le16_to_cpu(path[i].p_hdr->eh_entries)+1; in ext4_ext_remove_space()
2940 path[i].p_hdr, in ext4_ext_remove_space()
2941 le16_to_cpu(path[i].p_hdr->eh_entries)); in ext4_ext_remove_space()
2944 path[i].p_idx--; in ext4_ext_remove_space()
2948 i, EXT_FIRST_INDEX(path[i].p_hdr), in ext4_ext_remove_space()
2949 path[i].p_idx); in ext4_ext_remove_space()
2950 if (ext4_ext_more_to_rm(path + i)) { in ext4_ext_remove_space()
2954 i + 1, ext4_idx_pblock(path[i].p_idx)); in ext4_ext_remove_space()
2955 memset(path + i + 1, 0, sizeof(*path)); in ext4_ext_remove_space()
2957 ext4_idx_pblock(path[i].p_idx), depth - i - 1, in ext4_ext_remove_space()
2971 path[i + 1].p_bh = bh; in ext4_ext_remove_space()
2975 path[i].p_block = le16_to_cpu(path[i].p_hdr->eh_entries); in ext4_ext_remove_space()
2979 if (path[i].p_hdr->eh_entries == 0 && i > 0) { in ext4_ext_remove_space()
2983 err = ext4_ext_rm_idx(handle, inode, path, i); in ext4_ext_remove_space()
2986 brelse(path[i].p_bh); in ext4_ext_remove_space()
2987 path[i].p_bh = NULL; in ext4_ext_remove_space()
2994 path->p_hdr->eh_entries); in ext4_ext_remove_space()
3014 if (path->p_hdr->eh_entries == 0) { in ext4_ext_remove_space()
3019 err = ext4_ext_get_access(handle, inode, path); in ext4_ext_remove_space()
3024 err = ext4_ext_dirty(handle, inode, path); in ext4_ext_remove_space()
3028 ext4_ext_drop_refs(path); in ext4_ext_remove_space()
3029 kfree(path); in ext4_ext_remove_space()
3030 path = NULL; in ext4_ext_remove_space()
3123 * @path: the path to the extent
3146 struct ext4_ext_path *path = *ppath; in ext4_split_extent_at() local
3159 ext4_ext_show_leaf(inode, path); in ext4_split_extent_at()
3162 ex = path[depth].p_ext; in ext4_split_extent_at()
3173 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_split_extent_at()
3189 ext4_ext_try_to_merge(handle, inode, path, ex); in ext4_split_extent_at()
3191 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_split_extent_at()
3202 * path may lead to new leaf, not to original leaf any more in ext4_split_extent_at()
3205 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_split_extent_at()
3249 ext4_ext_try_to_merge(handle, inode, path, ex); in ext4_split_extent_at()
3250 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_split_extent_at()
3266 * Ignore ext4_ext_dirty return value since we are already in error path in ext4_split_extent_at()
3269 ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_split_extent_at()
3272 ext4_ext_show_leaf(inode, path); in ext4_split_extent_at()
3294 struct ext4_ext_path *path = *ppath; in ext4_split_extent() local
3304 ex = path[depth].p_ext; in ext4_split_extent()
3325 * Update path is required because previous ext4_split_extent_at() may in ext4_split_extent()
3328 path = ext4_find_extent(inode, map->m_lblk, ppath, flags); in ext4_split_extent()
3329 if (IS_ERR(path)) in ext4_split_extent()
3330 return PTR_ERR(path); in ext4_split_extent()
3332 ex = path[depth].p_ext; in ext4_split_extent()
3354 ext4_ext_show_leaf(inode, path); in ext4_split_extent()
3370 * - The extent pointed to by 'path' is unwritten.
3371 * - The extent pointed to by 'path' contains a superset
3385 struct ext4_ext_path *path = *ppath; in ext4_ext_convert_to_initialized() local
3407 eh = path[depth].p_hdr; in ext4_ext_convert_to_initialized()
3408 ex = path[depth].p_ext; in ext4_ext_convert_to_initialized()
3462 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3508 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3530 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3532 /* Update path to point to the right extent */ in ext4_ext_convert_to_initialized()
3533 path[depth].p_ext = abut_ex; in ext4_ext_convert_to_initialized()
3644 struct ext4_ext_path *path = *ppath; in ext4_split_convert_extents() local
3663 ex = path[depth].p_ext; in ext4_split_convert_extents()
3685 struct ext4_ext_path *path = *ppath; in ext4_convert_unwritten_extents_endio() local
3693 ex = path[depth].p_ext; in ext4_convert_unwritten_extents_endio()
3717 path = ext4_find_extent(inode, map->m_lblk, ppath, 0); in ext4_convert_unwritten_extents_endio()
3718 if (IS_ERR(path)) in ext4_convert_unwritten_extents_endio()
3719 return PTR_ERR(path); in ext4_convert_unwritten_extents_endio()
3721 ex = path[depth].p_ext; in ext4_convert_unwritten_extents_endio()
3724 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_convert_unwritten_extents_endio()
3733 ext4_ext_try_to_merge(handle, inode, path, ex); in ext4_convert_unwritten_extents_endio()
3736 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_convert_unwritten_extents_endio()
3738 ext4_ext_show_leaf(inode, path); in ext4_convert_unwritten_extents_endio()
3748 struct ext4_ext_path *path = *ppath; in convert_initialized_extent() local
3763 ex = path[depth].p_ext; in convert_initialized_extent()
3775 path = ext4_find_extent(inode, map->m_lblk, ppath, 0); in convert_initialized_extent()
3776 if (IS_ERR(path)) in convert_initialized_extent()
3777 return PTR_ERR(path); in convert_initialized_extent()
3779 ex = path[depth].p_ext; in convert_initialized_extent()
3787 err = ext4_ext_get_access(handle, inode, path + depth); in convert_initialized_extent()
3796 ext4_ext_try_to_merge(handle, inode, path, ex); in convert_initialized_extent()
3799 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in convert_initialized_extent()
3802 ext4_ext_show_leaf(inode, path); in convert_initialized_extent()
3819 struct ext4_ext_path __maybe_unused *path = *ppath; in ext4_ext_handle_unwritten_extents() local
3826 ext4_ext_show_leaf(inode, path); in ext4_ext_handle_unwritten_extents()
3923 ext4_ext_show_leaf(inode, path); in ext4_ext_handle_unwritten_extents()
3972 struct ext4_ext_path *path) in get_implied_cluster_alloc() argument
4018 ext4_lblk_t next = ext4_ext_next_allocated_block(path); in get_implied_cluster_alloc()
4052 struct ext4_ext_path *path = NULL; in ext4_ext_map_blocks() local
4066 path = ext4_find_extent(inode, map->m_lblk, NULL, 0); in ext4_ext_map_blocks()
4067 if (IS_ERR(path)) { in ext4_ext_map_blocks()
4068 err = PTR_ERR(path); in ext4_ext_map_blocks()
4069 path = NULL; in ext4_ext_map_blocks()
4080 if (unlikely(path[depth].p_ext == NULL && depth != 0)) { in ext4_ext_map_blocks()
4084 path[depth].p_block); in ext4_ext_map_blocks()
4089 ex = path[depth].p_ext; in ext4_ext_map_blocks()
4119 inode, map, &path, &allocated); in ext4_ext_map_blocks()
4127 ext4_ext_show_leaf(inode, path); in ext4_ext_map_blocks()
4132 handle, inode, map, &path, flags, in ext4_ext_map_blocks()
4150 hole_len = ext4_ext_determine_hole(inode, path, &hole_start); in ext4_ext_map_blocks()
4177 get_implied_cluster_alloc(inode->i_sb, map, ex, path)) { in ext4_ext_map_blocks()
4185 err = ext4_ext_search_left(inode, path, &ar.lleft, &ar.pleft); in ext4_ext_map_blocks()
4189 err = ext4_ext_search_right(inode, path, &ar.lright, &ar.pright, &ex2); in ext4_ext_map_blocks()
4196 get_implied_cluster_alloc(inode->i_sb, map, &ex2, path)) { in ext4_ext_map_blocks()
4217 err = ext4_ext_check_overlap(sbi, inode, &newex, path); in ext4_ext_map_blocks()
4225 ar.goal = ext4_ext_find_goal(inode, path, map->m_lblk); in ext4_ext_map_blocks()
4271 err = ext4_ext_insert_extent(handle, inode, &path, &newex, flags); in ext4_ext_map_blocks()
4341 ext4_ext_show_leaf(inode, path); in ext4_ext_map_blocks()
4343 ext4_ext_drop_refs(path); in ext4_ext_map_blocks()
4344 kfree(path); in ext4_ext_map_blocks()
4982 * Function to access the path buffer for marking it dirty.
4984 * to update path.
4988 struct ext4_ext_path *path) in ext4_access_path() argument
5006 err = ext4_ext_get_access(handle, inode, path); in ext4_access_path()
5012 * Shift the extents of a path structure lying between path[depth].p_ext
5013 * and EXT_LAST_EXTENT(path[depth].p_hdr), by @shift blocks. @SHIFT tells
5017 ext4_ext_shift_path_extents(struct ext4_ext_path *path, ext4_lblk_t shift, in ext4_ext_shift_path_extents() argument
5024 depth = path->p_depth; in ext4_ext_shift_path_extents()
5027 if (depth == path->p_depth) { in ext4_ext_shift_path_extents()
5028 ex_start = path[depth].p_ext; in ext4_ext_shift_path_extents()
5032 ex_last = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_path_extents()
5034 err = ext4_access_path(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5038 if (ex_start == EXT_FIRST_EXTENT(path[depth].p_hdr)) in ext4_ext_shift_path_extents()
5047 EXT_FIRST_EXTENT(path[depth].p_hdr)) in ext4_ext_shift_path_extents()
5050 path, ex_start - 1)) in ext4_ext_shift_path_extents()
5056 ext4_ext_try_to_merge_right(inode, path, in ext4_ext_shift_path_extents()
5061 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5070 err = ext4_access_path(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5075 le32_add_cpu(&path[depth].p_idx->ei_block, -shift); in ext4_ext_shift_path_extents()
5077 le32_add_cpu(&path[depth].p_idx->ei_block, shift); in ext4_ext_shift_path_extents()
5078 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5083 if (path[depth].p_idx != EXT_FIRST_INDEX(path[depth].p_hdr)) in ext4_ext_shift_path_extents()
5105 struct ext4_ext_path *path; in ext4_ext_shift_extents() local
5110 /* Let path point to the last extent */ in ext4_ext_shift_extents()
5111 path = ext4_find_extent(inode, EXT_MAX_BLOCKS - 1, NULL, in ext4_ext_shift_extents()
5113 if (IS_ERR(path)) in ext4_ext_shift_extents()
5114 return PTR_ERR(path); in ext4_ext_shift_extents()
5116 depth = path->p_depth; in ext4_ext_shift_extents()
5117 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5129 path = ext4_find_extent(inode, start - 1, &path, in ext4_ext_shift_extents()
5131 if (IS_ERR(path)) in ext4_ext_shift_extents()
5132 return PTR_ERR(path); in ext4_ext_shift_extents()
5133 depth = path->p_depth; in ext4_ext_shift_extents()
5134 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5173 path = ext4_find_extent(inode, *iterator, &path, in ext4_ext_shift_extents()
5175 if (IS_ERR(path)) in ext4_ext_shift_extents()
5176 return PTR_ERR(path); in ext4_ext_shift_extents()
5177 depth = path->p_depth; in ext4_ext_shift_extents()
5178 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5187 if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) { in ext4_ext_shift_extents()
5188 path[depth].p_ext++; in ext4_ext_shift_extents()
5190 *iterator = ext4_ext_next_allocated_block(path); in ext4_ext_shift_extents()
5196 extent = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5200 extent = EXT_FIRST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5206 /* Update path extent in case we need to stop */ in ext4_ext_shift_extents()
5209 path[depth].p_ext = extent; in ext4_ext_shift_extents()
5211 ret = ext4_ext_shift_path_extents(path, shift, inode, in ext4_ext_shift_extents()
5217 ext4_ext_drop_refs(path); in ext4_ext_shift_extents()
5218 kfree(path); in ext4_ext_shift_extents()
5379 struct ext4_ext_path *path; in ext4_insert_range() local
5473 path = ext4_find_extent(inode, offset_lblk, NULL, 0); in ext4_insert_range()
5474 if (IS_ERR(path)) { in ext4_insert_range()
5480 extent = path[depth].p_ext; in ext4_insert_range()
5494 ret = ext4_split_extent_at(handle, inode, &path, in ext4_insert_range()
5501 ext4_ext_drop_refs(path); in ext4_insert_range()
5502 kfree(path); in ext4_insert_range()
5508 ext4_ext_drop_refs(path); in ext4_insert_range()
5509 kfree(path); in ext4_insert_range()
5659 * path must to be revalidated. */ in ext4_swap_extents()
5685 * path must to be revalidated. */ in ext4_swap_extents()
5754 struct ext4_ext_path *path; in ext4_clu_mapped() local
5760 path = ext4_find_extent(inode, EXT4_C2B(sbi, lclu), NULL, 0); in ext4_clu_mapped()
5761 if (IS_ERR(path)) { in ext4_clu_mapped()
5762 err = PTR_ERR(path); in ext4_clu_mapped()
5763 path = NULL; in ext4_clu_mapped()
5774 if (unlikely(path[depth].p_ext == NULL && depth != 0)) { in ext4_clu_mapped()
5778 depth, path[depth].p_block); in ext4_clu_mapped()
5783 extent = path[depth].p_ext; in ext4_clu_mapped()
5804 first_lblk = ext4_ext_next_allocated_block(path); in ext4_clu_mapped()
5812 ext4_ext_drop_refs(path); in ext4_clu_mapped()
5813 kfree(path); in ext4_clu_mapped()
5823 * replay path. Returns 0 on success and error on failure.
5828 struct ext4_ext_path *path = NULL, *ppath; in ext4_ext_replay_update_ex() local
5832 path = ext4_find_extent(inode, start, NULL, 0); in ext4_ext_replay_update_ex()
5833 if (IS_ERR(path)) in ext4_ext_replay_update_ex()
5834 return PTR_ERR(path); in ext4_ext_replay_update_ex()
5835 ex = path[path->p_depth].p_ext; in ext4_ext_replay_update_ex()
5844 ppath = path; in ext4_ext_replay_update_ex()
5850 kfree(path); in ext4_ext_replay_update_ex()
5851 path = ext4_find_extent(inode, start, NULL, 0); in ext4_ext_replay_update_ex()
5852 if (IS_ERR(path)) in ext4_ext_replay_update_ex()
5854 ppath = path; in ext4_ext_replay_update_ex()
5855 ex = path[path->p_depth].p_ext; in ext4_ext_replay_update_ex()
5864 kfree(path); in ext4_ext_replay_update_ex()
5865 path = ext4_find_extent(inode, start, NULL, 0); in ext4_ext_replay_update_ex()
5866 if (IS_ERR(path)) in ext4_ext_replay_update_ex()
5868 ex = path[path->p_depth].p_ext; in ext4_ext_replay_update_ex()
5877 ret = ext4_ext_dirty(NULL, inode, &path[path->p_depth]); in ext4_ext_replay_update_ex()
5880 ext4_ext_drop_refs(path); in ext4_ext_replay_update_ex()
5881 kfree(path); in ext4_ext_replay_update_ex()
5889 struct ext4_ext_path *path = NULL; in ext4_ext_replay_shrink_inode() local
5894 path = ext4_find_extent(inode, cur, NULL, 0); in ext4_ext_replay_shrink_inode()
5895 if (IS_ERR(path)) in ext4_ext_replay_shrink_inode()
5897 ex = path[path->p_depth].p_ext; in ext4_ext_replay_shrink_inode()
5899 ext4_ext_drop_refs(path); in ext4_ext_replay_shrink_inode()
5900 kfree(path); in ext4_ext_replay_shrink_inode()
5908 ext4_ext_try_to_merge(NULL, inode, path, ex); in ext4_ext_replay_shrink_inode()
5910 ext4_ext_dirty(NULL, inode, &path[path->p_depth]); in ext4_ext_replay_shrink_inode()
5913 ext4_ext_drop_refs(path); in ext4_ext_replay_shrink_inode()
5914 kfree(path); in ext4_ext_replay_shrink_inode()
5939 struct ext4_ext_path *path = NULL, *path2 = NULL; in ext4_ext_replay_set_iblocks() local
5947 path = ext4_find_extent(inode, EXT_MAX_BLOCKS - 1, NULL, in ext4_ext_replay_set_iblocks()
5949 if (IS_ERR(path)) in ext4_ext_replay_set_iblocks()
5950 return PTR_ERR(path); in ext4_ext_replay_set_iblocks()
5951 ex = path[path->p_depth].p_ext; in ext4_ext_replay_set_iblocks()
5953 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
5954 kfree(path); in ext4_ext_replay_set_iblocks()
5958 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
5959 kfree(path); in ext4_ext_replay_set_iblocks()
5977 * their paths. When path is different for 2 successive extents in ext4_ext_replay_set_iblocks()
5978 * we compare the blocks in the path at each level and increment in ext4_ext_replay_set_iblocks()
5985 path = ext4_find_extent(inode, cur, NULL, 0); in ext4_ext_replay_set_iblocks()
5986 if (IS_ERR(path)) in ext4_ext_replay_set_iblocks()
5988 numblks += path->p_depth; in ext4_ext_replay_set_iblocks()
5989 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
5990 kfree(path); in ext4_ext_replay_set_iblocks()
5992 path = ext4_find_extent(inode, cur, NULL, 0); in ext4_ext_replay_set_iblocks()
5993 if (IS_ERR(path)) in ext4_ext_replay_set_iblocks()
5995 ex = path[path->p_depth].p_ext; in ext4_ext_replay_set_iblocks()
5997 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
5998 kfree(path); in ext4_ext_replay_set_iblocks()
6005 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
6006 kfree(path); in ext4_ext_replay_set_iblocks()
6011 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
6012 kfree(path); in ext4_ext_replay_set_iblocks()
6015 for (i = 0; i <= max(path->p_depth, path2->p_depth); i++) { in ext4_ext_replay_set_iblocks()
6017 if (i <= path->p_depth) in ext4_ext_replay_set_iblocks()
6018 cmp1 = path[i].p_bh ? in ext4_ext_replay_set_iblocks()
6019 path[i].p_bh->b_blocknr : 0; in ext4_ext_replay_set_iblocks()
6026 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
6028 kfree(path); in ext4_ext_replay_set_iblocks()
6040 struct ext4_ext_path *path = NULL; in ext4_ext_clear_bb() local
6047 path = ext4_find_extent(inode, EXT_MAX_BLOCKS - 1, NULL, in ext4_ext_clear_bb()
6049 if (IS_ERR(path)) in ext4_ext_clear_bb()
6050 return PTR_ERR(path); in ext4_ext_clear_bb()
6051 ex = path[path->p_depth].p_ext; in ext4_ext_clear_bb()
6053 ext4_ext_drop_refs(path); in ext4_ext_clear_bb()
6054 kfree(path); in ext4_ext_clear_bb()
6058 ext4_ext_drop_refs(path); in ext4_ext_clear_bb()
6059 kfree(path); in ext4_ext_clear_bb()
6069 path = ext4_find_extent(inode, map.m_lblk, NULL, 0); in ext4_ext_clear_bb()
6070 if (!IS_ERR_OR_NULL(path)) { in ext4_ext_clear_bb()
6071 for (j = 0; j < path->p_depth; j++) { in ext4_ext_clear_bb()
6074 path[j].p_block, 1, 0); in ext4_ext_clear_bb()
6076 ext4_ext_drop_refs(path); in ext4_ext_clear_bb()
6077 kfree(path); in ext4_ext_clear_bb()