Lines Matching defs:extent

39  * used by extent splitting.
146 * The extent buffer's verified bit will be set again in
467 error_msg = "invalid extent entries";
474 /* Verify checksum on non-root extent tree nodes */
477 error_msg = "extent tree corrupted";
485 "pblk %llu bad header/extent: %s - magic %x, "
555 "invalid magic for verified extent block %llu",
588 * This function is called to cache a file's extent information in the
589 * extent status tree
599 return 0; /* not an extent-mapped inode */
604 /* Don't cache anything if there are no external extent blocks */
812 * binary search for closest extent of the given block
902 EXT4_ERROR_INODE(inode, "inode has invalid extent depth: %d",
955 /* find extent */
1077 /* FIXME: now decision is simplest: at current extent */
1157 /* start copy from next extent */
1167 /* zero out unused area in the extent block */
1251 /* zero out unused area in the extent block */
1350 /* 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
1557 /* usually extent in the path covers blocks smaller
1558 * then *logical, but it can be that extent is the
1637 * returns allocated block in subsequent extent or EXT_MAX_BLOCKS.
1702 * if leaf gets modified and modified extent is first in the leaf,
1796 * This function tries to merge the "ex" extent to the next extent in the tree.
1817 /* merge with next extent! */
1841 * an extent tree with a single extent tree leaf block into the inode.
1858 * group descriptor to release the extent tree block. If we
1866 * Copy the extent data up to the inode
1886 * This function tries to merge the @ex extent to neighbours in the tree, then
1887 * tries to collapse the extent tree into the inode.
1912 * check if a portion of the "newext" extent overlaps with an
1913 * existing extent.
1936 * get the next allocated block if the extent in the path
1946 /* check for wrap through zero on extent logical start block*/
1964 * tries to merge requested extent into the existing extent or
1965 * inserts requested extent as new one into the tree,
1975 struct ext4_extent *nearex; /* nearest extent */
1995 /* try to insert block into found extent and return */
1999 * Try to see whether we should rather test the extent on
2001 * ext4_find_extent() can return either extent on the
2120 /* there is no extent in this leaf, create first one */
2121 ext_debug(inode, "first extent in the leaf: %u:%llu:[%d]%d\n",
2238 * @path: path in extent tree to @lblk
2243 * actually points to extent before @lblk, we provide it.
2258 /* there is no extent yet, so gap is [0;-] */
2291 /* There's delayed extent containing lblock? */
2356 * This routine returns max. credits that needed to insert an extent
2357 * to the extent tree.
2392 * If we add a single extent, then in the worse case, each tree level
2469 /* only extent tail removal is allowed */
2495 * cluster of the last block in the extent, we free it
2518 * We free the partial cluster at the end of the extent (if any),
2519 * unless the cluster is used by another extent (partial_cluster
2521 * shared with the last block in the extent.
2544 * at the beginning of the extent. Instead, we check to see if we
2556 * If we've freed the entire extent but the beginning is not left
2558 * record the partial cluster at the beginning of the extent. It
2561 * (not shared with another extent). Else, reset the partial
2563 * extent is left cluster aligned.
2581 * and "end" must appear in the same extent or EIO is returned.
2648 /* If this extent is beyond the end of the hole, skip it */
2651 * We're going to skip this extent and move to another,
2669 "on extent %u:%u",
2675 /* remove tail of the extent */
2678 /* remove whole extent: excellent! */
2720 /* this extent is removed; mark slot entirely unused */
2726 * extent have been removed.
2731 * If the extent was completely released,
2738 * extents up when an extent is removed so that
2755 ext_debug(inode, "new extent: %u:%u:%llu\n", ex_ee_block, num,
2766 * If there's a partial cluster and at least one extent remains in
2768 * current extent. If it is shared with the current extent
2834 /* probably first extent we're gonna free will be last in block */
2845 * Check if we are removing extents inside the extent tree. If that
2846 * is the case, we are going to punch a hole inside the extent tree
2847 * so we have to check whether we need to split the extent covering
2856 /* find extent for or closest extent to this block */
2880 * See if the last block is inside the extent, if so split
2881 * the extent at 'end' block so we can easily remove the
2882 * tail of the first part of the split extent in
2888 * If we're going to split the extent, note that
2899 * Split the extent in two so that 'end' is the last
2900 * block in the first new extent. Also we should not
2912 * If we're punching, there's an extent to the right.
2914 * that extent's first cluster and its state to nofree
2919 * extent removal is not lost.
3007 /* Yield here to deal with large extent trees.
3040 * if there's a partial cluster and we have removed the first extent
3162 * ext4_split_extent_at() splits an extent at given block.
3166 * @path: the path to the extent
3167 * @split: the logical block where the extent is splitted.
3168 * @split_flags: indicates if the extent could be zeroout if split fails, and
3170 * @flags: flags used to insert new extent to extent tree.
3173 * Splits extent [a, b] into two extents [a, @split) and [@split, b], states
3177 * a> the extent are splitted into two extent.
3178 * b> split is not needed, and just mark the extent.
3222 * case b: block @split is the block that the extent begins with
3223 * then we just change the state of the extent, and splitting
3290 /* update the extent length and mark as initialized */
3295 /* update extent status tree */
3298 * state the extent tree exactly is so don't try to fix
3299 * length of the original extent as it may do even more
3320 * ext4_split_extents() splits an extent and mark extent which is covered
3323 * It may result in splitting the extent into multiple extents (up to three)
3326 * b> Splits in two extents: Split is happening at either end of the extent
3327 * c> Splits in three extents: Somone is splitting in middle of the extent
3369 * result in split of original leaf or extent zeroout.
3404 * to an unwritten extent. It may result in splitting the unwritten
3405 * extent into multiple extents (up to three - one initialized and two
3408 * a> There is no split required: Entire extent should be initialized
3409 * b> Splits in two extents: Write is happening at either end of the extent
3410 * c> Splits in three extents: Somone is writing in middle of the extent
3413 * - The extent pointed to by 'path' is unwritten.
3414 * - The extent pointed to by 'path' contains a superset
3465 * unwritten extent to its neighbor. This is much cheaper
3472 * - L1: we do not deal with writes covering the whole extent.
3473 * This would require removing the extent if the transfer
3475 * - L2: we only attempt to merge with an extent stored in the
3476 * same extent tree node.
3575 /* Update path to point to the right extent */
3583 * It is safe to convert extent to initialized via explicit
3584 * zeroout only if extent is fully inside i_size or new_size.
3594 * 1. split the extent into three extents.
3595 * 2. split the extent into two extents, zeroout the head of the first
3596 * extent.
3597 * 3. split the extent into two extents, zeroout the tail of the second
3598 * extent.
3599 * 4. split the extent into two extents with out zeroout.
3601 * tail of the extent.
3660 * to an unwritten extent.
3662 * Writing to an unwritten extent may result in splitting the unwritten
3663 * extent into multiple initialized/unwritten extents (up to three)
3665 * a> There is no split required: Entire extent should be unwritten
3666 * b> Splits in two extents: Write is happening at either end of the extent
3667 * c> Splits in three extents: Somone is writing in middle of the extent
3671 * One of more index blocks maybe needed if the extent tree grow after
3672 * the unwritten extent split. To prevent ENOSPC occur at the IO
3673 * complete, we need to split the unwritten extent before DIO submit
3674 * the IO. The unwritten extent called at this time will be split
3675 * into three unwritten extent(at most). After IO complete, the part
3679 * Returns the size of unwritten extent to be written on success.
3702 * It is safe to convert extent to initialized via explicit
3703 * zeroout only if extent is fully inside i_size or new_size.
3743 /* If extent is larger than requested it is a clear sign that we still
3744 * have some extent state machine issues left. So extent_split is still
3751 ext4_warning(inode->i_sb, "Inode (%ld) finished: extent logical block %llu,"
3770 /* first mark the extent as initialized */
3778 /* Mark modified extent as dirty */
3799 * Make sure that the extent is no bigger than we support with
3800 * unwritten extent
3833 /* first mark the extent as unwritten */
3841 /* Mark modified extent as dirty */
3873 * allocate metadata blocks for the new extent block if needed.
3880 /* get_block() before submitting IO, split the extent */
3889 * shouldn't get a 0 return when splitting an extent unless
3890 * m_len is 0 (bug) or extent has been corrupted
3902 /* IO end_io complete, convert the filled extent to written */
3914 * we already have an unwritten extent
3937 * discovered unwritten extent to written.
3946 * shouldn't get a 0 return when converting an unwritten extent
3947 * unless m_len is 0 (bug) or extent has been corrupted
3974 * allocated in an extent.
3977 * @ex The extent structure which might contain an implied
3981 * find blocks that were already in the inode's extent tree. Hence,
3983 * the extent from the inode's extent tree. There are three cases we
3987 * |--- extent ---| |---- requested region ---|
3993 * |--- requested region --| |------- extent ----|
4004 * map->m_len so it corresponds to the return the extent labelled as
4025 /* The extent passed in that we are trying to match */
4043 * |------- extent ----|
4108 /* find extent for this block */
4124 EXT4_ERROR_INODE(inode, "bad extent address "
4147 /* if found extent covers block, simply return it */
4150 /* number of remaining blocks in the extent */
4156 * If the extent is initialized check whether the
4216 * If we are doing bigalloc, check to see if the extent returned
4236 /* Check if the extent after searching to the right implies a
4247 * a single extent. For an initialized extent this limit is
4248 * EXT_INIT_MAX_LEN and for an unwritten extent this limit is
4258 /* Check if we can really insert (m_lblk)::(m_lblk + m_len) extent */
4304 /* try to insert new extent into found leaf and return */
4372 * Cache the extent and update transaction to commit on fdatasync only
4373 * when it is _not_ an unwritten extent.
4452 * Don't normalize the request if it can fit in one extent so
4460 * credits to insert 1 extent into extent tree
4468 * Recalculate credits when extent tree depth changes.
4743 * We only support preallocation for extent-based files only
4805 * credits to insert 1 extent into extent tree
4849 * smaller transactions for conversion of each extent separately.
5021 * Walk the extent tree gathering extent information
5055 /* extent tree + sb + inode */
5138 struct ext4_extent *extent;
5142 /* Let path point to the last extent */
5149 extent = path[depth].p_ext;
5150 if (!extent)
5153 stop = le32_to_cpu(extent->ee_block);
5157 * accommodate the shift. For right shifts, make sure the last extent
5166 extent = path[depth].p_ext;
5167 if (extent) {
5168 ex_start = le32_to_cpu(extent->ee_block);
5169 ex_end = le32_to_cpu(extent->ee_block) +
5170 ext4_ext_get_actual_len(extent);
5183 (stop + ext4_ext_get_actual_len(extent))) {
5206 * in case of right shift if extent with 0 block is reached, iterator
5215 extent = path[depth].p_ext;
5216 if (!extent) {
5222 le32_to_cpu(extent->ee_block)) {
5223 /* Hole, move to the next extent */
5224 if (extent < EXT_LAST_EXTENT(path[depth].p_hdr)) {
5234 extent = EXT_LAST_EXTENT(path[depth].p_hdr);
5235 *iterator = le32_to_cpu(extent->ee_block) +
5236 ext4_ext_get_actual_len(extent);
5238 extent = EXT_FIRST_EXTENT(path[depth].p_hdr);
5239 if (le32_to_cpu(extent->ee_block) > start)
5240 *iterator = le32_to_cpu(extent->ee_block) - 1;
5241 else if (le32_to_cpu(extent->ee_block) == start)
5244 extent = EXT_LAST_EXTENT(path[depth].p_hdr);
5245 while (le32_to_cpu(extent->ee_block) >= start)
5246 extent--;
5248 if (extent == EXT_LAST_EXTENT(path[depth].p_hdr))
5251 extent++;
5254 path[depth].p_ext = extent;
5319 /* Currently just for extent based files */
5432 struct ext4_extent *extent;
5463 /* Currently just for extent based files */
5536 extent = path[depth].p_ext;
5537 if (extent) {
5538 ee_start_lblk = le32_to_cpu(extent->ee_block);
5539 ee_len = ext4_ext_get_actual_len(extent);
5542 * If offset_lblk is not the starting block of extent, split
5543 * the extent @offset_lblk
5547 if (ext4_ext_is_unwritten(extent))
5612 * extent's data copying must be performed by caller.
5676 /* if hole after extent, then go to next extent */
5679 /* If hole before extent, then shift to that extent */
5714 /* ext4_split_extent_at() may result in leaf extent split,
5740 /* ext4_split_extent_at() may result in leaf extent split,
5812 struct ext4_extent *extent;
5824 /* search for the extent closest to the first block in the cluster */
5841 "bad extent address - lblock: %lu, depth: %d, pblock: %lld",
5848 extent = path[depth].p_ext;
5850 /* can't be mapped if the extent tree is empty */
5851 if (extent == NULL)
5854 first_lblk = le32_to_cpu(extent->ee_block);
5858 * Three possible outcomes at this point - found extent spanning
5865 ext4_ext_get_actual_len(extent) - 1);
5884 * Updates physical block address and unwritten status of extent
5885 * starting at lblk start and of len. If such an extent doesn't exist,
5886 * this function splits the extent tree appropriately to create an
5887 * extent like this. This function is called in the fast commit
5908 /* We need to split this extent to match our extent first */
5951 /* Try to shrink the extent tree */
6040 * Count the number of extent tree blocks. We do it by looking up