Lines Matching defs:range
242 struct btrfs_ioctl_defrag_range_args range;
273 memset(&range, 0, sizeof(range));
274 range.len = (u64)-1;
275 range.start = cur;
276 range.extent_thresh = defrag->extent_thresh;
279 ret = btrfs_defrag_file(inode, NULL, &range, defrag->transid,
287 cur = max(cur + fs_info->sectorsize, range.start);
555 /* It's beyond our target range, definitely not extent found */
756 /* Wait for any existing ordered extent in the range */
783 * Now the page range has no ordered extent any more. Read the page to
820 * @locked: if the range has already held extent lock
875 * If this range of the extent map is already flagged for delalloc,
882 * because we do the space reservation while holding the range
884 * extent, requires locking the range;
889 * extent). If we mark pages in an adjacent range for defrag,
890 * then we will have a larger contiguous range for delalloc,
947 * last range of the target list.
991 * Otherwise, we can only go the end of the specified range.
1005 * Defrag one contiguous target range.
1008 * @target: target range to defrag
1009 * @pages: locked pages covering the defrag range
1015 * Pages should be locked, no ordered extent in the pages range,
1092 /* Lock the pages range */
1098 * which range really needs to be defragged.
1101 * so that we won't relock the extent range and cause deadlock.
1170 * our range may already be invalid (e.g. hole punched).
1171 * Skip if our range is before last_scanned_ret, as there is
1172 * no need to defrag the range anymore.
1183 * Here we may not defrag any range if holes are punched before
1211 * @range: defrag options including range and flags
1217 * Return >=0 for the number of sectors defragged, and range->start will be updated
1220 * defragging all the range).
1223 struct btrfs_ioctl_defrag_range_args *range,
1231 bool do_compress = (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS);
1235 u32 extent_thresh = range->extent_thresh;
1241 if (range->start >= isize)
1245 if (range->compress_type >= BTRFS_NR_COMPRESS_TYPES)
1247 if (range->compress_type)
1248 compress_type = range->compress_type;
1254 if (range->start + range->len > range->start) {
1255 /* Got a specific range */
1256 last_byte = min(isize, range->start + range->len);
1262 /* Align the range */
1263 cur = round_down(range->start, fs_info->sectorsize);
1279 * Make writeback start from the beginning of the range, so that the
1280 * defrag range can be written sequentially.
1335 * Update range.start for autodefrag, this will indicate where to start
1338 range->start = cur;
1344 if (range->flags & BTRFS_DEFRAG_RANGE_START_IO) {
1350 if (range->compress_type == BTRFS_COMPRESS_LZO)
1352 else if (range->compress_type == BTRFS_COMPRESS_ZSTD)