• Home
  • Raw
  • Download

Lines Matching refs:leaf

1758 	struct extent_buffer *leaf = NULL;  in btrfs_free_dev_extent()  local
1775 leaf = path->nodes[0]; in btrfs_free_dev_extent()
1776 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_free_dev_extent()
1777 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent()
1780 btrfs_dev_extent_length(leaf, extent) < start); in btrfs_free_dev_extent()
1785 leaf = path->nodes[0]; in btrfs_free_dev_extent()
1786 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent()
1792 *dev_extent_len = btrfs_dev_extent_length(leaf, extent); in btrfs_free_dev_extent()
1874 struct extent_buffer *leaf; in btrfs_add_dev_item() local
1893 leaf = path->nodes[0]; in btrfs_add_dev_item()
1894 dev_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dev_item); in btrfs_add_dev_item()
1896 btrfs_set_device_id(leaf, dev_item, device->devid); in btrfs_add_dev_item()
1897 btrfs_set_device_generation(leaf, dev_item, 0); in btrfs_add_dev_item()
1898 btrfs_set_device_type(leaf, dev_item, device->type); in btrfs_add_dev_item()
1899 btrfs_set_device_io_align(leaf, dev_item, device->io_align); in btrfs_add_dev_item()
1900 btrfs_set_device_io_width(leaf, dev_item, device->io_width); in btrfs_add_dev_item()
1901 btrfs_set_device_sector_size(leaf, dev_item, device->sector_size); in btrfs_add_dev_item()
1902 btrfs_set_device_total_bytes(leaf, dev_item, in btrfs_add_dev_item()
1904 btrfs_set_device_bytes_used(leaf, dev_item, in btrfs_add_dev_item()
1906 btrfs_set_device_group(leaf, dev_item, 0); in btrfs_add_dev_item()
1907 btrfs_set_device_seek_speed(leaf, dev_item, 0); in btrfs_add_dev_item()
1908 btrfs_set_device_bandwidth(leaf, dev_item, 0); in btrfs_add_dev_item()
1909 btrfs_set_device_start_offset(leaf, dev_item, 0); in btrfs_add_dev_item()
1912 write_extent_buffer(leaf, device->uuid, ptr, BTRFS_UUID_SIZE); in btrfs_add_dev_item()
1914 write_extent_buffer(leaf, trans->fs_info->fs_devices->metadata_uuid, in btrfs_add_dev_item()
1916 btrfs_mark_buffer_dirty(leaf); in btrfs_add_dev_item()
2564 struct extent_buffer *leaf; in btrfs_finish_sprout() local
2587 leaf = path->nodes[0]; in btrfs_finish_sprout()
2589 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_finish_sprout()
2595 leaf = path->nodes[0]; in btrfs_finish_sprout()
2596 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_finish_sprout()
2601 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_finish_sprout()
2606 dev_item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_finish_sprout()
2608 args.devid = btrfs_device_id(leaf, dev_item); in btrfs_finish_sprout()
2609 read_extent_buffer(leaf, dev_uuid, btrfs_device_uuid(dev_item), in btrfs_finish_sprout()
2611 read_extent_buffer(leaf, fs_uuid, btrfs_device_fsid(dev_item), in btrfs_finish_sprout()
2619 btrfs_set_device_generation(leaf, dev_item, in btrfs_finish_sprout()
2621 btrfs_mark_buffer_dirty(leaf); in btrfs_finish_sprout()
2895 struct extent_buffer *leaf; in btrfs_update_device() local
2915 leaf = path->nodes[0]; in btrfs_update_device()
2916 dev_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dev_item); in btrfs_update_device()
2918 btrfs_set_device_id(leaf, dev_item, device->devid); in btrfs_update_device()
2919 btrfs_set_device_type(leaf, dev_item, device->type); in btrfs_update_device()
2920 btrfs_set_device_io_align(leaf, dev_item, device->io_align); in btrfs_update_device()
2921 btrfs_set_device_io_width(leaf, dev_item, device->io_width); in btrfs_update_device()
2922 btrfs_set_device_sector_size(leaf, dev_item, device->sector_size); in btrfs_update_device()
2923 btrfs_set_device_total_bytes(leaf, dev_item, in btrfs_update_device()
2925 btrfs_set_device_bytes_used(leaf, dev_item, in btrfs_update_device()
2927 btrfs_mark_buffer_dirty(leaf); in btrfs_update_device()
3359 struct extent_buffer *leaf; in btrfs_relocate_sys_chunks() local
3395 leaf = path->nodes[0]; in btrfs_relocate_sys_chunks()
3396 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_relocate_sys_chunks()
3398 chunk = btrfs_item_ptr(leaf, path->slots[0], in btrfs_relocate_sys_chunks()
3400 chunk_type = btrfs_chunk_type(leaf, chunk); in btrfs_relocate_sys_chunks()
3479 struct extent_buffer *leaf; in insert_balance_item() local
3502 leaf = path->nodes[0]; in insert_balance_item()
3503 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item); in insert_balance_item()
3505 memzero_extent_buffer(leaf, (unsigned long)item, sizeof(*item)); in insert_balance_item()
3508 btrfs_set_balance_data(leaf, item, &disk_bargs); in insert_balance_item()
3510 btrfs_set_balance_meta(leaf, item, &disk_bargs); in insert_balance_item()
3512 btrfs_set_balance_sys(leaf, item, &disk_bargs); in insert_balance_item()
3514 btrfs_set_balance_flags(leaf, item, bctl->flags); in insert_balance_item()
3516 btrfs_mark_buffer_dirty(leaf); in insert_balance_item()
3700 static int chunk_devid_filter(struct extent_buffer *leaf, in chunk_devid_filter() argument
3705 int num_stripes = btrfs_chunk_num_stripes(leaf, chunk); in chunk_devid_filter()
3710 if (btrfs_stripe_devid(leaf, stripe) == bargs->devid) in chunk_devid_filter()
3727 static int chunk_drange_filter(struct extent_buffer *leaf, in chunk_drange_filter() argument
3732 int num_stripes = btrfs_chunk_num_stripes(leaf, chunk); in chunk_drange_filter()
3742 type = btrfs_chunk_type(leaf, chunk); in chunk_drange_filter()
3747 if (btrfs_stripe_devid(leaf, stripe) != bargs->devid) in chunk_drange_filter()
3750 stripe_offset = btrfs_stripe_offset(leaf, stripe); in chunk_drange_filter()
3751 stripe_length = btrfs_chunk_length(leaf, chunk); in chunk_drange_filter()
3763 static int chunk_vrange_filter(struct extent_buffer *leaf, in chunk_vrange_filter() argument
3769 chunk_offset + btrfs_chunk_length(leaf, chunk) > bargs->vstart) in chunk_vrange_filter()
3776 static int chunk_stripes_range_filter(struct extent_buffer *leaf, in chunk_stripes_range_filter() argument
3780 int num_stripes = btrfs_chunk_num_stripes(leaf, chunk); in chunk_stripes_range_filter()
3804 static int should_balance_chunk(struct extent_buffer *leaf, in should_balance_chunk() argument
3807 struct btrfs_fs_info *fs_info = leaf->fs_info; in should_balance_chunk()
3810 u64 chunk_type = btrfs_chunk_type(leaf, chunk); in should_balance_chunk()
3842 chunk_devid_filter(leaf, chunk, bargs)) { in should_balance_chunk()
3848 chunk_drange_filter(leaf, chunk, bargs)) { in should_balance_chunk()
3854 chunk_vrange_filter(leaf, chunk, chunk_offset, bargs)) { in should_balance_chunk()
3860 chunk_stripes_range_filter(leaf, chunk, bargs)) { in should_balance_chunk()
3902 struct extent_buffer *leaf; in __btrfs_balance() local
3969 leaf = path->nodes[0]; in __btrfs_balance()
3971 btrfs_item_key_to_cpu(leaf, &found_key, slot); in __btrfs_balance()
3978 chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk); in __btrfs_balance()
3979 chunk_type = btrfs_chunk_type(leaf, chunk); in __btrfs_balance()
3987 ret = should_balance_chunk(leaf, chunk, found_key.offset); in __btrfs_balance()
4526 struct extent_buffer *leaf; in btrfs_recover_balance() local
4552 leaf = path->nodes[0]; in btrfs_recover_balance()
4553 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item); in btrfs_recover_balance()
4555 bctl->flags = btrfs_balance_flags(leaf, item); in btrfs_recover_balance()
4558 btrfs_balance_data(leaf, item, &disk_bargs); in btrfs_recover_balance()
4560 btrfs_balance_meta(leaf, item, &disk_bargs); in btrfs_recover_balance()
4562 btrfs_balance_sys(leaf, item, &disk_bargs); in btrfs_recover_balance()
7191 static int read_one_chunk(struct btrfs_key *key, struct extent_buffer *leaf, in read_one_chunk() argument
7195 struct btrfs_fs_info *fs_info = leaf->fs_info; in read_one_chunk()
7210 length = btrfs_chunk_length(leaf, chunk); in read_one_chunk()
7211 type = btrfs_chunk_type(leaf, chunk); in read_one_chunk()
7213 num_stripes = btrfs_chunk_num_stripes(leaf, chunk); in read_one_chunk()
7226 if (leaf->start == BTRFS_SUPER_INFO_OFFSET) { in read_one_chunk()
7227 ret = btrfs_check_chunk_valid(leaf, chunk, logical); in read_one_chunk()
7262 map->io_width = btrfs_chunk_io_width(leaf, chunk); in read_one_chunk()
7263 map->io_align = btrfs_chunk_io_align(leaf, chunk); in read_one_chunk()
7264 map->stripe_len = btrfs_chunk_stripe_len(leaf, chunk); in read_one_chunk()
7279 btrfs_stripe_offset_nr(leaf, chunk, i); in read_one_chunk()
7280 devid = btrfs_stripe_devid_nr(leaf, chunk, i); in read_one_chunk()
7282 read_extent_buffer(leaf, uuid, (unsigned long) in read_one_chunk()
7314 static void fill_device_from_item(struct extent_buffer *leaf, in fill_device_from_item() argument
7320 device->devid = btrfs_device_id(leaf, dev_item); in fill_device_from_item()
7321 device->disk_total_bytes = btrfs_device_total_bytes(leaf, dev_item); in fill_device_from_item()
7324 device->bytes_used = btrfs_device_bytes_used(leaf, dev_item); in fill_device_from_item()
7326 device->type = btrfs_device_type(leaf, dev_item); in fill_device_from_item()
7327 device->io_align = btrfs_device_io_align(leaf, dev_item); in fill_device_from_item()
7328 device->io_width = btrfs_device_io_width(leaf, dev_item); in fill_device_from_item()
7329 device->sector_size = btrfs_device_sector_size(leaf, dev_item); in fill_device_from_item()
7334 read_extent_buffer(leaf, device->uuid, ptr, BTRFS_UUID_SIZE); in fill_device_from_item()
7391 static int read_one_dev(struct extent_buffer *leaf, in read_one_dev() argument
7395 struct btrfs_fs_info *fs_info = leaf->fs_info; in read_one_dev()
7403 devid = btrfs_device_id(leaf, dev_item); in read_one_dev()
7405 read_extent_buffer(leaf, dev_uuid, btrfs_device_uuid(dev_item), in read_one_dev()
7407 read_extent_buffer(leaf, fs_uuid, btrfs_device_fsid(dev_item), in read_one_dev()
7476 btrfs_device_generation(leaf, dev_item)) in read_one_dev()
7480 fill_device_from_item(leaf, dev_item, device); in read_one_dev()
7686 struct extent_buffer *leaf; in btrfs_read_chunk_tree() local
7738 leaf = path->nodes[0]; in btrfs_read_chunk_tree()
7749 dev_item = btrfs_item_ptr(leaf, slot, in btrfs_read_chunk_tree()
7751 ret = read_one_dev(leaf, dev_item); in btrfs_read_chunk_tree()
7766 chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk); in btrfs_read_chunk_tree()
7767 ret = read_one_chunk(&found_key, leaf, chunk); in btrfs_read_chunk_tree()
8337 struct extent_buffer *leaf = path->nodes[0]; in btrfs_verify_dev_extents() local
8345 btrfs_item_key_to_cpu(leaf, &key, slot); in btrfs_verify_dev_extents()
8351 dext = btrfs_item_ptr(leaf, slot, struct btrfs_dev_extent); in btrfs_verify_dev_extents()
8352 chunk_offset = btrfs_dev_extent_chunk_offset(leaf, dext); in btrfs_verify_dev_extents()
8353 physical_len = btrfs_dev_extent_length(leaf, dext); in btrfs_verify_dev_extents()