Lines Matching defs:extent
40 * used by extent splitting.
168 * The extent buffer's verified bit will be set again in
488 error_msg = "invalid extent entries";
495 /* Verify checksum on non-root extent tree nodes */
498 error_msg = "extent tree corrupted";
506 "pblk %llu bad header/extent: %s - magic %x, "
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 */
618 /* Don't cache anything if there are no external extent blocks */
811 * binary search for closest extent of the given block
903 EXT4_ERROR_INODE(inode, "inode has invalid extent depth: %d",
955 /* find extent */
1074 /* FIXME: now decision is simplest: at current extent */
1155 /* start copy from next extent */
1165 /* zero out unused area in the extent block */
1250 /* zero out unused area in the extent block */
1350 /* zero out unused area in the extent block */
1376 /* Root extent block becomes index block */
1485 /* usually extent in the path covers blocks smaller
1486 * then *logical, but it can be that extent is the
1553 /* usually extent in the path covers blocks smaller
1554 * then *logical, but it can be that extent is the
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! */
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
1889 * Copy the extent data up to the inode
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
1969 /* check for wrap through zero on extent logical start block*/
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 */
2022 /* try to insert block into found extent and return */
2026 * Try to see whether we should rather test the extent on
2028 * ext4_find_extent() can return either extent on the
2150 /* there is no extent in this leaf, create first one */
2151 ext_debug(inode, "first extent in the leaf: %u:%llu:[%d]%d\n",
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;-] */
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
2489 /* only extent tail removal is allowed */
2515 * cluster of the last block in the extent, we free it
2538 * We free the partial cluster at the end of the extent (if any),
2539 * unless the cluster is used by another extent (partial_cluster
2541 * shared with the last block in the extent.
2564 * at the beginning of the extent. Instead, we check to see if we
2576 * If we've freed the entire extent but the beginning is not left
2578 * record the partial cluster at the beginning of the extent. It
2581 * (not shared with another extent). Else, reset the partial
2583 * extent is left cluster aligned.
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 */
2670 * We're going to skip this extent and move to another,
2688 "on extent %u:%u",
2694 /* remove tail of the extent */
2697 /* remove whole extent: excellent! */
2739 /* this extent is removed; mark slot entirely unused */
2745 * extent have been removed.
2750 * If the extent was completely released,
2757 * extents up when an extent is removed so that
2774 ext_debug(inode, "new extent: %u:%u:%llu\n", ex_ee_block, num,
2785 * If there's a partial cluster and at least one extent remains in
2787 * current extent. If it is shared with the current extent
2854 /* probably first extent we're gonna free will be last in block */
2865 * Check if we are removing extents inside the extent tree. If that
2866 * is the case, we are going to punch a hole inside the extent tree
2867 * so we have to check whether we need to split the extent covering
2876 /* find extent for or closest extent to this block */
2899 * See if the last block is inside the extent, if so split
2900 * the extent at 'end' block so we can easily remove the
2901 * tail of the first part of the split extent in
2907 * If we're going to split the extent, note that
2918 * Split the extent in two so that 'end' is the last
2919 * block in the first new extent. Also we should not
2932 * If we're punching, there's an extent to the right.
2934 * that extent's first cluster and its state to nofree
2939 * extent removal is not lost.
3021 /* Yield here to deal with large extent trees.
3053 * if there's a partial cluster and we have removed the first extent
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.
3271 EXT4_ERROR_INODE(inode, "Failed split extent on %u, err %pe",
3280 "bad extent address lblock: %lu, depth: %d pblock %llu",
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.
3458 /* extent would have changed so update original values */
3475 * There was an error in splitting the extent. So instead, just zeroout
3507 /* extent to zeroout should have been unchanged but its not */
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
3603 * - L1: we do not deal with writes covering the whole extent.
3604 * This would require removing the extent if the transfer
3606 * - L2: we only attempt to merge with an extent stored in the
3607 * same extent tree node.
3707 /* Update path to point to the right extent */
3717 * It is safe to convert extent to initialized via explicit
3718 * zeroout only if extent is fully inside i_size or new_size.
3726 * 1. split the extent into three extents.
3727 * 2. split the extent into two extents, zeroout the head of the first
3728 * extent.
3729 * 3. split the extent into two extents, zeroout the tail of the second
3730 * extent.
3731 * 4. split the extent into two extents with out zeroout.
3733 * tail of the extent.
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
3847 * zeroout only if extent is fully inside i_size or new_size.
3894 /* Lets update the extent status tree after conversion */
3948 * Make sure that the extent is no bigger than we support with
3949 * unwritten extent
3972 * The extent might be initialized in case of zeroout.
4006 * allocate metadata blocks for the new extent block if needed.
4013 /* IO end_io complete, convert the filled extent to written */
4025 * we already have an unwritten extent
4048 * discovered unwritten extent to written.
4056 * shouldn't get a 0 allocated when converting an unwritten extent
4057 * unless m_len is 0 (bug) or extent has been corrupted
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 */
4154 * |------- extent ----|
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
4208 * extent is in front of, behind and straddle the queried range.
4212 * The delalloc extent is in front of the queried range,
4220 * The delalloc extent containing lblk, it must have been
4221 * added after ext4_map_blocks() checked the extent status
4224 * soon. Don't modify the extent status tree and report
4225 * extent as a hole, just adjust the length to the delalloc
4226 * extent's after lblk.
4232 * The delalloc extent is partially or completely behind
4234 * beginning of the delalloc extent.
4285 /* find extent for this block */
4300 EXT4_ERROR_INODE(inode, "bad extent address "
4323 /* if found extent covers block, simply return it */
4326 /* number of remaining blocks in the extent */
4332 * If the extent is initialized check whether the
4382 * If we are doing bigalloc, check to see if the extent returned
4403 /* Check if the extent after searching to the right implies a
4415 * a single extent. For an initialized extent this limit is
4416 * EXT_INIT_MAX_LEN and for an unwritten extent this limit is
4426 /* Check if we can really insert (m_lblk)::(m_lblk + m_len) extent */
4472 /* try to insert new extent into found leaf and return */
4508 * Cache the extent and update transaction to commit on fdatasync only
4509 * when it is _not_ an unwritten extent.
4593 * Don't normalize the request if it can fit in one extent so
4602 * costs a lot. First allocate an unwritten extent and then
4612 * credits to insert 1 extent into extent tree
4627 * Recalculate credits when extent tree depth changes.
4817 /* We only support preallocation for extent-based files only. */
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
4976 * it can tell if the extent in the cache is a split extent.
5047 * credits to insert 1 extent into extent tree
5064 * i_rwsem or invalidate_lock, which could corrupt the extent
5097 * smaller transactions for conversion of each extent separately.
5271 * Walk the extent tree gathering extent information
5305 /* extent tree + sb + inode */
5388 struct ext4_extent *extent;
5392 /* Let path point to the last extent */
5399 extent = path[depth].p_ext;
5400 if (!extent)
5403 stop = le32_to_cpu(extent->ee_block);
5407 * accommodate the shift. For right shifts, make sure the last extent
5416 extent = path[depth].p_ext;
5417 if (extent) {
5418 ex_start = le32_to_cpu(extent->ee_block);
5419 ex_end = le32_to_cpu(extent->ee_block) +
5420 ext4_ext_get_actual_len(extent);
5433 (stop + ext4_ext_get_actual_len(extent))) {
5456 * in case of right shift if extent with 0 block is reached, iterator
5465 extent = path[depth].p_ext;
5466 if (!extent) {
5473 le32_to_cpu(extent->ee_block)) {
5474 /* Hole, move to the next extent */
5475 if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) {
5485 extent = EXT_LAST_EXTENT(path[depth].p_hdr);
5486 *iterator = le32_to_cpu(extent->ee_block) +
5487 ext4_ext_get_actual_len(extent);
5489 extent = EXT_FIRST_EXTENT(path[depth].p_hdr);
5490 if (le32_to_cpu(extent->ee_block) > start)
5491 *iterator = le32_to_cpu(extent->ee_block) - 1;
5492 else if (le32_to_cpu(extent->ee_block) == start)
5495 extent = EXT_LAST_EXTENT(path[depth].p_hdr);
5496 while (le32_to_cpu(extent->ee_block) >= start)
5497 extent--;
5499 if (extent == EXT_LAST_EXTENT(path[depth].p_hdr))
5502 extent++;
5505 path[depth].p_ext = extent;
5540 /* Currently just for extent based files */
5633 struct ext4_extent *extent;
5642 /* Currently just for extent based files */
5696 extent = path[depth].p_ext;
5697 if (extent) {
5698 ee_start_lblk = le32_to_cpu(extent->ee_block);
5699 ee_len = ext4_ext_get_actual_len(extent);
5702 * If start_lblk is not the starting block of extent, split
5703 * the extent @start_lblk
5755 * extent's data copying must be performed by caller.
5811 /* if hole after extent, then go to next extent */
5814 /* If hole before extent, then shift to that extent */
5853 /* ext4_split_extent_at() may result in leaf extent split,
5883 /* ext4_split_extent_at() may result in leaf extent split,
5953 struct ext4_extent *extent;
5965 /* search for the extent closest to the first block in the cluster */
5979 "bad extent address - lblock: %lu, depth: %d, pblock: %lld",
5986 extent = path[depth].p_ext;
5988 /* can't be mapped if the extent tree is empty */
5989 if (extent == NULL)
5992 first_lblk = le32_to_cpu(extent->ee_block);
5996 * Three possible outcomes at this point - found extent spanning
6003 ext4_ext_get_actual_len(extent) - 1);
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 */
6091 /* Try to shrink the extent tree */
6173 * Count the number of extent tree blocks. We do it by looking up