Lines Matching refs:chunk_offset
1476 u64 chunk_offset, u64 start, u64 num_bytes) in btrfs_alloc_dev_extent() argument
1504 btrfs_set_dev_extent_chunk_offset(leaf, extent, chunk_offset); in btrfs_alloc_dev_extent()
2646 u64 chunk_offset) in btrfs_free_chunk() argument
2658 key.offset = chunk_offset; in btrfs_free_chunk()
2681 chunk_offset) in btrfs_del_sys_chunk() argument
2715 key.offset == chunk_offset) { in btrfs_del_sys_chunk()
2729 struct btrfs_root *root, u64 chunk_offset) in btrfs_remove_chunk() argument
2744 em = lookup_extent_mapping(em_tree, chunk_offset, 1); in btrfs_remove_chunk()
2747 if (!em || em->start > chunk_offset || in btrfs_remove_chunk()
2748 em->start + em->len < chunk_offset) { in btrfs_remove_chunk()
2793 ret = btrfs_free_chunk(trans, root, chunk_objectid, chunk_offset); in btrfs_remove_chunk()
2799 trace_btrfs_chunk_free(root, map, chunk_offset, em->len); in btrfs_remove_chunk()
2802 ret = btrfs_del_sys_chunk(root, chunk_objectid, chunk_offset); in btrfs_remove_chunk()
2809 ret = btrfs_remove_block_group(trans, extent_root, chunk_offset, em); in btrfs_remove_chunk()
2821 static int btrfs_relocate_chunk(struct btrfs_root *root, u64 chunk_offset) in btrfs_relocate_chunk() argument
2844 ret = btrfs_can_relocate(extent_root, chunk_offset); in btrfs_relocate_chunk()
2850 ret = btrfs_relocate_block_group(extent_root, chunk_offset); in btrfs_relocate_chunk()
2856 chunk_offset); in btrfs_relocate_chunk()
2867 ret = btrfs_remove_chunk(trans, root, chunk_offset); in btrfs_relocate_chunk()
3126 static int chunk_usage_range_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset, in chunk_usage_range_filter() argument
3135 cache = btrfs_lookup_block_group(fs_info, chunk_offset); in chunk_usage_range_filter()
3160 u64 chunk_offset, struct btrfs_balance_args *bargs) in chunk_usage_filter() argument
3166 cache = btrfs_lookup_block_group(fs_info, chunk_offset); in chunk_usage_filter()
3204 u64 chunk_offset, in chunk_drange_filter() argument
3248 u64 chunk_offset, in chunk_vrange_filter() argument
3251 if (chunk_offset < bargs->vend && in chunk_vrange_filter()
3252 chunk_offset + btrfs_chunk_length(leaf, chunk) > bargs->vstart) in chunk_vrange_filter()
3289 struct btrfs_chunk *chunk, u64 chunk_offset) in should_balance_chunk() argument
3316 chunk_usage_filter(bctl->fs_info, chunk_offset, bargs)) { in should_balance_chunk()
3319 chunk_usage_range_filter(bctl->fs_info, chunk_offset, bargs)) { in should_balance_chunk()
3331 chunk_drange_filter(leaf, chunk, chunk_offset, bargs)) { in should_balance_chunk()
3337 chunk_vrange_filter(leaf, chunk, chunk_offset, bargs)) { in should_balance_chunk()
4252 u64 chunk_offset; in btrfs_shrink_device() local
4328 chunk_offset = btrfs_dev_extent_chunk_offset(l, dev_extent); in btrfs_shrink_device()
4331 ret = btrfs_relocate_chunk(root, chunk_offset); in btrfs_shrink_device()
4783 u64 chunk_offset, u64 chunk_size) in btrfs_finish_chunk_alloc() argument
4801 em = lookup_extent_mapping(em_tree, chunk_offset, chunk_size); in btrfs_finish_chunk_alloc()
4806 "%Lu len %Lu", chunk_offset, chunk_size); in btrfs_finish_chunk_alloc()
4810 if (em->start != chunk_offset || em->len != chunk_size) { in btrfs_finish_chunk_alloc()
4812 " %Lu-%Lu, found %Lu-%Lu", chunk_offset, in btrfs_finish_chunk_alloc()
4838 chunk_offset, dev_offset, in btrfs_finish_chunk_alloc()
4867 key.offset = chunk_offset; in btrfs_finish_chunk_alloc()
4895 u64 chunk_offset; in btrfs_alloc_chunk() local
4898 chunk_offset = find_next_chunk(extent_root->fs_info); in btrfs_alloc_chunk()
4899 return __btrfs_alloc_chunk(trans, extent_root, chunk_offset, type); in btrfs_alloc_chunk()
4906 u64 chunk_offset; in init_first_rw_device() local
4913 chunk_offset = find_next_chunk(fs_info); in init_first_rw_device()
4915 ret = __btrfs_alloc_chunk(trans, extent_root, chunk_offset, in init_first_rw_device()
4945 int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset) in btrfs_chunk_readonly() argument
4955 em = lookup_extent_mapping(&map_tree->map_tree, chunk_offset, 1); in btrfs_chunk_readonly()