• Home
  • Raw
  • Download

Lines Matching refs:offset

286 	key.offset = (u64)-1;  in __btrfs_run_defrag_inode()
298 key.offset = 0; in __btrfs_run_defrag_inode()
403 int offset = offset_in_page(pos); in btrfs_copy_from_user() local
407 PAGE_SIZE - offset, write_bytes); in btrfs_copy_from_user()
412 copied = iov_iter_copy_from_user_atomic(page, i, offset, count); in btrfs_copy_from_user()
437 if (copied < PAGE_SIZE - offset) { in btrfs_copy_from_user()
438 offset += copied; in btrfs_copy_from_user()
441 offset = 0; in btrfs_copy_from_user()
827 if (key.type > BTRFS_EXTENT_DATA_KEY || key.offset >= end) in __btrfs_drop_extents()
839 extent_end = key.offset + in __btrfs_drop_extents()
842 extent_end = key.offset + in __btrfs_drop_extents()
858 if (extent_end == key.offset && extent_end >= search_start) { in __btrfs_drop_extents()
869 search_start = max(key.offset, start); in __btrfs_drop_extents()
880 if (start > key.offset && end < extent_end) { in __btrfs_drop_extents()
888 new_key.offset = start; in __btrfs_drop_extents()
902 start - key.offset); in __btrfs_drop_extents()
907 extent_offset += start - key.offset; in __btrfs_drop_extents()
924 key.offset = start; in __btrfs_drop_extents()
936 if (start <= key.offset && end < extent_end) { in __btrfs_drop_extents()
943 new_key.offset = end; in __btrfs_drop_extents()
946 extent_offset += end - key.offset; in __btrfs_drop_extents()
952 inode_sub_bytes(inode, end - key.offset); in __btrfs_drop_extents()
961 if (start > key.offset && end >= extent_end) { in __btrfs_drop_extents()
969 start - key.offset); in __btrfs_drop_extents()
984 if (start <= key.offset && end >= extent_end) { in __btrfs_drop_extents()
997 extent_end - key.offset); in __btrfs_drop_extents()
1007 key.offset - extent_offset); in __btrfs_drop_extents()
1011 extent_end - key.offset); in __btrfs_drop_extents()
1066 key.offset = start; in __btrfs_drop_extents()
1123 btrfs_file_extent_offset(leaf, fi) != key.offset - orig_offset || in extent_mergeable()
1129 extent_end = key.offset + btrfs_file_extent_num_bytes(leaf, fi); in extent_mergeable()
1130 if ((*start && *start != key.offset) || (*end && *end != extent_end)) in extent_mergeable()
1133 *start = key.offset; in extent_mergeable()
1177 key.offset = split; in btrfs_mark_extent_written()
1200 extent_end = key.offset + btrfs_file_extent_num_bytes(leaf, fi); in btrfs_mark_extent_written()
1201 if (key.offset > start || extent_end < end) { in btrfs_mark_extent_written()
1209 orig_offset = key.offset - btrfs_file_extent_offset(leaf, fi); in btrfs_mark_extent_written()
1212 if (start == key.offset && end < extent_end) { in btrfs_mark_extent_written()
1218 new_key.offset = end; in btrfs_mark_extent_written()
1239 if (start > key.offset && end == extent_end) { in btrfs_mark_extent_written()
1248 start - key.offset); in btrfs_mark_extent_written()
1252 new_key.offset = start; in btrfs_mark_extent_written()
1268 while (start > key.offset || end < extent_end) { in btrfs_mark_extent_written()
1269 if (key.offset == start) in btrfs_mark_extent_written()
1272 new_key.offset = split; in btrfs_mark_extent_written()
1288 split - key.offset); in btrfs_mark_extent_written()
1310 key.offset = start; in btrfs_mark_extent_written()
1312 if (start != key.offset) { in btrfs_mark_extent_written()
1353 key.offset = other_start; in btrfs_mark_extent_written()
1376 extent_end - key.offset); in btrfs_mark_extent_written()
1614 size_t offset = offset_in_page(pos); in btrfs_buffered_write() local
1618 offset); in btrfs_buffered_write()
1619 size_t num_pages = DIV_ROUND_UP(write_bytes + offset, in btrfs_buffered_write()
1661 num_pages = DIV_ROUND_UP(write_bytes + offset, in btrfs_buffered_write()
1733 dirty_pages = DIV_ROUND_UP(copied + offset, in btrfs_buffered_write()
2271 if (key.offset == end) in hole_mergeable()
2273 if (key.offset + btrfs_file_extent_num_bytes(leaf, fi) == start) in hole_mergeable()
2280 struct btrfs_path *path, u64 offset, u64 end) in fill_holes() argument
2296 key.offset = offset; in fill_holes()
2310 if (hole_mergeable(inode, leaf, path->slots[0] - 1, offset, end)) { in fill_holes()
2317 end - offset; in fill_holes()
2325 if (hole_mergeable(inode, leaf, path->slots[0], offset, end)) { in fill_holes()
2328 key.offset = offset; in fill_holes()
2333 offset; in fill_holes()
2343 offset, 0, 0, end - offset, 0, end - offset, 0, 0, 0); in fill_holes()
2352 btrfs_drop_extent_cache(inode, offset, end - 1, 0); in fill_holes()
2355 hole_em->start = offset; in fill_holes()
2356 hole_em->len = end - offset; in fill_holes()
2358 hole_em->orig_start = offset; in fill_holes()
2368 btrfs_drop_extent_cache(inode, offset, end - 1, 0); in fill_holes()
2477 key.offset = clone_info->file_offset; in btrfs_insert_clone_extent()
2718 static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) in btrfs_punch_hole() argument
2729 u64 orig_start = offset; in btrfs_punch_hole()
2736 ret = btrfs_wait_ordered_range(inode, offset, len); in btrfs_punch_hole()
2742 ret = find_first_non_hole(inode, &offset, &len); in btrfs_punch_hole()
2751 lockstart = round_up(offset, btrfs_inode_sectorsize(inode)); in btrfs_punch_hole()
2752 lockend = round_down(offset + len, in btrfs_punch_hole()
2754 same_block = (BTRFS_BYTES_TO_BLKS(fs_info, offset)) in btrfs_punch_hole()
2755 == (BTRFS_BYTES_TO_BLKS(fs_info, offset + len - 1)); in btrfs_punch_hole()
2765 if (offset < ino_size) { in btrfs_punch_hole()
2767 ret = btrfs_truncate_block(inode, offset, len, 0); in btrfs_punch_hole()
2775 if (offset < ino_size) { in btrfs_punch_hole()
2777 ret = btrfs_truncate_block(inode, offset, 0, 0); in btrfs_punch_hole()
2788 if (offset == orig_start) { in btrfs_punch_hole()
2790 len = offset + len - lockstart; in btrfs_punch_hole()
2791 offset = lockstart; in btrfs_punch_hole()
2792 ret = find_first_non_hole(inode, &offset, &len); in btrfs_punch_hole()
2799 lockstart = offset; in btrfs_punch_hole()
2804 tail_len = offset + len - tail_start; in btrfs_punch_hole()
2956 u64 offset) in btrfs_zero_range_check_range_boundary() argument
2962 offset = round_down(offset, sectorsize); in btrfs_zero_range_check_range_boundary()
2963 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, offset, sectorsize, 0); in btrfs_zero_range_check_range_boundary()
2979 loff_t offset, in btrfs_zero_range() argument
2989 u64 alloc_start = round_down(offset, sectorsize); in btrfs_zero_range()
2990 u64 alloc_end = round_up(offset + len, sectorsize); in btrfs_zero_range()
3015 if (em_end >= offset + len) { in btrfs_zero_range()
3022 ret = btrfs_fallocate_update_isize(inode, offset + len, in btrfs_zero_range()
3032 len = offset + len - alloc_start; in btrfs_zero_range()
3033 offset = alloc_start; in btrfs_zero_range()
3038 if (BTRFS_BYTES_TO_BLKS(fs_info, offset) == in btrfs_zero_range()
3039 BTRFS_BYTES_TO_BLKS(fs_info, offset + len - 1)) { in btrfs_zero_range()
3049 ret = btrfs_fallocate_update_isize(inode, offset + len, in btrfs_zero_range()
3055 ret = btrfs_truncate_block(inode, offset, len, 0); in btrfs_zero_range()
3058 offset + len, in btrfs_zero_range()
3063 alloc_start = round_down(offset, sectorsize); in btrfs_zero_range()
3068 alloc_start = round_up(offset, sectorsize); in btrfs_zero_range()
3069 alloc_end = round_down(offset + len, sectorsize); in btrfs_zero_range()
3077 if (!IS_ALIGNED(offset, sectorsize)) { in btrfs_zero_range()
3078 ret = btrfs_zero_range_check_range_boundary(inode, offset); in btrfs_zero_range()
3082 alloc_start = round_down(offset, sectorsize); in btrfs_zero_range()
3085 ret = btrfs_truncate_block(inode, offset, 0, 0); in btrfs_zero_range()
3093 if (!IS_ALIGNED(offset + len, sectorsize)) { in btrfs_zero_range()
3095 offset + len); in btrfs_zero_range()
3099 alloc_end = round_up(offset + len, sectorsize); in btrfs_zero_range()
3102 ret = btrfs_truncate_block(inode, offset + len, 0, 1); in btrfs_zero_range()
3133 offset + len, &alloc_hint); in btrfs_zero_range()
3142 ret = btrfs_fallocate_update_isize(inode, offset + len, mode); in btrfs_zero_range()
3153 loff_t offset, loff_t len) in btrfs_fallocate() argument
3172 alloc_start = round_down(offset, blocksize); in btrfs_fallocate()
3173 alloc_end = round_up(offset + len, blocksize); in btrfs_fallocate()
3182 return btrfs_punch_hole(inode, offset, len); in btrfs_fallocate()
3198 if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) { in btrfs_fallocate()
3199 ret = inode_newsize_ok(inode, offset + len); in btrfs_fallocate()
3216 } else if (offset + len > inode->i_size) { in btrfs_fallocate()
3237 ret = btrfs_zero_range(inode, offset, len, mode); in btrfs_fallocate()
3285 actual_end = min_t(u64, extent_map_end(em), offset + len); in btrfs_fallocate()
3325 offset + len, &alloc_hint); in btrfs_fallocate()
3354 static int find_desired_extent(struct inode *inode, loff_t *offset, int whence) in find_desired_extent() argument
3372 start = max_t(loff_t, 0, *offset); in find_desired_extent()
3412 *offset = min_t(loff_t, start, inode->i_size); in find_desired_extent()
3419 static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int whence) in btrfs_file_llseek() argument
3428 offset = generic_file_llseek(file, offset, whence); in btrfs_file_llseek()
3432 if (offset >= i_size_read(inode)) { in btrfs_file_llseek()
3437 ret = find_desired_extent(inode, &offset, whence); in btrfs_file_llseek()
3444 offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes); in btrfs_file_llseek()
3447 return offset; in btrfs_file_llseek()