Lines Matching full:extent

40  * used by extent splitting.
168 * The extent buffer's verified bit will be set again in in ext4_ext_get_access()
488 error_msg = "invalid extent entries"; in __ext4_ext_check()
495 /* Verify checksum on non-root extent tree nodes */ in __ext4_ext_check()
498 error_msg = "extent tree corrupted"; in __ext4_ext_check()
506 "pblk %llu bad header/extent: %s - magic %x, " in __ext4_ext_check()
600 * This function is called to cache a file's extent information in the
601 * extent status tree
611 return 0; /* not an extent-mapped inode */ in ext4_ext_precache()
618 /* Don't cache anything if there are no external extent blocks */ in ext4_ext_precache()
811 * binary search for closest extent of the given block
903 EXT4_ERROR_INODE(inode, "inode has invalid extent depth: %d", in ext4_find_extent()
955 /* find extent */ in ext4_find_extent()
1074 /* FIXME: now decision is simplest: at current extent */ in ext4_ext_split()
1155 /* start copy from next extent */ in ext4_ext_split()
1165 /* zero out unused area in the extent block */ in ext4_ext_split()
1250 /* zero out unused area in the extent block */ in ext4_ext_split()
1350 /* zero out unused area in the extent block */ in ext4_ext_grow_indepth()
1376 /* Root extent block becomes index block */ in ext4_ext_grow_indepth()
1485 /* usually extent in the path covers blocks smaller in ext4_ext_search_left()
1486 * then *logical, but it can be that extent is the in ext4_ext_search_left()
1553 /* usually extent in the path covers blocks smaller in ext4_ext_search_right()
1554 * then *logical, but it can be that extent is the in ext4_ext_search_right()
1634 * returns allocated block in subsequent extent or EXT_MAX_BLOCKS.
1699 * if leaf gets modified and modified extent is first in the leaf,
1819 * This function tries to merge the "ex" extent to the next extent in the tree.
1840 /* merge with next extent! */ in ext4_ext_try_to_merge_right()
1864 * an extent tree with a single extent tree leaf block into the inode.
1881 * group descriptor to release the extent tree block. If we in ext4_ext_try_to_merge_up()
1889 * Copy the extent data up to the inode in ext4_ext_try_to_merge_up()
1909 * This function tries to merge the @ex extent to neighbours in the tree, then
1910 * tries to collapse the extent tree into the inode.
1935 * check if a portion of the "newext" extent overlaps with an
1936 * existing extent.
1959 * get the next allocated block if the extent in the path in ext4_ext_check_overlap()
1969 /* check for wrap through zero on extent logical start block*/ in ext4_ext_check_overlap()
1987 * tries to merge requested extent into the existing extent or
1988 * inserts requested extent as new one into the tree,
1998 struct ext4_extent *nearex; /* nearest extent */ in ext4_ext_insert_extent()
2022 /* try to insert block into found extent and return */ in ext4_ext_insert_extent()
2026 * Try to see whether we should rather test the extent on in ext4_ext_insert_extent()
2028 * ext4_find_extent() can return either extent on the in ext4_ext_insert_extent()
2150 /* there is no extent in this leaf, create first one */ in ext4_ext_insert_extent()
2151 ext_debug(inode, "first extent in the leaf: %u:%llu:[%d]%d\n", in ext4_ext_insert_extent()
2270 * @path: path in extent tree to @lblk
2275 * actually points to extent before @lblk, we provide it.
2290 /* there is no extent yet, so gap is [0;-] */ in ext4_ext_find_hole()
2374 * This routine returns max. credits that needed to insert an extent
2375 * to the extent tree.
2410 * If we add a single extent, then in the worse case, each tree level
2425 * Extent tree can change between the time we estimate credits and in ext4_ext_index_trans_blocks()
2489 /* only extent tail removal is allowed */ in ext4_remove_blocks()
2515 * cluster of the last block in the extent, we free it in ext4_remove_blocks()
2538 * We free the partial cluster at the end of the extent (if any), in ext4_remove_blocks()
2539 * unless the cluster is used by another extent (partial_cluster in ext4_remove_blocks()
2541 * shared with the last block in the extent. in ext4_remove_blocks()
2564 * at the beginning of the extent. Instead, we check to see if we in ext4_remove_blocks()
2576 * If we've freed the entire extent but the beginning is not left in ext4_remove_blocks()
2578 * record the partial cluster at the beginning of the extent. It in ext4_remove_blocks()
2581 * (not shared with another extent). Else, reset the partial in ext4_remove_blocks()
2583 * extent is left cluster aligned. in ext4_remove_blocks()
2601 * and "end" must appear in the same extent or EIO is returned.
2667 /* If this extent is beyond the end of the hole, skip it */ in ext4_ext_rm_leaf()
2670 * We're going to skip this extent and move to another, in ext4_ext_rm_leaf()
2688 "on extent %u:%u", in ext4_ext_rm_leaf()
2694 /* remove tail of the extent */ in ext4_ext_rm_leaf()
2697 /* remove whole extent: excellent! */ in ext4_ext_rm_leaf()
2739 /* this extent is removed; mark slot entirely unused */ in ext4_ext_rm_leaf()
2745 * extent have been removed. in ext4_ext_rm_leaf()
2750 * If the extent was completely released, in ext4_ext_rm_leaf()
2757 * extents up when an extent is removed so that in ext4_ext_rm_leaf()
2774 ext_debug(inode, "new extent: %u:%u:%llu\n", ex_ee_block, num, in ext4_ext_rm_leaf()
2785 * If there's a partial cluster and at least one extent remains in in ext4_ext_rm_leaf()
2787 * current extent. If it is shared with the current extent in ext4_ext_rm_leaf()
2854 /* probably first extent we're gonna free will be last in block */ in ext4_ext_remove_space()
2865 * Check if we are removing extents inside the extent tree. If that in ext4_ext_remove_space()
2866 * is the case, we are going to punch a hole inside the extent tree in ext4_ext_remove_space()
2867 * so we have to check whether we need to split the extent covering in ext4_ext_remove_space()
2876 /* find extent for or closest extent to this block */ in ext4_ext_remove_space()
2899 * See if the last block is inside the extent, if so split in ext4_ext_remove_space()
2900 * the extent at 'end' block so we can easily remove the in ext4_ext_remove_space()
2901 * tail of the first part of the split extent in in ext4_ext_remove_space()
2907 * If we're going to split the extent, note that in ext4_ext_remove_space()
2918 * Split the extent in two so that 'end' is the last in ext4_ext_remove_space()
2919 * block in the first new extent. Also we should not in ext4_ext_remove_space()
2932 * If we're punching, there's an extent to the right. in ext4_ext_remove_space()
2934 * that extent's first cluster and its state to nofree in ext4_ext_remove_space()
2939 * extent removal is not lost. in ext4_ext_remove_space()
3021 /* Yield here to deal with large extent trees. in ext4_ext_remove_space()
3053 * if there's a partial cluster and we have removed the first extent in ext4_ext_remove_space()
3176 * ext4_split_extent_at() splits an extent at given block.
3180 * @path: the path to the extent
3181 * @split: the logical block where the extent is splitted.
3182 * @flags: flags used to insert new extent to extent tree.
3185 * Splits extent [a, b] into two extents [a, @split) and [@split, b], states
3186 * of which are same as the original extent. No conversion is performed.
3188 * Return an extent path pointer on success, or an error pointer on failure. On
3189 * failure, the extent is restored to original state.
3262 * Get a new path to try to zeroout or fix the extent length. in ext4_split_extent_at()
3271 EXT4_ERROR_INODE(inode, "Failed split extent on %u, err %ld", in ext4_split_extent_at()
3280 "bad extent address lblock: %lu, depth: %d pblock %llu", in ext4_split_extent_at()
3399 * ext4_split_extent() splits an extent and mark extent which is covered
3402 * It may result in splitting the extent into multiple extents (up to three)
3405 * b> Splits in two extents: Split is happening at either end of the extent
3406 * c> Splits in three extents: Somone is splitting in middle of the extent
3443 * may result in split of original leaf or extent zeroout. in ext4_split_extent()
3458 /* extent would have changed so update original values */ in ext4_split_extent()
3475 * There was an error in splitting the extent. So instead, just zeroout in ext4_split_extent()
3507 /* extent to zeroout should have been unchanged but its not */ in ext4_split_extent()
3538 * to an unwritten extent. It may result in splitting the unwritten
3539 * extent into multiple extents (up to three - one initialized and two
3542 * a> There is no split required: Entire extent should be initialized
3543 * b> Splits in two extents: Write is happening at either end of the extent
3544 * c> Splits in three extents: Somone is writing in middle of the extent
3547 * - The extent pointed to by 'path' is unwritten.
3548 * - The extent pointed to by 'path' contains a superset
3596 * unwritten extent to its neighbor. This is much cheaper in ext4_ext_convert_to_initialized()
3603 * - L1: we do not deal with writes covering the whole extent. in ext4_ext_convert_to_initialized()
3604 * This would require removing the extent if the transfer in ext4_ext_convert_to_initialized()
3606 * - L2: we only attempt to merge with an extent stored in the in ext4_ext_convert_to_initialized()
3607 * same extent tree node. in ext4_ext_convert_to_initialized()
3707 /* Update path to point to the right extent */ in ext4_ext_convert_to_initialized()
3717 * It is safe to convert extent to initialized via explicit in ext4_ext_convert_to_initialized()
3718 * zeroout only if extent is fully inside i_size or new_size. in ext4_ext_convert_to_initialized()
3726 * 1. split the extent into three extents. in ext4_ext_convert_to_initialized()
3727 * 2. split the extent into two extents, zeroout the head of the first in ext4_ext_convert_to_initialized()
3728 * extent. in ext4_ext_convert_to_initialized()
3729 * 3. split the extent into two extents, zeroout the tail of the second in ext4_ext_convert_to_initialized()
3730 * extent. in ext4_ext_convert_to_initialized()
3731 * 4. split the extent into two extents with out zeroout. in ext4_ext_convert_to_initialized()
3733 * tail of the extent. in ext4_ext_convert_to_initialized()
3793 * to an unwritten extent.
3795 * Writing to an unwritten extent may result in splitting the unwritten
3796 * extent into multiple initialized/unwritten extents (up to three)
3798 * a> There is no split required: Entire extent should be unwritten
3799 * b> Splits in two extents: Write is happening at either end of the extent
3800 * c> Splits in three extents: Somone is writing in middle of the extent
3804 * One of more index blocks maybe needed if the extent tree grow after
3805 * the unwritten extent split. To prevent ENOSPC occur at the IO
3806 * complete, we need to split the unwritten extent before DIO submit
3807 * the IO. The unwritten extent called at this time will be split
3808 * into three unwritten extent(at most). After IO complete, the part
3812 * The size of unwritten extent to be written is passed to the caller via the
3813 * allocated pointer. Return an extent path pointer on success, or an error
3846 * It is only safe to convert extent to initialized via explicit in ext4_split_convert_extents()
3847 * zeroout only if extent is fully inside i_size or new_size. in ext4_split_convert_extents()
3894 /* Lets update the extent status tree after conversion */ in ext4_split_convert_extents()
3948 * Make sure that the extent is no bigger than we support with in convert_initialized_extent()
3949 * unwritten extent in convert_initialized_extent()
3972 * The extent might be initialized in case of zeroout. in convert_initialized_extent()
4006 * allocate metadata blocks for the new extent block if needed. in ext4_ext_handle_unwritten_extents()
4013 /* IO end_io complete, convert the filled extent to written */ in ext4_ext_handle_unwritten_extents()
4025 * we already have an unwritten extent in ext4_ext_handle_unwritten_extents()
4048 * discovered unwritten extent to written. in ext4_ext_handle_unwritten_extents()
4056 * shouldn't get a 0 allocated when converting an unwritten extent in ext4_ext_handle_unwritten_extents()
4057 * unless m_len is 0 (bug) or extent has been corrupted in ext4_ext_handle_unwritten_extents()
4085 * allocated in an extent.
4088 * @ex The extent structure which might contain an implied
4092 * find blocks that were already in the inode's extent tree. Hence,
4094 * the extent from the inode's extent tree. There are three cases we
4098 * |--- extent ---| |---- requested region ---|
4104 * |--- requested region --| |------- extent ----|
4115 * map->m_len so it corresponds to the return the extent labelled as
4136 /* The extent passed in that we are trying to match */ in get_implied_cluster_alloc()
4154 * |------- extent ----| in get_implied_cluster_alloc()
4188 * it into the extent cache tree if it's indeed a hole, finally return
4189 * the length of the determined extent.
4207 * There's a delalloc extent in the hole, handle it if the delalloc in ext4_ext_determine_insert_hole()
4208 * extent is in front of, behind and straddle the queried range. in ext4_ext_determine_insert_hole()
4212 * The delalloc extent is in front of the queried range, in ext4_ext_determine_insert_hole()
4220 * The delalloc extent containing lblk, it must have been in ext4_ext_determine_insert_hole()
4221 * added after ext4_map_blocks() checked the extent status in ext4_ext_determine_insert_hole()
4224 * soon. Don't modify the extent status tree and report in ext4_ext_determine_insert_hole()
4225 * extent as a hole, just adjust the length to the delalloc in ext4_ext_determine_insert_hole()
4226 * extent's after lblk. in ext4_ext_determine_insert_hole()
4232 * The delalloc extent is partially or completely behind in ext4_ext_determine_insert_hole()
4234 * beginning of the delalloc extent. in ext4_ext_determine_insert_hole()
4285 /* find extent for this block */ in ext4_ext_map_blocks()
4300 EXT4_ERROR_INODE(inode, "bad extent address " in ext4_ext_map_blocks()
4323 /* if found extent covers block, simply return it */ in ext4_ext_map_blocks()
4326 /* number of remaining blocks in the extent */ in ext4_ext_map_blocks()
4332 * If the extent is initialized check whether the in ext4_ext_map_blocks()
4382 * If we are doing bigalloc, check to see if the extent returned in ext4_ext_map_blocks()
4403 /* Check if the extent after searching to the right implies a in ext4_ext_map_blocks()
4415 * a single extent. For an initialized extent this limit is in ext4_ext_map_blocks()
4416 * EXT_INIT_MAX_LEN and for an unwritten extent this limit is in ext4_ext_map_blocks()
4426 /* Check if we can really insert (m_lblk)::(m_lblk + m_len) extent */ in ext4_ext_map_blocks()
4472 /* try to insert new extent into found leaf and return */ in ext4_ext_map_blocks()
4508 * Cache the extent and update transaction to commit on fdatasync only in ext4_ext_map_blocks()
4509 * when it is _not_ an unwritten extent. in ext4_ext_map_blocks()
4593 * Don't normalize the request if it can fit in one extent so in ext4_alloc_file_blocks()
4602 * costs a lot. First allocate an unwritten extent and then in ext4_alloc_file_blocks()
4612 * credits to insert 1 extent into extent tree in ext4_alloc_file_blocks()
4627 * Recalculate credits when extent tree depth changes. in ext4_alloc_file_blocks()
4817 /* We only support preallocation for extent-based files only. */ in ext4_do_fallocate()
4946 * unwritten extents either on a hole on a pre-exiting unwritten extent range in
4949 * unwritten extent between two leaf nodes which was cached in extent status
4951 * ext4_map_blocks_atomic_write() to return the unwritten extent range w/o going
4953 * unwritten extent split across leaf block within a single journal transaction.
4974 * TODO: An optimization can be added later by having an extent in ext4_convert_unwritten_extents_atomic()
4976 * it can tell if the extent in the cache is a split extent. in ext4_convert_unwritten_extents_atomic()
5047 * credits to insert 1 extent into extent tree in ext4_convert_unwritten_extents()
5064 * i_rwsem or invalidate_lock, which could corrupt the extent in ext4_convert_unwritten_extents()
5097 * smaller transactions for conversion of each extent separately. in ext4_convert_unwritten_io_end_vec()
5271 * Walk the extent tree gathering extent information in ext4_get_es_cache()
5305 /* extent tree + sb + inode */ in ext4_ext_shift_path_extents()
5388 struct ext4_extent *extent; in ext4_ext_shift_extents() local
5392 /* Let path point to the last extent */ in ext4_ext_shift_extents()
5399 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5400 if (!extent) in ext4_ext_shift_extents()
5403 stop = le32_to_cpu(extent->ee_block); in ext4_ext_shift_extents()
5407 * accommodate the shift. For right shifts, make sure the last extent in ext4_ext_shift_extents()
5416 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5417 if (extent) { in ext4_ext_shift_extents()
5418 ex_start = le32_to_cpu(extent->ee_block); in ext4_ext_shift_extents()
5419 ex_end = le32_to_cpu(extent->ee_block) + in ext4_ext_shift_extents()
5420 ext4_ext_get_actual_len(extent); in ext4_ext_shift_extents()
5433 (stop + ext4_ext_get_actual_len(extent))) { in ext4_ext_shift_extents()
5456 * in case of right shift if extent with 0 block is reached, iterator in ext4_ext_shift_extents()
5465 extent = path[depth].p_ext; in ext4_ext_shift_extents()
5466 if (!extent) { in ext4_ext_shift_extents()
5473 le32_to_cpu(extent->ee_block)) { in ext4_ext_shift_extents()
5474 /* Hole, move to the next extent */ in ext4_ext_shift_extents()
5475 if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) { in ext4_ext_shift_extents()
5485 extent = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5486 *iterator = le32_to_cpu(extent->ee_block) + in ext4_ext_shift_extents()
5487 ext4_ext_get_actual_len(extent); in ext4_ext_shift_extents()
5489 extent = EXT_FIRST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5490 if (le32_to_cpu(extent->ee_block) > start) in ext4_ext_shift_extents()
5491 *iterator = le32_to_cpu(extent->ee_block) - 1; in ext4_ext_shift_extents()
5492 else if (le32_to_cpu(extent->ee_block) == start) in ext4_ext_shift_extents()
5495 extent = EXT_LAST_EXTENT(path[depth].p_hdr); in ext4_ext_shift_extents()
5496 while (le32_to_cpu(extent->ee_block) >= start) in ext4_ext_shift_extents()
5497 extent--; in ext4_ext_shift_extents()
5499 if (extent == EXT_LAST_EXTENT(path[depth].p_hdr)) in ext4_ext_shift_extents()
5502 extent++; in ext4_ext_shift_extents()
5505 path[depth].p_ext = extent; in ext4_ext_shift_extents()
5540 /* Currently just for extent based files */ in ext4_collapse_range()
5633 struct ext4_extent *extent; in ext4_insert_range() local
5642 /* Currently just for extent based files */ in ext4_insert_range()
5696 extent = path[depth].p_ext; in ext4_insert_range()
5697 if (extent) { in ext4_insert_range()
5698 ee_start_lblk = le32_to_cpu(extent->ee_block); in ext4_insert_range()
5699 ee_len = ext4_ext_get_actual_len(extent); in ext4_insert_range()
5702 * If start_lblk is not the starting block of extent, split in ext4_insert_range()
5703 * the extent @start_lblk in ext4_insert_range()
5755 * extent's data copying must be performed by caller.
5811 /* if hole after extent, then go to next extent */ in ext4_swap_extents()
5814 /* If hole before extent, then shift to that extent */ in ext4_swap_extents()
5853 /* ext4_split_extent_at() may result in leaf extent split, in ext4_swap_extents()
5883 /* ext4_split_extent_at() may result in leaf extent split, in ext4_swap_extents()
5953 struct ext4_extent *extent; in ext4_clu_mapped() local
5965 /* search for the extent closest to the first block in the cluster */ in ext4_clu_mapped()
5979 "bad extent address - lblock: %lu, depth: %d, pblock: %lld", in ext4_clu_mapped()
5986 extent = path[depth].p_ext; in ext4_clu_mapped()
5988 /* can't be mapped if the extent tree is empty */ in ext4_clu_mapped()
5989 if (extent == NULL) in ext4_clu_mapped()
5992 first_lblk = le32_to_cpu(extent->ee_block); in ext4_clu_mapped()
5996 * Three possible outcomes at this point - found extent spanning in ext4_clu_mapped()
6003 ext4_ext_get_actual_len(extent) - 1); in ext4_clu_mapped()
6021 * Updates physical block address and unwritten status of extent
6022 * starting at lblk start and of len. If such an extent doesn't exist,
6023 * this function splits the extent tree appropriately to create an
6024 * extent like this. This function is called in the fast commit
6045 /* We need to split this extent to match our extent first */ in ext4_ext_replay_update_ex()
6091 /* Try to shrink the extent tree */
6173 * Count the number of extent tree blocks. We do it by looking up in ext4_ext_replay_set_iblocks()