Lines Matching defs:extent

39  * used by extent splitting.
166 * The extent buffer's verified bit will be set again in
487 error_msg = "invalid extent entries";
494 /* Verify checksum on non-root extent tree nodes */
497 error_msg = "extent tree corrupted";
505 "pblk %llu bad header/extent: %s - magic %x, "
597 * This function is called to cache a file's extent information in the
598 * extent status tree
608 return 0; /* not an extent-mapped inode */
613 /* Don't cache anything if there are no external extent blocks */
808 * binary search for closest extent of the given block
899 EXT4_ERROR_INODE(inode, "inode has invalid extent depth: %d",
952 /* find extent */
1073 /* FIXME: now decision is simplest: at current extent */
1154 /* start copy from next extent */
1164 /* zero out unused area in the extent block */
1249 /* zero out unused area in the extent block */
1349 /* zero out unused area in the extent block */
1375 /* Root extent block becomes index block */
1488 /* usually extent in the path covers blocks smaller
1489 * then *logical, but it can be that extent is the
1556 /* usually extent in the path covers blocks smaller
1557 * then *logical, but it can be that extent is the
1636 * returns allocated block in subsequent extent or EXT_MAX_BLOCKS.
1701 * if leaf gets modified and modified extent is first in the leaf,
1795 * This function tries to merge the "ex" extent to the next extent in the tree.
1816 /* merge with next extent! */
1840 * an extent tree with a single extent tree leaf block into the inode.
1857 * group descriptor to release the extent tree block. If we
1865 * Copy the extent data up to the inode
1885 * This function tries to merge the @ex extent to neighbours in the tree, then
1886 * tries to collapse the extent tree into the inode.
1911 * check if a portion of the "newext" extent overlaps with an
1912 * existing extent.
1935 * get the next allocated block if the extent in the path
1945 /* check for wrap through zero on extent logical start block*/
1963 * tries to merge requested extent into the existing extent or
1964 * inserts requested extent as new one into the tree,
1974 struct ext4_extent *nearex; /* nearest extent */
1994 /* try to insert block into found extent and return */
1998 * Try to see whether we should rather test the extent on
2000 * ext4_find_extent() can return either extent on the
2117 /* there is no extent in this leaf, create first one */
2118 ext_debug(inode, "first extent in the leaf: %u:%llu:[%d]%d\n",
2234 * @path: path in extent tree to @lblk
2239 * actually points to extent before @lblk, we provide it.
2254 /* there is no extent yet, so gap is [0;-] */
2328 * This routine returns max. credits that needed to insert an extent
2329 * to the extent tree.
2364 * If we add a single extent, then in the worse case, each tree level
2441 /* only extent tail removal is allowed */
2467 * cluster of the last block in the extent, we free it
2490 * We free the partial cluster at the end of the extent (if any),
2491 * unless the cluster is used by another extent (partial_cluster
2493 * shared with the last block in the extent.
2516 * at the beginning of the extent. Instead, we check to see if we
2528 * If we've freed the entire extent but the beginning is not left
2530 * record the partial cluster at the beginning of the extent. It
2533 * (not shared with another extent). Else, reset the partial
2535 * extent is left cluster aligned.
2553 * and "end" must appear in the same extent or EIO is returned.
2619 /* If this extent is beyond the end of the hole, skip it */
2622 * We're going to skip this extent and move to another,
2640 "on extent %u:%u",
2646 /* remove tail of the extent */
2649 /* remove whole extent: excellent! */
2691 /* this extent is removed; mark slot entirely unused */
2697 * extent have been removed.
2702 * If the extent was completely released,
2709 * extents up when an extent is removed so that
2726 ext_debug(inode, "new extent: %u:%u:%llu\n", ex_ee_block, num,
2737 * If there's a partial cluster and at least one extent remains in
2739 * current extent. If it is shared with the current extent
2805 /* probably first extent we're gonna free will be last in block */
2816 * Check if we are removing extents inside the extent tree. If that
2817 * is the case, we are going to punch a hole inside the extent tree
2818 * so we have to check whether we need to split the extent covering
2827 /* find extent for or closest extent to this block */
2851 * See if the last block is inside the extent, if so split
2852 * the extent at 'end' block so we can easily remove the
2853 * tail of the first part of the split extent in
2859 * If we're going to split the extent, note that
2870 * Split the extent in two so that 'end' is the last
2871 * block in the first new extent. Also we should not
2883 * If we're punching, there's an extent to the right.
2885 * that extent's first cluster and its state to nofree
2890 * extent removal is not lost.
2978 /* Yield here to deal with large extent trees.
3011 * if there's a partial cluster and we have removed the first extent
3132 * ext4_split_extent_at() splits an extent at given block.
3136 * @path: the path to the extent
3137 * @split: the logical block where the extent is splitted.
3138 * @split_flags: indicates if the extent could be zeroout if split fails, and
3140 * @flags: flags used to insert new extent to extent tree.
3143 * Splits extent [a, b] into two extents [a, @split) and [@split, b], states
3147 * a> the extent are splitted into two extent.
3148 * b> split is not needed, and just mark the extent.
3192 * case b: block @split is the block that the extent begins with
3193 * then we just change the state of the extent, and splitting
3260 /* update the extent length and mark as initialized */
3265 /* update extent status tree */
3268 * state the extent tree exactly is so don't try to fix
3269 * length of the original extent as it may do even more
3290 * ext4_split_extents() splits an extent and mark extent which is covered
3293 * It may result in splitting the extent into multiple extents (up to three)
3296 * b> Splits in two extents: Split is happening at either end of the extent
3297 * c> Splits in three extents: Somone is splitting in middle of the extent
3339 * result in split of original leaf or extent zeroout.
3373 * to an unwritten extent. It may result in splitting the unwritten
3374 * extent into multiple extents (up to three - one initialized and two
3377 * a> There is no split required: Entire extent should be initialized
3378 * b> Splits in two extents: Write is happening at either end of the extent
3379 * c> Splits in three extents: Somone is writing in middle of the extent
3382 * - The extent pointed to by 'path' is unwritten.
3383 * - The extent pointed to by 'path' contains a superset
3434 * unwritten extent to its neighbor. This is much cheaper
3441 * - L1: we do not deal with writes covering the whole extent.
3442 * This would require removing the extent if the transfer
3444 * - L2: we only attempt to merge with an extent stored in the
3445 * same extent tree node.
3544 /* Update path to point to the right extent */
3552 * It is safe to convert extent to initialized via explicit
3553 * zeroout only if extent is fully inside i_size or new_size.
3563 * 1. split the extent into three extents.
3564 * 2. split the extent into two extents, zeroout the head of the first
3565 * extent.
3566 * 3. split the extent into two extents, zeroout the tail of the second
3567 * extent.
3568 * 4. split the extent into two extents with out zeroout.
3570 * tail of the extent.
3628 * to an unwritten extent.
3630 * Writing to an unwritten extent may result in splitting the unwritten
3631 * extent into multiple initialized/unwritten extents (up to three)
3633 * a> There is no split required: Entire extent should be unwritten
3634 * b> Splits in two extents: Write is happening at either end of the extent
3635 * c> Splits in three extents: Somone is writing in middle of the extent
3639 * One of more index blocks maybe needed if the extent tree grow after
3640 * the unwritten extent split. To prevent ENOSPC occur at the IO
3641 * complete, we need to split the unwritten extent before DIO submit
3642 * the IO. The unwritten extent called at this time will be split
3643 * into three unwritten extent(at most). After IO complete, the part
3647 * Returns the size of unwritten extent to be written on success.
3670 * It is safe to convert extent to initialized via explicit
3671 * zeroout only if extent is fully inside i_size or new_size.
3711 /* If extent is larger than requested it is a clear sign that we still
3712 * have some extent state machine issues left. So extent_split is still
3719 ext4_warning(inode->i_sb, "Inode (%ld) finished: extent logical block %llu,"
3738 /* first mark the extent as initialized */
3746 /* Mark modified extent as dirty */
3767 * Make sure that the extent is no bigger than we support with
3768 * unwritten extent
3801 /* first mark the extent as unwritten */
3809 /* Mark modified extent as dirty */
3841 * allocate metadata blocks for the new extent block if needed.
3848 /* get_block() before submitting IO, split the extent */
3857 * shouldn't get a 0 return when splitting an extent unless
3858 * m_len is 0 (bug) or extent has been corrupted
3870 /* IO end_io complete, convert the filled extent to written */
3882 * we already have an unwritten extent
3905 * discovered unwritten extent to written.
3914 * shouldn't get a 0 return when converting an unwritten extent
3915 * unless m_len is 0 (bug) or extent has been corrupted
3942 * allocated in an extent.
3945 * @ex The extent structure which might contain an implied
3949 * find blocks that were already in the inode's extent tree. Hence,
3951 * the extent from the inode's extent tree. There are three cases we
3955 * |--- extent ---| |---- requested region ---|
3961 * |--- requested region --| |------- extent ----|
3972 * map->m_len so it corresponds to the return the extent labelled as
3993 /* The extent passed in that we are trying to match */
4011 * |------- extent ----|
4045 * it into the extent cache tree if it's indeed a hole, finally return
4046 * the length of the determined extent.
4064 * There's a delalloc extent in the hole, handle it if the delalloc
4065 * extent is in front of, behind and straddle the queried range.
4069 * The delalloc extent is in front of the queried range,
4077 * The delalloc extent containing lblk, it must have been
4078 * added after ext4_map_blocks() checked the extent status
4079 * tree, adjust the length to the delalloc extent's after
4086 * The delalloc extent is partially or completely behind
4088 * beginning of the delalloc extent.
4139 /* find extent for this block */
4155 EXT4_ERROR_INODE(inode, "bad extent address "
4178 /* if found extent covers block, simply return it */
4181 /* number of remaining blocks in the extent */
4187 * If the extent is initialized check whether the
4237 * If we are doing bigalloc, check to see if the extent returned
4257 /* Check if the extent after searching to the right implies a
4268 * a single extent. For an initialized extent this limit is
4269 * EXT_INIT_MAX_LEN and for an unwritten extent this limit is
4279 /* Check if we can really insert (m_lblk)::(m_lblk + m_len) extent */
4325 /* try to insert new extent into found leaf and return */
4393 * Cache the extent and update transaction to commit on fdatasync only
4394 * when it is _not_ an unwritten extent.
4462 * Don't normalize the request if it can fit in one extent so
4470 * credits to insert 1 extent into extent tree
4478 * Recalculate credits when extent tree depth changes.
4764 * We only support preallocation for extent-based files only
4826 * credits to insert 1 extent into extent tree
4870 * smaller transactions for conversion of each extent separately.
5042 * Walk the extent tree gathering extent information
5076 /* extent tree + sb + inode */
5159 struct ext4_extent *extent;
5163 /* Let path point to the last extent */
5170 extent = path[depth].p_ext;
5171 if (!extent)
5174 stop = le32_to_cpu(extent->ee_block);
5178 * accommodate the shift. For right shifts, make sure the last extent
5187 extent = path[depth].p_ext;
5188 if (extent) {
5189 ex_start = le32_to_cpu(extent->ee_block);
5190 ex_end = le32_to_cpu(extent->ee_block) +
5191 ext4_ext_get_actual_len(extent);
5204 (stop + ext4_ext_get_actual_len(extent))) {
5227 * in case of right shift if extent with 0 block is reached, iterator
5236 extent = path[depth].p_ext;
5237 if (!extent) {
5243 le32_to_cpu(extent->ee_block)) {
5244 /* Hole, move to the next extent */
5245 if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) {
5255 extent = EXT_LAST_EXTENT(path[depth].p_hdr);
5256 *iterator = le32_to_cpu(extent->ee_block) +
5257 ext4_ext_get_actual_len(extent);
5259 extent = EXT_FIRST_EXTENT(path[depth].p_hdr);
5260 if (le32_to_cpu(extent->ee_block) > start)
5261 *iterator = le32_to_cpu(extent->ee_block) - 1;
5262 else if (le32_to_cpu(extent->ee_block) == start)
5265 extent = EXT_LAST_EXTENT(path[depth].p_hdr);
5266 while (le32_to_cpu(extent->ee_block) >= start)
5267 extent--;
5269 if (extent == EXT_LAST_EXTENT(path[depth].p_hdr))
5272 extent++;
5275 path[depth].p_ext = extent;
5333 /* Currently just for extent based files */
5440 struct ext4_extent *extent;
5464 /* Currently just for extent based files */
5537 extent = path[depth].p_ext;
5538 if (extent) {
5539 ee_start_lblk = le32_to_cpu(extent->ee_block);
5540 ee_len = ext4_ext_get_actual_len(extent);
5543 * If offset_lblk is not the starting block of extent, split
5544 * the extent @offset_lblk
5548 if (ext4_ext_is_unwritten(extent))
5604 * extent's data copying must be performed by caller.
5664 /* if hole after extent, then go to next extent */
5667 /* If hole before extent, then shift to that extent */
5702 /* ext4_split_extent_at() may result in leaf extent split,
5728 /* ext4_split_extent_at() may result in leaf extent split,
5798 struct ext4_extent *extent;
5810 /* search for the extent closest to the first block in the cluster */
5827 "bad extent address - lblock: %lu, depth: %d, pblock: %lld",
5834 extent = path[depth].p_ext;
5836 /* can't be mapped if the extent tree is empty */
5837 if (extent == NULL)
5840 first_lblk = le32_to_cpu(extent->ee_block);
5844 * Three possible outcomes at this point - found extent spanning
5851 ext4_ext_get_actual_len(extent) - 1);
5869 * Updates physical block address and unwritten status of extent
5870 * starting at lblk start and of len. If such an extent doesn't exist,
5871 * this function splits the extent tree appropriately to create an
5872 * extent like this. This function is called in the fast commit
5893 /* We need to split this extent to match our extent first */
5935 /* Try to shrink the extent tree */
6020 * Count the number of extent tree blocks. We do it by looking up