• Home
  • Raw
  • Download

Lines Matching refs:start

85 				   u64 start, u64 end, int *page_started,
87 static struct extent_map *create_io_em(struct inode *inode, u64 start, u64 len,
169 u64 start, size_t size, size_t compressed_size, in insert_inline_extent() argument
195 key.offset = start; in insert_inline_extent()
235 start >> PAGE_SHIFT); in insert_inline_extent()
238 offset = offset_in_page(start); in insert_inline_extent()
268 static noinline int cow_file_range_inline(struct inode *inode, u64 start, in cow_file_range_inline() argument
278 u64 inline_len = actual_end - start; in cow_file_range_inline()
289 if (start > 0 || in cow_file_range_inline()
318 start, aligned_end, NULL, in cow_file_range_inline()
328 root, inode, start, in cow_file_range_inline()
340 btrfs_drop_extent_cache(BTRFS_I(inode), start, aligned_end - 1, 0); in cow_file_range_inline()
355 u64 start; member
367 u64 start; member
382 u64 start, u64 ram_size, in add_async_extent() argument
392 async_extent->start = start; in add_async_extent()
417 static inline int inode_need_compress(struct inode *inode, u64 start, u64 end) in inode_need_compress() argument
439 return btrfs_compress_heuristic(inode, start, end); in inode_need_compress()
444 u64 start, u64 end, u64 num_bytes, u64 small_write) in inode_should_defrag() argument
448 (start > 0 || end + 1 < inode->disk_i_size)) in inode_should_defrag()
474 u64 start = async_chunk->start; in compress_file_range() local
489 inode_should_defrag(BTRFS_I(inode), start, end, end - start + 1, in compress_file_range()
507 nr_pages = (end >> PAGE_SHIFT) - (start >> PAGE_SHIFT) + 1; in compress_file_range()
522 if (actual_end <= start) in compress_file_range()
525 total_compressed = actual_end - start; in compress_file_range()
532 (start > 0 || end + 1 < BTRFS_I(inode)->disk_i_size)) in compress_file_range()
545 if (inode_need_compress(inode, start, end)) { in compress_file_range()
572 extent_range_clear_dirty_for_io(inode, start, end); in compress_file_range()
579 inode->i_mapping, start, in compress_file_range()
603 if (start == 0) { in compress_file_range()
609 ret = cow_file_range_inline(inode, start, end, 0, in compress_file_range()
613 ret = cow_file_range_inline(inode, start, end, in compress_file_range()
635 extent_clear_unlock_delalloc(inode, start, end, NULL, in compress_file_range()
675 add_async_extent(async_chunk, start, total_in, in compress_file_range()
679 if (start + total_in < end) { in compress_file_range()
680 start += total_in; in compress_file_range()
716 (page_offset(async_chunk->locked_page) >= start && in compress_file_range()
723 extent_range_redirty_for_io(inode, start, end); in compress_file_range()
724 add_async_extent(async_chunk, start, end - start + 1, 0, NULL, 0, in compress_file_range()
772 lock_extent(io_tree, async_extent->start, in submit_compressed_extents()
773 async_extent->start + async_extent->ram_size - 1); in submit_compressed_extents()
781 async_extent->start, in submit_compressed_extents()
782 async_extent->start + in submit_compressed_extents()
796 async_extent->start, in submit_compressed_extents()
797 async_extent->start + in submit_compressed_extents()
815 unlock_extent(io_tree, async_extent->start, in submit_compressed_extents()
816 async_extent->start + in submit_compressed_extents()
826 async_extent->start, in submit_compressed_extents()
827 async_extent->start + in submit_compressed_extents()
838 em = create_io_em(inode, async_extent->start, in submit_compressed_extents()
840 async_extent->start, /* orig_start */ in submit_compressed_extents()
853 async_extent->start, in submit_compressed_extents()
861 async_extent->start, in submit_compressed_extents()
862 async_extent->start + in submit_compressed_extents()
871 extent_clear_unlock_delalloc(inode, async_extent->start, in submit_compressed_extents()
872 async_extent->start + in submit_compressed_extents()
878 async_extent->start, in submit_compressed_extents()
885 const u64 start = async_extent->start; in submit_compressed_extents() local
886 const u64 end = start + async_extent->ram_size - 1; in submit_compressed_extents()
889 btrfs_writepage_endio_finish_ordered(p, start, end, 0); in submit_compressed_extents()
892 extent_clear_unlock_delalloc(inode, start, end, in submit_compressed_extents()
907 extent_clear_unlock_delalloc(inode, async_extent->start, in submit_compressed_extents()
908 async_extent->start + in submit_compressed_extents()
921 static u64 get_extent_allocation_hint(struct inode *inode, u64 start, in get_extent_allocation_hint() argument
929 em = search_extent_mapping(em_tree, start, num_bytes); in get_extent_allocation_hint()
968 u64 start, u64 end, int *page_started, in cow_file_range() argument
991 num_bytes = ALIGN(end - start + 1, blocksize); in cow_file_range()
995 inode_should_defrag(BTRFS_I(inode), start, end, num_bytes, SZ_64K); in cow_file_range()
997 if (start == 0) { in cow_file_range()
999 ret = cow_file_range_inline(inode, start, end, 0, in cow_file_range()
1008 extent_clear_unlock_delalloc(inode, start, end, NULL, in cow_file_range()
1015 (end - start + PAGE_SIZE) / PAGE_SIZE; in cow_file_range()
1023 alloc_hint = get_extent_allocation_hint(inode, start, num_bytes); in cow_file_range()
1024 btrfs_drop_extent_cache(BTRFS_I(inode), start, in cow_file_range()
1025 start + num_bytes - 1, 0); in cow_file_range()
1038 em = create_io_em(inode, start, ins.offset, /* len */ in cow_file_range()
1039 start, /* orig_start */ in cow_file_range()
1052 ret = btrfs_add_ordered_extent(inode, start, ins.objectid, in cow_file_range()
1059 ret = btrfs_reloc_clone_csums(inode, start, in cow_file_range()
1073 btrfs_drop_extent_cache(BTRFS_I(inode), start, in cow_file_range()
1074 start + ram_size - 1, 0); in cow_file_range()
1089 extent_clear_unlock_delalloc(inode, start, in cow_file_range()
1090 start + ram_size - 1, in cow_file_range()
1099 start += cur_alloc_size; in cow_file_range()
1114 btrfs_drop_extent_cache(BTRFS_I(inode), start, start + ram_size - 1, 0); in cow_file_range()
1134 extent_clear_unlock_delalloc(inode, start, in cow_file_range()
1135 start + cur_alloc_size, in cow_file_range()
1139 start += cur_alloc_size; in cow_file_range()
1140 if (start >= end) in cow_file_range()
1143 extent_clear_unlock_delalloc(inode, start, end, locked_page, in cow_file_range()
1176 nr_pages = (async_chunk->end - async_chunk->start + PAGE_SIZE) >> in async_cow_submit()
1210 u64 start, u64 end, int *page_started, in cow_file_range_async() argument
1219 u64 num_chunks = DIV_ROUND_UP(end - start, SZ_512K); in cow_file_range_async()
1224 unlock_extent(&BTRFS_I(inode)->io_tree, start, end); in cow_file_range_async()
1246 extent_clear_unlock_delalloc(inode, start, end, locked_page, in cow_file_range_async()
1256 cur_end = min(end, start + SZ_512K - 1); in cow_file_range_async()
1267 async_chunk[i].start = start; in cow_file_range_async()
1291 nr_pages = DIV_ROUND_UP(cur_end - start, PAGE_SIZE); in cow_file_range_async()
1297 start = cur_end + 1; in cow_file_range_async()
1334 const u64 start, const u64 end, in run_delalloc_nocow() argument
1342 u64 cur_offset = start; in run_delalloc_nocow()
1352 extent_clear_unlock_delalloc(inode, start, end, locked_page, in run_delalloc_nocow()
1541 if (extent_end <= start) { in run_delalloc_nocow()
1685 static inline int need_force_cow(struct inode *inode, u64 start, u64 end) in need_force_cow() argument
1698 test_range_bit(&BTRFS_I(inode)->io_tree, start, end, in need_force_cow()
1710 u64 start, u64 end, int *page_started, unsigned long *nr_written, in btrfs_run_delalloc_range() argument
1714 int force_cow = need_force_cow(inode, start, end); in btrfs_run_delalloc_range()
1718 ret = run_delalloc_nocow(inode, locked_page, start, end, in btrfs_run_delalloc_range()
1721 ret = run_delalloc_nocow(inode, locked_page, start, end, in btrfs_run_delalloc_range()
1724 !inode_need_compress(inode, start, end)) { in btrfs_run_delalloc_range()
1725 ret = cow_file_range(inode, locked_page, start, end, in btrfs_run_delalloc_range()
1730 ret = cow_file_range_async(inode, locked_page, start, end, in btrfs_run_delalloc_range()
1735 btrfs_cleanup_ordered_extents(inode, locked_page, start, in btrfs_run_delalloc_range()
1736 end - start + 1); in btrfs_run_delalloc_range()
1749 size = orig->end - orig->start + 1; in btrfs_split_delalloc_extent()
1760 new_size = split - orig->start; in btrfs_split_delalloc_extent()
1786 if (new->start > other->start) in btrfs_merge_delalloc_extent()
1787 new_size = new->end - other->start + 1; in btrfs_merge_delalloc_extent()
1789 new_size = other->end - new->start + 1; in btrfs_merge_delalloc_extent()
1817 old_size = other->end - other->start + 1; in btrfs_merge_delalloc_extent()
1819 old_size = new->end - new->start + 1; in btrfs_merge_delalloc_extent()
1899 u64 len = state->end + 1 - state->start; in btrfs_set_delalloc_extent()
1927 state->start; in btrfs_set_delalloc_extent()
1941 u64 len = state->end + 1 - state->start; in btrfs_clear_delalloc_extent()
1981 state->start, len); in btrfs_clear_delalloc_extent()
2159 int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, in btrfs_set_extent_delalloc() argument
2164 return set_extent_delalloc(&BTRFS_I(inode)->io_tree, start, end, in btrfs_set_extent_delalloc()
2263 int btrfs_writepage_cow_fixup(struct page *page, u64 start, u64 end) in btrfs_writepage_cow_fixup() argument
2659 u64 start; in relink_extent_backref() local
2743 start = backref->file_pos; in relink_extent_backref()
2745 start += old->extent_offset + old->offset - in relink_extent_backref()
2752 ret = btrfs_drop_extents(trans, root, inode, start, in relink_extent_backref()
2753 start + len, 1); in relink_extent_backref()
2759 key.offset = start; in relink_extent_backref()
2779 if (extent_len + found_key.offset == start && in relink_extent_backref()
2807 btrfs_set_file_extent_offset(leaf, item, start - new->file_pos); in relink_extent_backref()
2922 new->bytenr = ordered->start; in record_old_file_extents()
3018 u64 start, u64 len) in btrfs_release_delalloc_bytes() argument
3022 cache = btrfs_lookup_block_group(fs_info, start); in btrfs_release_delalloc_bytes()
3151 ordered_extent->start, in btrfs_finish_ordered_io()
3159 ordered_extent->start, in btrfs_finish_ordered_io()
3205 u64 start, end; in btrfs_finish_ordered_io() local
3208 start = ordered_extent->file_offset + logical_len; in btrfs_finish_ordered_io()
3210 start = ordered_extent->file_offset; in btrfs_finish_ordered_io()
3212 clear_extent_uptodate(io_tree, start, end, NULL); in btrfs_finish_ordered_io()
3215 btrfs_drop_extent_cache(BTRFS_I(inode), start, end, 0); in btrfs_finish_ordered_io()
3232 ordered_extent->start, in btrfs_finish_ordered_io()
3268 void btrfs_writepage_endio_finish_ordered(struct page *page, u64 start, in btrfs_writepage_endio_finish_ordered() argument
3276 trace_btrfs_writepage_end_io_hook(page, start, end, uptodate); in btrfs_writepage_endio_finish_ordered()
3279 if (!btrfs_dec_test_ordered_pending(inode, &ordered_extent, start, in btrfs_writepage_endio_finish_ordered()
3280 end - start + 1, uptodate)) in btrfs_writepage_endio_finish_ordered()
3295 int pgoff, u64 start, size_t len) in __readpage_endio_check() argument
3319 btrfs_print_data_csum_error(BTRFS_I(inode), start, csum, csum_expected, in __readpage_endio_check()
3334 u64 start, u64 end, int mirror) in btrfs_readpage_end_io_hook() argument
3336 size_t offset = start - page_offset(page); in btrfs_readpage_end_io_hook()
3350 test_range_bit(io_tree, start, end, EXTENT_NODATASUM, 1, NULL)) { in btrfs_readpage_end_io_hook()
3351 clear_extent_bits(io_tree, start, end, EXTENT_NODATASUM); in btrfs_readpage_end_io_hook()
3357 start, (size_t)(end - start + 1)); in btrfs_readpage_end_io_hook()
5180 hole_em->start = cur_offset; in btrfs_cont_expand()
5394 u64 start; in evict_inode_truncate_pages() local
5400 start = state->start; in evict_inode_truncate_pages()
5405 lock_extent_bits(io_tree, start, end, &cached_state); in evict_inode_truncate_pages()
5416 btrfs_qgroup_free_data(inode, NULL, start, end - start + 1); in evict_inode_truncate_pages()
5418 clear_extent_bit(io_tree, start, end, in evict_inode_truncate_pages()
6942 size_t pg_offset, u64 start, u64 len, in btrfs_get_extent() argument
6963 em = lookup_extent_mapping(em_tree, start, len); in btrfs_get_extent()
6969 if (em->start > start || em->start + em->len <= start) in btrfs_get_extent()
6982 em->start = EXTENT_MAP_HOLE; in btrfs_get_extent()
7002 ret = btrfs_lookup_file_extent(NULL, root, path, objectid, start, 0); in btrfs_get_extent()
7024 extent_end = start; in btrfs_get_extent()
7057 if (start >= extent_end) { in btrfs_get_extent()
7073 if (start + len <= found_key.offset) in btrfs_get_extent()
7075 if (start > found_key.offset) in btrfs_get_extent()
7079 em->start = start; in btrfs_get_extent()
7080 em->orig_start = start; in btrfs_get_extent()
7081 em->len = found_key.offset - start; in btrfs_get_extent()
7106 em->start = extent_start + extent_offset; in btrfs_get_extent()
7109 em->orig_start = em->start; in btrfs_get_extent()
7135 set_extent_uptodate(io_tree, em->start, in btrfs_get_extent()
7140 em->start = start; in btrfs_get_extent()
7141 em->orig_start = start; in btrfs_get_extent()
7146 if (em->start > start || extent_map_end(em) <= start) { in btrfs_get_extent()
7149 em->start, em->len, start, len); in btrfs_get_extent()
7156 err = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len); in btrfs_get_extent()
7172 u64 start, u64 len) in btrfs_get_extent_fiemap() argument
7176 u64 delalloc_start = start; in btrfs_get_extent_fiemap()
7182 em = btrfs_get_extent(inode, NULL, 0, start, len, 0); in btrfs_get_extent_fiemap()
7198 end = start + len; in btrfs_get_extent_fiemap()
7199 if (end < start) in btrfs_get_extent_fiemap()
7217 if (delalloc_start > end || delalloc_end <= start) { in btrfs_get_extent_fiemap()
7227 delalloc_start = max(start, delalloc_start); in btrfs_get_extent_fiemap()
7250 if (hole_end <= start || hole_em->start > end) { in btrfs_get_extent_fiemap()
7254 hole_start = max(hole_em->start, start); in btrfs_get_extent_fiemap()
7265 em->start = hole_start; in btrfs_get_extent_fiemap()
7280 em->start = delalloc_start; in btrfs_get_extent_fiemap()
7300 const u64 start, in btrfs_create_dio_extent() argument
7313 em = create_io_em(inode, start, len, orig_start, in btrfs_create_dio_extent()
7321 ret = btrfs_add_ordered_extent_dio(inode, start, block_start, in btrfs_create_dio_extent()
7326 btrfs_drop_extent_cache(BTRFS_I(inode), start, in btrfs_create_dio_extent()
7327 start + len - 1, 0); in btrfs_create_dio_extent()
7337 u64 start, u64 len) in btrfs_new_extent_direct() argument
7346 alloc_hint = get_extent_allocation_hint(inode, start, len); in btrfs_new_extent_direct()
7352 em = btrfs_create_dio_extent(inode, start, ins.offset, start, in btrfs_new_extent_direct()
7592 static struct extent_map *create_io_em(struct inode *inode, u64 start, u64 len, in create_io_em() argument
7613 em->start = start; in create_io_em()
7631 btrfs_drop_extent_cache(BTRFS_I(inode), em->start, in create_io_em()
7632 em->start + em->len - 1, 0); in create_io_em()
7655 u64 start, u64 len) in btrfs_get_blocks_direct_read() argument
7661 len = min(len, em->len - (start - em->start)); in btrfs_get_blocks_direct_read()
7663 bh_result->b_blocknr = (em->block_start + (start - em->start)) >> in btrfs_get_blocks_direct_read()
7676 u64 start, u64 len) in btrfs_get_blocks_direct_write() argument
7701 len = min(len, em->len - (start - em->start)); in btrfs_get_blocks_direct_write()
7702 block_start = em->block_start + (start - em->start); in btrfs_get_blocks_direct_write()
7704 if (can_nocow_extent(inode, start, &len, &orig_start, in btrfs_get_blocks_direct_write()
7709 em2 = btrfs_create_dio_extent(inode, start, len, in btrfs_get_blocks_direct_write()
7728 btrfs_free_reserved_data_space_noquota(inode, start, in btrfs_get_blocks_direct_write()
7737 *map = em = btrfs_new_extent_direct(inode, start, len); in btrfs_get_blocks_direct_write()
7743 len = min(len, em->len - (start - em->start)); in btrfs_get_blocks_direct_write()
7746 bh_result->b_blocknr = (em->block_start + (start - em->start)) >> in btrfs_get_blocks_direct_write()
7759 if (!dio_data->overwrite && start + len > i_size_read(inode)) in btrfs_get_blocks_direct_write()
7760 i_size_write(inode, start + len); in btrfs_get_blocks_direct_write()
7764 dio_data->unsubmitted_oe_range_end = start + len; in btrfs_get_blocks_direct_write()
7777 u64 start = iblock << inode->i_blkbits; in btrfs_get_blocks_direct() local
7785 lockstart = start; in btrfs_get_blocks_direct()
7786 lockend = start + len - 1; in btrfs_get_blocks_direct()
7808 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len, 0); in btrfs_get_blocks_direct()
7837 dio_data, start, len); in btrfs_get_blocks_direct()
7845 start, len); in btrfs_get_blocks_direct()
7856 lockstart = start + bh_result->b_size; in btrfs_get_blocks_direct()
7934 u64 start, u64 end, int failed_mirror, in dio_read_error() argument
7950 ret = btrfs_get_io_failure_record(inode, start, end, &failrec); in dio_read_error()
7967 isector = start - btrfs_io_bio(failed_bio)->logical; in dio_read_error()
7989 u64 start; member
8013 io_tree, done->start, bvec->bv_page, in btrfs_retry_endio_nocsum()
8027 u64 start; in __btrfs_correct_data_nocsum() local
8037 start = io_bio->logical; in __btrfs_correct_data_nocsum()
8047 done.start = start; in __btrfs_correct_data_nocsum()
8051 pgoff, start, start + sectorsize - 1, in __btrfs_correct_data_nocsum()
8067 start += sectorsize; in __btrfs_correct_data_nocsum()
8106 bvec->bv_offset, done->start, in btrfs_retry_endio()
8110 failure_tree, io_tree, done->start, in btrfs_retry_endio()
8132 u64 start; in __btrfs_subio_endio_read() local
8146 start = io_bio->logical; in __btrfs_subio_endio_read()
8158 bvec.bv_page, pgoff, start, sectorsize); in __btrfs_subio_endio_read()
8164 done.start = start; in __btrfs_subio_endio_read()
8168 pgoff, start, start + sectorsize - 1, in __btrfs_subio_endio_read()
8184 start += sectorsize; in __btrfs_subio_endio_read()
8765 __u64 start, __u64 len) in btrfs_fiemap() argument
8773 return extent_fiemap(inode, fieinfo, start, len); in btrfs_fiemap()
8848 u64 start; in btrfs_invalidatepage() local
8870 start = page_start; in btrfs_invalidatepage()
8871 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), start, in btrfs_invalidatepage()
8872 page_end - start + 1); in btrfs_invalidatepage()
8880 clear_extent_bit(tree, start, end, in btrfs_invalidatepage()
8896 new_len = start - ordered->file_offset; in btrfs_invalidatepage()
8902 start, in btrfs_invalidatepage()
8903 end - start + 1, 1)) in btrfs_invalidatepage()
8909 lock_extent_bits(tree, start, end, in btrfs_invalidatepage()
8913 start = end + 1; in btrfs_invalidatepage()
8914 if (start < page_end) in btrfs_invalidatepage()
10386 u64 start, u64 num_bytes, u64 min_size, in __btrfs_prealloc_file_range() argument
10395 u64 cur_offset = start; in __btrfs_prealloc_file_range()
10401 u64 end = start + num_bytes - 1; in __btrfs_prealloc_file_range()
10457 em->start = cur_offset; in __btrfs_prealloc_file_range()
10517 u64 start, u64 num_bytes, u64 min_size, in btrfs_prealloc_file_range() argument
10520 return __btrfs_prealloc_file_range(inode, mode, start, num_bytes, in btrfs_prealloc_file_range()
10527 u64 start, u64 num_bytes, u64 min_size, in btrfs_prealloc_file_range_trans() argument
10530 return __btrfs_prealloc_file_range(inode, mode, start, num_bytes, in btrfs_prealloc_file_range_trans()
10619 void btrfs_set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end) in btrfs_set_range_writeback() argument
10622 unsigned long index = start >> PAGE_SHIFT; in btrfs_set_range_writeback()
10703 u64 start; member
10728 if (bsi->start == 0) in btrfs_add_swap_extent()
10765 u64 start; in btrfs_swap_activate() local
10817 start = 0; in btrfs_swap_activate()
10818 while (start < isize) { in btrfs_swap_activate()
10821 u64 len = isize - start; in btrfs_swap_activate()
10823 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len, 0); in btrfs_swap_activate()
10852 logical_block_start = em->block_start + (start - em->start); in btrfs_swap_activate()
10853 len = min(len, em->len - (start - em->start)); in btrfs_swap_activate()
10857 ret = can_nocow_extent(inode, start, &len, NULL, NULL, NULL); in btrfs_swap_activate()
10896 (logical_block_start - em->start)); in btrfs_swap_activate()
10897 len = min(len, em->len - (logical_block_start - em->start)); in btrfs_swap_activate()
10927 bsi.start = start; in btrfs_swap_activate()
10932 start += len; in btrfs_swap_activate()