Lines Matching defs:extent

2979 ;				adding an extent to the list, and the list already occupies
2981 ; if unable to allocate more space, or 0 if the extent list was
3007 printf("jnl: trim_realloc: unable to grow extent list!\n");
3018 /* Copy the old extent list to the newly allocated list. */
3041 ; Function: Search the given extent list to see if any of its extents
3042 ; overlap the given extent.
3047 ; length - The number of bytes of the extent being searched for.
3061 /* A binary search over the extent list. */
3091 ; to add recently freed extents to its free extent cache, but
3100 ; length - The number of bytes of the extent being trimmed.
3108 dk_extent_t *extent;
3136 * input extent. We start by counting the number of extents that end
3137 * strictly before the input extent, then count the number of extents
3138 * that overlap or are contiguous with the input extent.
3140 extent = tr->trim.extents;
3142 while (insert_index < tr->trim.extent_count && extent->offset + extent->length < offset) {
3144 ++extent;
3147 while (insert_index + replace_count < tr->trim.extent_count && extent->offset <= end) {
3149 ++extent;
3153 * If none of the existing extents can be combined with the input extent,
3175 /* Store the new extent in the list. */
3186 * Update extent number insert_index to be the union of the input extent
3191 extent = &tr->trim.extents[insert_index + replace_count - 1];
3192 if (extent->offset + extent->length > end)
3193 end = extent->offset + extent->length;
3198 * If we were replacing more than one existing extent, then shift any
3201 * We're going to leave extent #insert_index alone since it was just updated, above.
3203 * the list by (replace_count - 1) positions so that they overwrite extent #(insert_index + 1).
3231 ; added to its free extent cache (if some portion of the newly
3237 ; length - The number of bytes of the extent being trimmed.
3244 dk_extent_t *extent;
3252 * extent. These extents will be modified if they overlap the input
3253 * extent. Other extents between them will be deleted.
3255 extent = trim->extents;
3257 while (keep_before < trim->extent_count && extent->offset < offset) {
3259 ++extent;
3263 /* See if previous extent extends beyond both ends of input extent. */
3265 --extent;
3267 while (keep_after < trim->extent_count && (extent->offset + extent->length) <= end) {
3269 ++extent;
3274 * start before the input extent, and extents (keep_after .. extent_count-1)
3275 * end after the input extent. We'll need to keep, all of those extents,
3277 * that overlaps with the input extent.
3281 * Does the input extent start after and end before the same existing
3282 * extent? If so, we have to "punch a hole" in that extent and convert
3295 * Make room for a new extent by shifting extents #keep_after and later
3296 * down by one extent. When we're done, extents #keep_before and
3298 * the portion that overlaps the input extent.
3307 * Fall through. We now have the case where the length of extent
3308 * #(keep_before - 1) needs to be updated, and the start of extent
3314 * May need to truncate the end of extent #(keep_before - 1) if it overlaps
3315 * the input extent.
3318 extent = &trim->extents[keep_before - 1];
3319 if (extent->offset + extent->length > offset) {
3320 extent->length = offset - extent->offset;
3325 * May need to update the start of extent #(keep_after) if it overlaps the
3326 * input extent.
3329 extent = &trim->extents[keep_after];
3330 if (extent->offset < end) {
3331 extent->length = extent->offset + extent->length - end;
3332 extent->offset = end;
3337 * If there were whole extents that overlapped the input extent, get rid
3364 ; length - The number of bytes of the extent being trimmed.
3408 * There was an overlap, so avoid trimming the extent we
4031 // free up the extent list.