• Home
  • Raw
  • Download

Lines Matching full:path

137 				struct ext4_ext_path *path)  in ext4_ext_get_access()  argument
141 if (path->p_bh) { in ext4_ext_get_access()
142 /* path points to block */ in ext4_ext_get_access()
143 BUFFER_TRACE(path->p_bh, "get_write_access"); in ext4_ext_get_access()
144 err = ext4_journal_get_write_access(handle, path->p_bh); in ext4_ext_get_access()
152 clear_buffer_verified(path->p_bh); in ext4_ext_get_access()
154 /* path points to leaf/index in inode body */ in ext4_ext_get_access()
167 struct ext4_ext_path *path) in __ext4_ext_dirty() argument
172 if (path->p_bh) { in __ext4_ext_dirty()
173 ext4_extent_block_csum_set(inode, ext_block_hdr(path->p_bh)); in __ext4_ext_dirty()
174 /* path points to block */ in __ext4_ext_dirty()
176 inode, path->p_bh); in __ext4_ext_dirty()
179 set_buffer_verified(path->p_bh); in __ext4_ext_dirty()
181 /* path points to leaf/index in inode body */ in __ext4_ext_dirty()
187 #define ext4_ext_dirty(handle, inode, path) \ argument
188 __ext4_ext_dirty(__func__, __LINE__, (handle), (inode), (path))
191 struct ext4_ext_path *path, in ext4_ext_find_goal() argument
194 if (path) { in ext4_ext_find_goal()
195 int depth = path->p_depth; in ext4_ext_find_goal()
215 ex = path[depth].p_ext; in ext4_ext_find_goal()
228 if (path[depth].p_bh) in ext4_ext_find_goal()
229 return path[depth].p_bh->b_blocknr; in ext4_ext_find_goal()
241 struct ext4_ext_path *path, in ext4_ext_new_meta_block() argument
246 goal = ext4_ext_find_goal(inode, path, le32_to_cpu(ex->ee_block)); in ext4_ext_new_meta_block()
311 struct ext4_ext_path *path = *ppath; in ext4_force_split_extent_at() local
312 int unwritten = ext4_ext_is_unwritten(path[path->p_depth].p_ext); in ext4_force_split_extent_at()
590 struct ext4_ext_path *path = NULL; in ext4_ext_precache() local
606 path = kcalloc(depth + 1, sizeof(struct ext4_ext_path), in ext4_ext_precache()
608 if (path == NULL) { in ext4_ext_precache()
613 path[0].p_hdr = ext_inode_hdr(inode); in ext4_ext_precache()
614 ret = ext4_ext_check(inode, path[0].p_hdr, depth, 0); in ext4_ext_precache()
617 path[0].p_idx = EXT_FIRST_INDEX(path[0].p_hdr); in ext4_ext_precache()
624 path[i].p_idx > EXT_LAST_INDEX(path[i].p_hdr)) { in ext4_ext_precache()
625 brelse(path[i].p_bh); in ext4_ext_precache()
626 path[i].p_bh = NULL; in ext4_ext_precache()
630 bh = read_extent_tree_block(inode, path[i].p_idx++, in ext4_ext_precache()
638 path[i].p_bh = bh; in ext4_ext_precache()
639 path[i].p_hdr = ext_block_hdr(bh); in ext4_ext_precache()
640 path[i].p_idx = EXT_FIRST_INDEX(path[i].p_hdr); in ext4_ext_precache()
645 ext4_ext_drop_refs(path); in ext4_ext_precache()
646 kfree(path); in ext4_ext_precache()
651 static void ext4_ext_show_path(struct inode *inode, struct ext4_ext_path *path) in ext4_ext_show_path() argument
653 int k, l = path->p_depth; in ext4_ext_show_path()
655 ext_debug(inode, "path:"); in ext4_ext_show_path()
656 for (k = 0; k <= l; k++, path++) { in ext4_ext_show_path()
657 if (path->p_idx) { in ext4_ext_show_path()
659 le32_to_cpu(path->p_idx->ei_block), in ext4_ext_show_path()
660 ext4_idx_pblock(path->p_idx)); in ext4_ext_show_path()
661 } else if (path->p_ext) { in ext4_ext_show_path()
663 le32_to_cpu(path->p_ext->ee_block), in ext4_ext_show_path()
664 ext4_ext_is_unwritten(path->p_ext), in ext4_ext_show_path()
665 ext4_ext_get_actual_len(path->p_ext), in ext4_ext_show_path()
666 ext4_ext_pblock(path->p_ext)); in ext4_ext_show_path()
673 static void ext4_ext_show_leaf(struct inode *inode, struct ext4_ext_path *path) in ext4_ext_show_leaf() argument
680 if (!path) in ext4_ext_show_leaf()
683 eh = path[depth].p_hdr; in ext4_ext_show_leaf()
696 static void ext4_ext_show_move(struct inode *inode, struct ext4_ext_path *path, in ext4_ext_show_move() argument
704 idx = path[level].p_idx; in ext4_ext_show_move()
705 while (idx <= EXT_MAX_INDEX(path[level].p_hdr)) { in ext4_ext_show_move()
715 ex = path[depth].p_ext; in ext4_ext_show_move()
716 while (ex <= EXT_MAX_EXTENT(path[depth].p_hdr)) { in ext4_ext_show_move()
728 #define ext4_ext_show_path(inode, path) argument
729 #define ext4_ext_show_leaf(inode, path) argument
730 #define ext4_ext_show_move(inode, path, newblock, level) argument
733 void ext4_ext_drop_refs(struct ext4_ext_path *path) in ext4_ext_drop_refs() argument
737 if (!path) in ext4_ext_drop_refs()
739 depth = path->p_depth; in ext4_ext_drop_refs()
740 for (i = 0; i <= depth; i++, path++) { in ext4_ext_drop_refs()
741 brelse(path->p_bh); in ext4_ext_drop_refs()
742 path->p_bh = NULL; in ext4_ext_drop_refs()
753 struct ext4_ext_path *path, ext4_lblk_t block) in ext4_ext_binsearch_idx() argument
755 struct ext4_extent_header *eh = path->p_hdr; in ext4_ext_binsearch_idx()
774 path->p_idx = l - 1; in ext4_ext_binsearch_idx()
775 ext_debug(inode, " -> %u->%lld ", le32_to_cpu(path->p_idx->ei_block), in ext4_ext_binsearch_idx()
776 ext4_idx_pblock(path->p_idx)); in ext4_ext_binsearch_idx()
800 BUG_ON(chix != path->p_idx); in ext4_ext_binsearch_idx()
813 struct ext4_ext_path *path, ext4_lblk_t block) in ext4_ext_binsearch() argument
815 struct ext4_extent_header *eh = path->p_hdr; in ext4_ext_binsearch()
842 path->p_ext = l - 1; in ext4_ext_binsearch()
844 le32_to_cpu(path->p_ext->ee_block), in ext4_ext_binsearch()
845 ext4_ext_pblock(path->p_ext), in ext4_ext_binsearch()
846 ext4_ext_is_unwritten(path->p_ext), in ext4_ext_binsearch()
847 ext4_ext_get_actual_len(path->p_ext)); in ext4_ext_binsearch()
862 BUG_ON(chex != path->p_ext); in ext4_ext_binsearch()
887 struct ext4_ext_path *path = orig_path ? *orig_path : NULL; in ext4_find_extent() local
904 if (path) { in ext4_find_extent()
905 ext4_ext_drop_refs(path); in ext4_find_extent()
906 if (depth > path[0].p_maxdepth) { in ext4_find_extent()
907 kfree(path); in ext4_find_extent()
908 *orig_path = path = NULL; in ext4_find_extent()
911 if (!path) { in ext4_find_extent()
913 path = kcalloc(depth + 2, sizeof(struct ext4_ext_path), in ext4_find_extent()
915 if (unlikely(!path)) in ext4_find_extent()
917 path[0].p_maxdepth = depth + 1; in ext4_find_extent()
919 path[0].p_hdr = eh; in ext4_find_extent()
920 path[0].p_bh = NULL; in ext4_find_extent()
930 ext4_ext_binsearch_idx(inode, path + ppos, block); in ext4_find_extent()
931 path[ppos].p_block = ext4_idx_pblock(path[ppos].p_idx); in ext4_find_extent()
932 path[ppos].p_depth = i; in ext4_find_extent()
933 path[ppos].p_ext = NULL; in ext4_find_extent()
935 bh = read_extent_tree_block(inode, path[ppos].p_idx, --i, flags); in ext4_find_extent()
943 path[ppos].p_bh = bh; in ext4_find_extent()
944 path[ppos].p_hdr = eh; in ext4_find_extent()
947 path[ppos].p_depth = i; in ext4_find_extent()
948 path[ppos].p_ext = NULL; in ext4_find_extent()
949 path[ppos].p_idx = NULL; in ext4_find_extent()
952 ext4_ext_binsearch(inode, path + ppos, block); in ext4_find_extent()
954 if (path[ppos].p_ext) in ext4_find_extent()
955 path[ppos].p_block = ext4_ext_pblock(path[ppos].p_ext); in ext4_find_extent()
957 ext4_ext_show_path(inode, path); in ext4_find_extent()
959 return path; in ext4_find_extent()
962 ext4_ext_drop_refs(path); in ext4_find_extent()
963 kfree(path); in ext4_find_extent()
1044 * inserts new subtree into the path, using free index entry
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()
1144 /* move remainder of path[depth] to the new leaf */ in ext4_ext_split()
1145 if (unlikely(path[depth].p_hdr->eh_entries != in ext4_ext_split()
1146 path[depth].p_hdr->eh_max)) { in ext4_ext_split()
1148 path[depth].p_hdr->eh_entries, in ext4_ext_split()
1149 path[depth].p_hdr->eh_max); in ext4_ext_split()
1154 m = EXT_MAX_EXTENT(path[depth].p_hdr) - path[depth].p_ext++; in ext4_ext_split()
1155 ext4_ext_show_move(inode, path, newblock, depth); in ext4_ext_split()
1159 memmove(ex, path[depth].p_ext, sizeof(struct ext4_extent) * m); in ext4_ext_split()
1179 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_split()
1182 le16_add_cpu(&path[depth].p_hdr->eh_entries, -m); in ext4_ext_split()
1183 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_split()
1228 /* move remainder of path[i] to the new index block */ in ext4_ext_split()
1229 if (unlikely(EXT_MAX_INDEX(path[i].p_hdr) != in ext4_ext_split()
1230 EXT_LAST_INDEX(path[i].p_hdr))) { in ext4_ext_split()
1233 le32_to_cpu(path[i].p_ext->ee_block)); in ext4_ext_split()
1238 m = EXT_MAX_INDEX(path[i].p_hdr) - path[i].p_idx++; in ext4_ext_split()
1239 ext_debug(inode, "cur 0x%p, last 0x%p\n", path[i].p_idx, in ext4_ext_split()
1240 EXT_MAX_INDEX(path[i].p_hdr)); in ext4_ext_split()
1241 ext4_ext_show_move(inode, path, newblock, i); in ext4_ext_split()
1243 memmove(++fidx, path[i].p_idx, in ext4_ext_split()
1264 err = ext4_ext_get_access(handle, inode, path + i); in ext4_ext_split()
1267 le16_add_cpu(&path[i].p_hdr->eh_entries, -m); in ext4_ext_split()
1268 err = ext4_ext_dirty(handle, inode, path + i); in ext4_ext_split()
1277 err = ext4_ext_insert_index(handle, inode, path + at, in ext4_ext_split()
1400 struct ext4_ext_path *path = *ppath; in ext4_ext_create_new_leaf() local
1408 curp = path + depth; in ext4_ext_create_new_leaf()
1419 err = ext4_ext_split(handle, inode, mb_flags, path, newext, i); in ext4_ext_create_new_leaf()
1423 /* refill path */ in ext4_ext_create_new_leaf()
1424 path = ext4_find_extent(inode, in ext4_ext_create_new_leaf()
1427 if (IS_ERR(path)) in ext4_ext_create_new_leaf()
1428 err = PTR_ERR(path); in ext4_ext_create_new_leaf()
1435 /* refill path */ in ext4_ext_create_new_leaf()
1436 path = ext4_find_extent(inode, in ext4_ext_create_new_leaf()
1439 if (IS_ERR(path)) { in ext4_ext_create_new_leaf()
1440 err = PTR_ERR(path); in ext4_ext_create_new_leaf()
1449 if (path[depth].p_hdr->eh_entries == path[depth].p_hdr->eh_max) { 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()
1475 EXT4_ERROR_INODE(inode, "path == NULL *logical %d!", *logical); 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()
1484 /* usually extent in the path covers blocks smaller 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 EXT_FIRST_INDEX(path[depth].p_hdr) != NULL ? in ext4_ext_search_left()
1504 le32_to_cpu(EXT_FIRST_INDEX(path[depth].p_hdr)->ei_block) : 0, in ext4_ext_search_left()
1532 struct ext4_ext_path *path, in ext4_ext_search_right() argument
1543 if (unlikely(path == NULL)) { in ext4_ext_search_right()
1544 EXT4_ERROR_INODE(inode, "path == NULL *logical %d!", *logical); in ext4_ext_search_right()
1547 depth = path->p_depth; in ext4_ext_search_right()
1550 if (depth == 0 && path->p_ext == NULL) in ext4_ext_search_right()
1553 /* usually extent in the path covers blocks smaller in ext4_ext_search_right()
1557 ex = path[depth].p_ext; in ext4_ext_search_right()
1560 if (unlikely(EXT_FIRST_EXTENT(path[depth].p_hdr) != ex)) { in ext4_ext_search_right()
1562 "first_extent(path[%d].p_hdr) != ex", in ext4_ext_search_right()
1567 ix = path[depth].p_idx; in ext4_ext_search_right()
1568 if (unlikely(ix != EXT_FIRST_INDEX(path[depth].p_hdr))) { in ext4_ext_search_right()
1585 if (ex != EXT_LAST_EXTENT(path[depth].p_hdr)) { in ext4_ext_search_right()
1593 ix = path[depth].p_idx; in ext4_ext_search_right()
1594 if (ix != EXT_LAST_INDEX(path[depth].p_hdr)) in ext4_ext_search_right()
1606 while (++depth < path->p_depth) { in ext4_ext_search_right()
1608 bh = read_extent_tree_block(inode, ix, path->p_depth - depth, 0); in ext4_ext_search_right()
1616 bh = read_extent_tree_block(inode, ix, path->p_depth - depth, 0); in ext4_ext_search_right()
1639 ext4_ext_next_allocated_block(struct ext4_ext_path *path) in ext4_ext_next_allocated_block() argument
1643 BUG_ON(path == NULL); in ext4_ext_next_allocated_block()
1644 depth = path->p_depth; in ext4_ext_next_allocated_block()
1646 if (depth == 0 && path->p_ext == NULL) in ext4_ext_next_allocated_block()
1650 struct ext4_ext_path *p = &path[depth]; in ext4_ext_next_allocated_block()
1652 if (depth == path->p_depth) { in ext4_ext_next_allocated_block()
1671 static ext4_lblk_t ext4_ext_next_leaf_block(struct ext4_ext_path *path) in ext4_ext_next_leaf_block() argument
1675 BUG_ON(path == NULL); in ext4_ext_next_leaf_block()
1676 depth = path->p_depth; in ext4_ext_next_leaf_block()
1686 if (path[depth].p_idx != in ext4_ext_next_leaf_block()
1687 EXT_LAST_INDEX(path[depth].p_hdr)) in ext4_ext_next_leaf_block()
1689 le32_to_cpu(path[depth].p_idx[1].ei_block); in ext4_ext_next_leaf_block()
1703 struct ext4_ext_path *path) in ext4_ext_correct_indexes() argument
1711 eh = path[depth].p_hdr; in ext4_ext_correct_indexes()
1712 ex = path[depth].p_ext; in ext4_ext_correct_indexes()
1734 border = path[depth].p_ext->ee_block; in ext4_ext_correct_indexes()
1735 err = ext4_ext_get_access(handle, inode, path + k); in ext4_ext_correct_indexes()
1738 path[k].p_idx->ei_block = border; in ext4_ext_correct_indexes()
1739 err = ext4_ext_dirty(handle, inode, path + k); in ext4_ext_correct_indexes()
1745 if (path[k+1].p_idx != EXT_FIRST_INDEX(path[k+1].p_hdr)) in ext4_ext_correct_indexes()
1747 err = ext4_ext_get_access(handle, inode, path + k); in ext4_ext_correct_indexes()
1750 path[k].p_idx->ei_block = border; in ext4_ext_correct_indexes()
1751 err = ext4_ext_dirty(handle, inode, path + k); in ext4_ext_correct_indexes()
1799 struct ext4_ext_path *path, in ext4_ext_try_to_merge_right() argument
1807 BUG_ON(path[depth].p_hdr == NULL); in ext4_ext_try_to_merge_right()
1808 eh = path[depth].p_hdr; in ext4_ext_try_to_merge_right()
1841 struct ext4_ext_path *path) in ext4_ext_try_to_merge_up() argument
1847 if ((path[0].p_depth != 1) || in ext4_ext_try_to_merge_up()
1848 (le16_to_cpu(path[0].p_hdr->eh_entries) != 1) || in ext4_ext_try_to_merge_up()
1849 (le16_to_cpu(path[1].p_hdr->eh_entries) > max_root)) in ext4_ext_try_to_merge_up()
1864 blk = ext4_idx_pblock(path[0].p_idx); in ext4_ext_try_to_merge_up()
1865 s = le16_to_cpu(path[1].p_hdr->eh_entries) * in ext4_ext_try_to_merge_up()
1869 path[1].p_maxdepth = path[0].p_maxdepth; in ext4_ext_try_to_merge_up()
1870 memcpy(path[0].p_hdr, path[1].p_hdr, s); in ext4_ext_try_to_merge_up()
1871 path[0].p_depth = 0; in ext4_ext_try_to_merge_up()
1872 path[0].p_ext = EXT_FIRST_EXTENT(path[0].p_hdr) + in ext4_ext_try_to_merge_up()
1873 (path[1].p_ext - EXT_FIRST_EXTENT(path[1].p_hdr)); in ext4_ext_try_to_merge_up()
1874 path[0].p_hdr->eh_max = cpu_to_le16(max_root); in ext4_ext_try_to_merge_up()
1876 brelse(path[1].p_bh); in ext4_ext_try_to_merge_up()
1887 struct ext4_ext_path *path, in ext4_ext_try_to_merge() argument
1895 BUG_ON(path[depth].p_hdr == NULL); in ext4_ext_try_to_merge()
1896 eh = path[depth].p_hdr; in ext4_ext_try_to_merge()
1899 merge_done = ext4_ext_try_to_merge_right(inode, path, ex - 1); in ext4_ext_try_to_merge()
1902 (void) ext4_ext_try_to_merge_right(inode, path, ex); in ext4_ext_try_to_merge()
1904 ext4_ext_try_to_merge_up(handle, inode, path); in ext4_ext_try_to_merge()
1918 struct ext4_ext_path *path) in ext4_ext_check_overlap() argument
1927 if (!path[depth].p_ext) in ext4_ext_check_overlap()
1929 b2 = EXT4_LBLK_CMASK(sbi, le32_to_cpu(path[depth].p_ext->ee_block)); in ext4_ext_check_overlap()
1932 * get the next allocated block if the extent in the path in ext4_ext_check_overlap()
1936 b2 = ext4_ext_next_allocated_block(path); in ext4_ext_check_overlap()
1968 struct ext4_ext_path *path = *ppath; in ext4_ext_insert_extent() local
1984 ex = path[depth].p_ext; in ext4_ext_insert_extent()
1985 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
1986 if (unlikely(path[depth].p_hdr == NULL)) { in ext4_ext_insert_extent()
1987 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth); in ext4_ext_insert_extent()
2024 path + depth); in ext4_ext_insert_extent()
2032 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2050 path + depth); in ext4_ext_insert_extent()
2061 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2068 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2076 next = ext4_ext_next_leaf_block(path); in ext4_ext_insert_extent()
2083 BUG_ON(npath->p_depth != path->p_depth); in ext4_ext_insert_extent()
2088 path = npath; in ext4_ext_insert_extent()
2106 eh = path[depth].p_hdr; in ext4_ext_insert_extent()
2109 nearex = path[depth].p_ext; in ext4_ext_insert_extent()
2111 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_insert_extent()
2161 path[depth].p_ext = nearex; in ext4_ext_insert_extent()
2169 ext4_ext_try_to_merge(handle, inode, path, nearex); in ext4_ext_insert_extent()
2173 err = ext4_ext_correct_indexes(handle, inode, path); in ext4_ext_insert_extent()
2177 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_ext_insert_extent()
2234 * @path: path in extent tree to @lblk
2238 * block. We don't try too hard to find the beginning of the hole but @path
2245 struct ext4_ext_path *path, in ext4_ext_determine_hole() argument
2252 ex = path[depth].p_ext; in ext4_ext_determine_hole()
2264 next = ext4_ext_next_allocated_block(path); in ext4_ext_determine_hole()
2302 struct ext4_ext_path *path, int depth) in ext4_ext_rm_idx() argument
2309 path = path + depth; in ext4_ext_rm_idx()
2310 leaf = ext4_idx_pblock(path->p_idx); in ext4_ext_rm_idx()
2311 if (unlikely(path->p_hdr->eh_entries == 0)) { in ext4_ext_rm_idx()
2312 EXT4_ERROR_INODE(inode, "path->p_hdr->eh_entries == 0"); in ext4_ext_rm_idx()
2315 err = ext4_ext_get_access(handle, inode, path); in ext4_ext_rm_idx()
2319 if (path->p_idx != EXT_LAST_INDEX(path->p_hdr)) { in ext4_ext_rm_idx()
2320 int len = EXT_LAST_INDEX(path->p_hdr) - path->p_idx; in ext4_ext_rm_idx()
2322 memmove(path->p_idx, path->p_idx + 1, len); in ext4_ext_rm_idx()
2325 le16_add_cpu(&path->p_hdr->eh_entries, -1); in ext4_ext_rm_idx()
2326 err = ext4_ext_dirty(handle, inode, path); in ext4_ext_rm_idx()
2336 if (path->p_idx != EXT_FIRST_INDEX(path->p_hdr)) in ext4_ext_rm_idx()
2338 path--; in ext4_ext_rm_idx()
2339 err = ext4_ext_get_access(handle, inode, path); in ext4_ext_rm_idx()
2342 path->p_idx->ei_block = (path+1)->p_idx->ei_block; in ext4_ext_rm_idx()
2343 err = ext4_ext_dirty(handle, inode, path); in ext4_ext_rm_idx()
2354 * When pass the actual path, the caller should calculate credits
2358 struct ext4_ext_path *path) in ext4_ext_calc_credits_for_single_extent() argument
2360 if (path) { in ext4_ext_calc_credits_for_single_extent()
2365 if (le16_to_cpu(path[depth].p_hdr->eh_entries) in ext4_ext_calc_credits_for_single_extent()
2366 < le16_to_cpu(path[depth].p_hdr->eh_max)) { in ext4_ext_calc_credits_for_single_extent()
2581 * @path: The path to the leaf
2591 struct ext4_ext_path *path, in ext4_ext_rm_leaf() argument
2609 if (!path[depth].p_hdr) in ext4_ext_rm_leaf()
2610 path[depth].p_hdr = ext_block_hdr(path[depth].p_bh); in ext4_ext_rm_leaf()
2611 eh = path[depth].p_hdr; in ext4_ext_rm_leaf()
2612 if (unlikely(path[depth].p_hdr == NULL)) { in ext4_ext_rm_leaf()
2613 EXT4_ERROR_INODE(inode, "path[%d].p_hdr == NULL", depth); in ext4_ext_rm_leaf()
2617 ex = path[depth].p_ext; in ext4_ext_rm_leaf()
2636 path[depth].p_ext = ex; in ext4_ext_rm_leaf()
2707 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_rm_leaf()
2747 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_rm_leaf()
2759 err = ext4_ext_correct_indexes(handle, inode, path); in ext4_ext_rm_leaf()
2786 if (err == 0 && eh->eh_entries == 0 && path[depth].p_bh != NULL) in ext4_ext_rm_leaf()
2787 err = ext4_ext_rm_idx(handle, inode, path, depth); in ext4_ext_rm_leaf()
2798 ext4_ext_more_to_rm(struct ext4_ext_path *path) in ext4_ext_more_to_rm() argument
2800 BUG_ON(path->p_idx == NULL); in ext4_ext_more_to_rm()
2802 if (path->p_idx < EXT_FIRST_INDEX(path->p_hdr)) in ext4_ext_more_to_rm()
2809 if (le16_to_cpu(path->p_hdr->eh_entries) == path->p_block) in ext4_ext_more_to_rm()
2819 struct ext4_ext_path *path = NULL; in ext4_ext_remove_space() local
2853 path = ext4_find_extent(inode, end, NULL, in ext4_ext_remove_space()
2855 if (IS_ERR(path)) { in ext4_ext_remove_space()
2857 return PTR_ERR(path); in ext4_ext_remove_space()
2861 ex = path[depth].p_ext; in ext4_ext_remove_space()
2865 "path[%d].p_hdr == NULL", in ext4_ext_remove_space()
2900 err = ext4_force_split_extent_at(handle, inode, &path, in ext4_ext_remove_space()
2918 err = ext4_ext_search_right(inode, path, &lblk, &pblk, in ext4_ext_remove_space()
2933 if (path) { in ext4_ext_remove_space()
2936 path[k].p_block = in ext4_ext_remove_space()
2937 le16_to_cpu(path[k].p_hdr->eh_entries)+1; in ext4_ext_remove_space()
2939 path = kcalloc(depth + 1, sizeof(struct ext4_ext_path), in ext4_ext_remove_space()
2941 if (path == NULL) { in ext4_ext_remove_space()
2945 path[0].p_maxdepth = path[0].p_depth = depth; in ext4_ext_remove_space()
2946 path[0].p_hdr = ext_inode_hdr(inode); in ext4_ext_remove_space()
2949 if (ext4_ext_check(inode, path[0].p_hdr, depth, 0)) { in ext4_ext_remove_space()
2959 err = ext4_ext_rm_leaf(handle, inode, path, in ext4_ext_remove_space()
2962 brelse(path[i].p_bh); in ext4_ext_remove_space()
2963 path[i].p_bh = NULL; in ext4_ext_remove_space()
2969 if (!path[i].p_hdr) { in ext4_ext_remove_space()
2971 path[i].p_hdr = ext_block_hdr(path[i].p_bh); in ext4_ext_remove_space()
2974 if (!path[i].p_idx) { in ext4_ext_remove_space()
2976 path[i].p_idx = EXT_LAST_INDEX(path[i].p_hdr); in ext4_ext_remove_space()
2977 path[i].p_block = le16_to_cpu(path[i].p_hdr->eh_entries)+1; in ext4_ext_remove_space()
2979 path[i].p_hdr, in ext4_ext_remove_space()
2980 le16_to_cpu(path[i].p_hdr->eh_entries)); in ext4_ext_remove_space()
2983 path[i].p_idx--; in ext4_ext_remove_space()
2987 i, EXT_FIRST_INDEX(path[i].p_hdr), in ext4_ext_remove_space()
2988 path[i].p_idx); in ext4_ext_remove_space()
2989 if (ext4_ext_more_to_rm(path + i)) { in ext4_ext_remove_space()
2993 i + 1, ext4_idx_pblock(path[i].p_idx)); in ext4_ext_remove_space()
2994 memset(path + i + 1, 0, sizeof(*path)); in ext4_ext_remove_space()
2995 bh = read_extent_tree_block(inode, path[i].p_idx, in ext4_ext_remove_space()
3010 path[i + 1].p_bh = bh; in ext4_ext_remove_space()
3014 path[i].p_block = le16_to_cpu(path[i].p_hdr->eh_entries); in ext4_ext_remove_space()
3018 if (path[i].p_hdr->eh_entries == 0 && i > 0) { in ext4_ext_remove_space()
3022 err = ext4_ext_rm_idx(handle, inode, path, i); in ext4_ext_remove_space()
3025 brelse(path[i].p_bh); in ext4_ext_remove_space()
3026 path[i].p_bh = NULL; 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_ext_drop_refs(path); in ext4_ext_remove_space()
3068 kfree(path); in ext4_ext_remove_space()
3069 path = NULL; in ext4_ext_remove_space()
3162 * @path: the path to the extent
3185 struct ext4_ext_path *path = *ppath; in ext4_split_extent_at() local
3198 ext4_ext_show_leaf(inode, path); in ext4_split_extent_at()
3201 ex = path[depth].p_ext; in ext4_split_extent_at()
3212 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_split_extent_at()
3228 ext4_ext_try_to_merge(handle, inode, path, ex); in ext4_split_extent_at()
3230 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_split_extent_at()
3241 * path may lead to new leaf, not to original leaf any more in ext4_split_extent_at()
3244 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_split_extent_at()
3288 ext4_ext_try_to_merge(handle, inode, path, ex); in ext4_split_extent_at()
3289 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_split_extent_at()
3305 * Ignore ext4_ext_dirty return value since we are already in error path in ext4_split_extent_at()
3308 ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_split_extent_at()
3311 ext4_ext_show_leaf(inode, path); in ext4_split_extent_at()
3333 struct ext4_ext_path *path = *ppath; in ext4_split_extent() local
3343 ex = path[depth].p_ext; in ext4_split_extent()
3364 * Update path is required because previous ext4_split_extent_at() may in ext4_split_extent()
3367 path = ext4_find_extent(inode, map->m_lblk, ppath, flags); in ext4_split_extent()
3368 if (IS_ERR(path)) in ext4_split_extent()
3369 return PTR_ERR(path); in ext4_split_extent()
3371 ex = path[depth].p_ext; in ext4_split_extent()
3393 ext4_ext_show_leaf(inode, path); in ext4_split_extent()
3409 * - The extent pointed to by 'path' is unwritten.
3410 * - The extent pointed to by 'path' contains a superset
3424 struct ext4_ext_path *path = *ppath; in ext4_ext_convert_to_initialized() local
3446 eh = path[depth].p_hdr; in ext4_ext_convert_to_initialized()
3447 ex = path[depth].p_ext; in ext4_ext_convert_to_initialized()
3501 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3547 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3569 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_convert_to_initialized()
3571 /* Update path to point to the right extent */ in ext4_ext_convert_to_initialized()
3572 path[depth].p_ext = abut_ex; in ext4_ext_convert_to_initialized()
3683 struct ext4_ext_path *path = *ppath; in ext4_split_convert_extents() local
3702 ex = path[depth].p_ext; in ext4_split_convert_extents()
3724 struct ext4_ext_path *path = *ppath; in ext4_convert_unwritten_extents_endio() local
3732 ex = path[depth].p_ext; in ext4_convert_unwritten_extents_endio()
3756 path = ext4_find_extent(inode, map->m_lblk, ppath, 0); in ext4_convert_unwritten_extents_endio()
3757 if (IS_ERR(path)) in ext4_convert_unwritten_extents_endio()
3758 return PTR_ERR(path); in ext4_convert_unwritten_extents_endio()
3760 ex = path[depth].p_ext; in ext4_convert_unwritten_extents_endio()
3763 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_convert_unwritten_extents_endio()
3772 ext4_ext_try_to_merge(handle, inode, path, ex); in ext4_convert_unwritten_extents_endio()
3775 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in ext4_convert_unwritten_extents_endio()
3777 ext4_ext_show_leaf(inode, path); in ext4_convert_unwritten_extents_endio()
3787 struct ext4_ext_path *path = *ppath; in convert_initialized_extent() local
3802 ex = path[depth].p_ext; in convert_initialized_extent()
3814 path = ext4_find_extent(inode, map->m_lblk, ppath, 0); in convert_initialized_extent()
3815 if (IS_ERR(path)) in convert_initialized_extent()
3816 return PTR_ERR(path); in convert_initialized_extent()
3818 ex = path[depth].p_ext; in convert_initialized_extent()
3826 err = ext4_ext_get_access(handle, inode, path + depth); in convert_initialized_extent()
3835 ext4_ext_try_to_merge(handle, inode, path, ex); in convert_initialized_extent()
3838 err = ext4_ext_dirty(handle, inode, path + path->p_depth); in convert_initialized_extent()
3841 ext4_ext_show_leaf(inode, path); in convert_initialized_extent()
3858 struct ext4_ext_path __maybe_unused *path = *ppath; in ext4_ext_handle_unwritten_extents() local
3865 ext4_ext_show_leaf(inode, path); in ext4_ext_handle_unwritten_extents()
3962 ext4_ext_show_leaf(inode, path); in ext4_ext_handle_unwritten_extents()
4011 struct ext4_ext_path *path) in get_implied_cluster_alloc() argument
4057 ext4_lblk_t next = ext4_ext_next_allocated_block(path); in get_implied_cluster_alloc()
4091 struct ext4_ext_path *path = NULL; in ext4_ext_map_blocks() local
4105 path = ext4_find_extent(inode, map->m_lblk, NULL, 0); in ext4_ext_map_blocks()
4106 if (IS_ERR(path)) { in ext4_ext_map_blocks()
4107 err = PTR_ERR(path); in ext4_ext_map_blocks()
4108 path = NULL; in ext4_ext_map_blocks()
4119 if (unlikely(path[depth].p_ext == NULL && depth != 0)) { in ext4_ext_map_blocks()
4123 path[depth].p_block); in ext4_ext_map_blocks()
4128 ex = path[depth].p_ext; in ext4_ext_map_blocks()
4158 inode, map, &path, &allocated); in ext4_ext_map_blocks()
4166 ext4_ext_show_leaf(inode, path); in ext4_ext_map_blocks()
4171 handle, inode, map, &path, flags, in ext4_ext_map_blocks()
4189 hole_len = ext4_ext_determine_hole(inode, path, &hole_start); in ext4_ext_map_blocks()
4216 get_implied_cluster_alloc(inode->i_sb, map, ex, path)) { in ext4_ext_map_blocks()
4224 err = ext4_ext_search_left(inode, path, &ar.lleft, &ar.pleft); in ext4_ext_map_blocks()
4228 err = ext4_ext_search_right(inode, path, &ar.lright, &ar.pright, &ex2); in ext4_ext_map_blocks()
4235 get_implied_cluster_alloc(inode->i_sb, map, &ex2, path)) { in ext4_ext_map_blocks()
4256 err = ext4_ext_check_overlap(sbi, inode, &newex, path); in ext4_ext_map_blocks()
4264 ar.goal = ext4_ext_find_goal(inode, path, map->m_lblk); in ext4_ext_map_blocks()
4310 err = ext4_ext_insert_extent(handle, inode, &path, &newex, flags); in ext4_ext_map_blocks()
4380 ext4_ext_show_leaf(inode, path); in ext4_ext_map_blocks()
4382 ext4_ext_drop_refs(path); in ext4_ext_map_blocks()
4383 kfree(path); in ext4_ext_map_blocks()
5018 * Shift the extents of a path structure lying between path[depth].p_ext
5019 * and EXT_LAST_EXTENT(path[depth].p_hdr), by @shift blocks. @SHIFT tells
5023 ext4_ext_shift_path_extents(struct ext4_ext_path *path, ext4_lblk_t shift, in ext4_ext_shift_path_extents() argument
5031 depth = path->p_depth; in ext4_ext_shift_path_extents()
5034 if (depth == path->p_depth) { in ext4_ext_shift_path_extents()
5035 ex_start = path[depth].p_ext; in ext4_ext_shift_path_extents()
5039 ex_last = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_path_extents()
5042 if (ex_start == EXT_FIRST_EXTENT(path[depth].p_hdr)) { in ext4_ext_shift_path_extents()
5057 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5067 EXT_FIRST_EXTENT(path[depth].p_hdr)) in ext4_ext_shift_path_extents()
5070 path, ex_start - 1)) in ext4_ext_shift_path_extents()
5076 ext4_ext_try_to_merge_right(inode, path, in ext4_ext_shift_path_extents()
5081 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5090 err = ext4_ext_get_access(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5095 le32_add_cpu(&path[depth].p_idx->ei_block, -shift); in ext4_ext_shift_path_extents()
5097 le32_add_cpu(&path[depth].p_idx->ei_block, shift); in ext4_ext_shift_path_extents()
5098 err = ext4_ext_dirty(handle, inode, path + depth); in ext4_ext_shift_path_extents()
5103 if (path[depth].p_idx != EXT_FIRST_INDEX(path[depth].p_hdr)) in ext4_ext_shift_path_extents()
5125 struct ext4_ext_path *path; in ext4_ext_shift_extents() local
5131 /* Let path point to the last extent */ in ext4_ext_shift_extents()
5132 path = ext4_find_extent(inode, EXT_MAX_BLOCKS - 1, NULL, in ext4_ext_shift_extents()
5134 if (IS_ERR(path)) in ext4_ext_shift_extents()
5135 return PTR_ERR(path); in ext4_ext_shift_extents()
5137 depth = path->p_depth; in ext4_ext_shift_extents()
5138 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5150 path = ext4_find_extent(inode, start - 1, &path, in ext4_ext_shift_extents()
5152 if (IS_ERR(path)) in ext4_ext_shift_extents()
5153 return PTR_ERR(path); in ext4_ext_shift_extents()
5154 depth = path->p_depth; in ext4_ext_shift_extents()
5155 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5198 path = ext4_find_extent(inode, *iterator, &path, in ext4_ext_shift_extents()
5200 if (IS_ERR(path)) in ext4_ext_shift_extents()
5201 return PTR_ERR(path); in ext4_ext_shift_extents()
5202 depth = path->p_depth; in ext4_ext_shift_extents()
5203 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5212 if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) { in ext4_ext_shift_extents()
5213 path[depth].p_ext++; in ext4_ext_shift_extents()
5215 *iterator = ext4_ext_next_allocated_block(path); in ext4_ext_shift_extents()
5222 extent = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5226 extent = EXT_FIRST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5232 /* Update path extent in case we need to stop */ in ext4_ext_shift_extents()
5235 path[depth].p_ext = extent; in ext4_ext_shift_extents()
5237 ret = ext4_ext_shift_path_extents(path, shift, inode, in ext4_ext_shift_extents()
5246 ext4_ext_drop_refs(path); in ext4_ext_shift_extents()
5247 kfree(path); in ext4_ext_shift_extents()
5406 struct ext4_ext_path *path; in ext4_insert_range() local
5500 path = ext4_find_extent(inode, offset_lblk, NULL, 0); in ext4_insert_range()
5501 if (IS_ERR(path)) { in ext4_insert_range()
5507 extent = path[depth].p_ext; in ext4_insert_range()
5521 ret = ext4_split_extent_at(handle, inode, &path, in ext4_insert_range()
5528 ext4_ext_drop_refs(path); in ext4_insert_range()
5529 kfree(path); in ext4_insert_range()
5535 ext4_ext_drop_refs(path); in ext4_insert_range()
5536 kfree(path); in ext4_insert_range()
5686 * path must to be revalidated. */ in ext4_swap_extents()
5712 * path must to be revalidated. */ in ext4_swap_extents()
5781 struct ext4_ext_path *path; in ext4_clu_mapped() local
5787 path = ext4_find_extent(inode, EXT4_C2B(sbi, lclu), NULL, 0); in ext4_clu_mapped()
5788 if (IS_ERR(path)) { in ext4_clu_mapped()
5789 err = PTR_ERR(path); in ext4_clu_mapped()
5790 path = NULL; in ext4_clu_mapped()
5801 if (unlikely(path[depth].p_ext == NULL && depth != 0)) { in ext4_clu_mapped()
5805 depth, path[depth].p_block); in ext4_clu_mapped()
5810 extent = path[depth].p_ext; in ext4_clu_mapped()
5831 first_lblk = ext4_ext_next_allocated_block(path); in ext4_clu_mapped()
5839 ext4_ext_drop_refs(path); in ext4_clu_mapped()
5840 kfree(path); in ext4_clu_mapped()
5850 * replay path. Returns 0 on success and error on failure.
5855 struct ext4_ext_path *path = NULL, *ppath; in ext4_ext_replay_update_ex() local
5859 path = ext4_find_extent(inode, start, NULL, 0); in ext4_ext_replay_update_ex()
5860 if (IS_ERR(path)) in ext4_ext_replay_update_ex()
5861 return PTR_ERR(path); in ext4_ext_replay_update_ex()
5862 ex = path[path->p_depth].p_ext; in ext4_ext_replay_update_ex()
5871 ppath = path; in ext4_ext_replay_update_ex()
5877 kfree(path); in ext4_ext_replay_update_ex()
5878 path = ext4_find_extent(inode, start, NULL, 0); in ext4_ext_replay_update_ex()
5879 if (IS_ERR(path)) in ext4_ext_replay_update_ex()
5881 ppath = path; in ext4_ext_replay_update_ex()
5882 ex = path[path->p_depth].p_ext; in ext4_ext_replay_update_ex()
5891 kfree(path); in ext4_ext_replay_update_ex()
5892 path = ext4_find_extent(inode, start, NULL, 0); in ext4_ext_replay_update_ex()
5893 if (IS_ERR(path)) in ext4_ext_replay_update_ex()
5895 ex = path[path->p_depth].p_ext; in ext4_ext_replay_update_ex()
5904 ret = ext4_ext_dirty(NULL, inode, &path[path->p_depth]); in ext4_ext_replay_update_ex()
5907 ext4_ext_drop_refs(path); in ext4_ext_replay_update_ex()
5908 kfree(path); in ext4_ext_replay_update_ex()
5916 struct ext4_ext_path *path = NULL; in ext4_ext_replay_shrink_inode() local
5921 path = ext4_find_extent(inode, cur, NULL, 0); in ext4_ext_replay_shrink_inode()
5922 if (IS_ERR(path)) in ext4_ext_replay_shrink_inode()
5924 ex = path[path->p_depth].p_ext; in ext4_ext_replay_shrink_inode()
5926 ext4_ext_drop_refs(path); in ext4_ext_replay_shrink_inode()
5927 kfree(path); in ext4_ext_replay_shrink_inode()
5935 ext4_ext_try_to_merge(NULL, inode, path, ex); in ext4_ext_replay_shrink_inode()
5937 ext4_ext_dirty(NULL, inode, &path[path->p_depth]); in ext4_ext_replay_shrink_inode()
5940 ext4_ext_drop_refs(path); in ext4_ext_replay_shrink_inode()
5941 kfree(path); in ext4_ext_replay_shrink_inode()
5966 struct ext4_ext_path *path = NULL, *path2 = NULL; in ext4_ext_replay_set_iblocks() local
5974 path = ext4_find_extent(inode, EXT_MAX_BLOCKS - 1, NULL, in ext4_ext_replay_set_iblocks()
5976 if (IS_ERR(path)) in ext4_ext_replay_set_iblocks()
5977 return PTR_ERR(path); in ext4_ext_replay_set_iblocks()
5978 ex = path[path->p_depth].p_ext; in ext4_ext_replay_set_iblocks()
5980 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
5981 kfree(path); in ext4_ext_replay_set_iblocks()
5985 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
5986 kfree(path); in ext4_ext_replay_set_iblocks()
6004 * their paths. When path is different for 2 successive extents in ext4_ext_replay_set_iblocks()
6005 * we compare the blocks in the path at each level and increment in ext4_ext_replay_set_iblocks()
6012 path = ext4_find_extent(inode, cur, NULL, 0); in ext4_ext_replay_set_iblocks()
6013 if (IS_ERR(path)) in ext4_ext_replay_set_iblocks()
6015 numblks += path->p_depth; in ext4_ext_replay_set_iblocks()
6016 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
6017 kfree(path); in ext4_ext_replay_set_iblocks()
6019 path = ext4_find_extent(inode, cur, NULL, 0); in ext4_ext_replay_set_iblocks()
6020 if (IS_ERR(path)) in ext4_ext_replay_set_iblocks()
6022 ex = path[path->p_depth].p_ext; in ext4_ext_replay_set_iblocks()
6024 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
6025 kfree(path); in ext4_ext_replay_set_iblocks()
6032 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
6033 kfree(path); in ext4_ext_replay_set_iblocks()
6038 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
6039 kfree(path); in ext4_ext_replay_set_iblocks()
6043 for (i = 0; i <= max(path->p_depth, path2->p_depth); i++) { in ext4_ext_replay_set_iblocks()
6045 if (i <= path->p_depth) in ext4_ext_replay_set_iblocks()
6046 cmp1 = path[i].p_bh ? in ext4_ext_replay_set_iblocks()
6047 path[i].p_bh->b_blocknr : 0; in ext4_ext_replay_set_iblocks()
6054 ext4_ext_drop_refs(path); in ext4_ext_replay_set_iblocks()
6056 kfree(path); in ext4_ext_replay_set_iblocks()
6068 struct ext4_ext_path *path = NULL; in ext4_ext_clear_bb() local
6075 path = ext4_find_extent(inode, EXT_MAX_BLOCKS - 1, NULL, in ext4_ext_clear_bb()
6077 if (IS_ERR(path)) in ext4_ext_clear_bb()
6078 return PTR_ERR(path); in ext4_ext_clear_bb()
6079 ex = path[path->p_depth].p_ext; in ext4_ext_clear_bb()
6081 ext4_ext_drop_refs(path); in ext4_ext_clear_bb()
6082 kfree(path); in ext4_ext_clear_bb()
6086 ext4_ext_drop_refs(path); in ext4_ext_clear_bb()
6087 kfree(path); in ext4_ext_clear_bb()
6097 path = ext4_find_extent(inode, map.m_lblk, NULL, 0); in ext4_ext_clear_bb()
6098 if (!IS_ERR_OR_NULL(path)) { in ext4_ext_clear_bb()
6099 for (j = 0; j < path->p_depth; j++) { in ext4_ext_clear_bb()
6102 path[j].p_block, 1, 0); in ext4_ext_clear_bb()
6104 ext4_ext_drop_refs(path); in ext4_ext_clear_bb()
6105 kfree(path); in ext4_ext_clear_bb()