Lines Matching refs:leaf
386 struct extent_buffer *leaf, in btrfs_check_chunk_valid() argument
403 btrfs_item_size_nr(leaf, slot) < sizeof(struct btrfs_chunk)) { in btrfs_check_chunk_valid()
405 btrfs_item_size_nr(leaf, slot), in btrfs_check_chunk_valid()
410 length = btrfs_chunk_length(leaf, chunk); in btrfs_check_chunk_valid()
411 stripe_len = btrfs_chunk_stripe_len(leaf, chunk); in btrfs_check_chunk_valid()
412 num_stripes = btrfs_chunk_num_stripes(leaf, chunk); in btrfs_check_chunk_valid()
413 sub_stripes = btrfs_chunk_sub_stripes(leaf, chunk); in btrfs_check_chunk_valid()
414 type = btrfs_chunk_type(leaf, chunk); in btrfs_check_chunk_valid()
422 btrfs_item_size_nr(leaf, slot)) { in btrfs_check_chunk_valid()
424 btrfs_item_size_nr(leaf, slot), in btrfs_check_chunk_valid()
436 if (btrfs_chunk_sector_size(leaf, chunk) != sectorsize) { in btrfs_check_chunk_valid()
438 (unsigned long long)btrfs_chunk_sector_size(leaf, chunk)); in btrfs_check_chunk_valid()
484 (slot >= 0 && chunk_ondisk_size > btrfs_item_size_nr(leaf, slot))) { in btrfs_check_chunk_valid()
516 struct extent_buffer *leaf, in read_one_chunk() argument
531 length = btrfs_chunk_length(leaf, chunk); in read_one_chunk()
532 num_stripes = btrfs_chunk_num_stripes(leaf, chunk); in read_one_chunk()
534 ret = btrfs_check_chunk_valid(fs_info, leaf, chunk, slot, logical); in read_one_chunk()
556 map->io_width = btrfs_chunk_io_width(leaf, chunk); in read_one_chunk()
557 map->io_align = btrfs_chunk_io_align(leaf, chunk); in read_one_chunk()
558 map->sector_size = btrfs_chunk_sector_size(leaf, chunk); in read_one_chunk()
559 map->stripe_len = btrfs_chunk_stripe_len(leaf, chunk); in read_one_chunk()
560 map->type = btrfs_chunk_type(leaf, chunk); in read_one_chunk()
561 map->sub_stripes = btrfs_chunk_sub_stripes(leaf, chunk); in read_one_chunk()
565 btrfs_stripe_offset_nr(leaf, chunk, i); in read_one_chunk()
566 devid = btrfs_stripe_devid_nr(leaf, chunk, i); in read_one_chunk()
567 read_extent_buffer(leaf, uuid, (unsigned long) in read_one_chunk()
591 static int fill_device_from_item(struct extent_buffer *leaf, in fill_device_from_item() argument
597 device->devid = btrfs_device_id(leaf, dev_item); in fill_device_from_item()
598 device->total_bytes = btrfs_device_total_bytes(leaf, dev_item); in fill_device_from_item()
599 device->bytes_used = btrfs_device_bytes_used(leaf, dev_item); in fill_device_from_item()
600 device->type = btrfs_device_type(leaf, dev_item); in fill_device_from_item()
601 device->io_align = btrfs_device_io_align(leaf, dev_item); in fill_device_from_item()
602 device->io_width = btrfs_device_io_width(leaf, dev_item); in fill_device_from_item()
603 device->sector_size = btrfs_device_sector_size(leaf, dev_item); in fill_device_from_item()
606 read_extent_buffer(leaf, device->uuid, ptr, BTRFS_UUID_SIZE); in fill_device_from_item()
612 struct extent_buffer *leaf, in read_one_dev() argument
621 devid = btrfs_device_id(leaf, dev_item); in read_one_dev()
622 read_extent_buffer(leaf, dev_uuid, in read_one_dev()
625 read_extent_buffer(leaf, fs_uuid, in read_one_dev()
643 fill_device_from_item(leaf, dev_item, device); in read_one_dev()
645 btrfs_device_total_bytes(leaf, dev_item); in read_one_dev()
743 struct extent_buffer *leaf; in btrfs_read_chunk_tree() local
767 leaf = path->nodes[0]; in btrfs_read_chunk_tree()
769 if (slot >= btrfs_header_nritems(leaf)) { in btrfs_read_chunk_tree()
777 btrfs_item_key_to_cpu(leaf, &found_key, slot); in btrfs_read_chunk_tree()
780 dev_item = btrfs_item_ptr(leaf, slot, in btrfs_read_chunk_tree()
782 ret = read_one_dev(fs_info, leaf, dev_item); in btrfs_read_chunk_tree()
787 chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk); in btrfs_read_chunk_tree()
788 ret = read_one_chunk(fs_info, &found_key, leaf, chunk, in btrfs_read_chunk_tree()
809 struct extent_buffer *leaf, in btrfs_stripe_length() argument
814 u32 num_stripes = btrfs_chunk_num_stripes(leaf, chunk); in btrfs_stripe_length()
815 u64 profile = btrfs_chunk_type(leaf, chunk) & in btrfs_stripe_length()
818 chunk_len = btrfs_chunk_length(leaf, chunk); in btrfs_stripe_length()
839 btrfs_chunk_sub_stripes(leaf, chunk)); in btrfs_stripe_length()