/linux/fs/btrfs/ |
H A D | free-space-tree.c | 212 struct btrfs_key key, found_key; in convert_free_space_to_bitmaps() local 246 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0] - 1); in convert_free_space_to_bitmaps() 248 if (found_key.type == BTRFS_FREE_SPACE_INFO_KEY) { in convert_free_space_to_bitmaps() 249 ASSERT(found_key.objectid == block_group->start); in convert_free_space_to_bitmaps() 250 ASSERT(found_key.offset == block_group->length); in convert_free_space_to_bitmaps() 253 } else if (found_key.type == BTRFS_FREE_SPACE_EXTENT_KEY) { in convert_free_space_to_bitmaps() 256 ASSERT(found_key.objectid >= start); in convert_free_space_to_bitmaps() 257 ASSERT(found_key.objectid < end); in convert_free_space_to_bitmaps() 258 ASSERT(found_key.objectid + found_key.offset <= end); in convert_free_space_to_bitmaps() 260 first = div_u64(found_key.objectid - start, in convert_free_space_to_bitmaps() [all …]
|
H A D | inode-item.c | 409 struct btrfs_key found_key; in btrfs_lookup_inode() local 416 btrfs_item_key_to_cpu(leaf, &found_key, slot); in btrfs_lookup_inode() 417 if (found_key.objectid == location->objectid && in btrfs_lookup_inode() 418 found_key.type == location->type) { in btrfs_lookup_inode() 467 struct btrfs_key found_key; in btrfs_truncate_inode_items() local 533 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_truncate_inode_items() 534 found_type = found_key.type; in btrfs_truncate_inode_items() 536 if (found_key.objectid != control->ino) in btrfs_truncate_inode_items() 542 item_end = found_key.offset; in btrfs_truncate_inode_items() 554 found_key.offset, extent_type, in btrfs_truncate_inode_items() [all …]
|
H A D | export.c | 155 struct btrfs_key found_key; in btrfs_get_parent() local 193 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_get_parent() 194 if (found_key.objectid != key.objectid || found_key.type != key.type) { in btrfs_get_parent() 199 if (found_key.type == BTRFS_ROOT_BACKREF_KEY) { in btrfs_get_parent() 204 key.objectid = found_key.offset; in btrfs_get_parent() 208 if (found_key.type == BTRFS_ROOT_BACKREF_KEY) { in btrfs_get_parent() 210 found_key.offset, 0); in btrfs_get_parent()
|
H A D | file-item.c | 209 struct btrfs_key found_key; in btrfs_lookup_csum() local 228 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_lookup_csum() 229 if (found_key.type != BTRFS_EXTENT_CSUM_KEY) in btrfs_lookup_csum() 232 csum_offset = (bytenr - found_key.offset) >> in btrfs_lookup_csum() 1024 struct btrfs_key found_key; in find_next_csum_offset() local 1039 btrfs_item_key_to_cpu(path->nodes[0], &found_key, slot); in find_next_csum_offset() 1041 if (found_key.objectid != BTRFS_EXTENT_CSUM_OBJECTID || in find_next_csum_offset() 1042 found_key.type != BTRFS_EXTENT_CSUM_KEY) in find_next_csum_offset() 1045 *next_offset = found_key.offset; in find_next_csum_offset() 1056 struct btrfs_key found_key; in btrfs_csum_file_blocks() local [all …]
|
H A D | backref.c | 1016 struct btrfs_key found_key; in add_inline_refs() local 1039 btrfs_item_key_to_cpu(leaf, &found_key, slot); in add_inline_refs() 1044 if (found_key.type == BTRFS_EXTENT_ITEM_KEY && in add_inline_refs() 1052 } else if (found_key.type == BTRFS_METADATA_ITEM_KEY) { in add_inline_refs() 1053 *info_level = found_key.offset; in add_inline_refs() 2051 struct btrfs_key found_key; in btrfs_find_one_extref() local 2086 btrfs_item_key_to_cpu(leaf, &found_key, slot); in btrfs_find_one_extref() 2095 if (found_key.objectid != inode_objectid) in btrfs_find_one_extref() 2097 if (found_key.type != BTRFS_INODE_EXTREF_KEY) in btrfs_find_one_extref() 2105 *found_off = found_key.offset; in btrfs_find_one_extref() [all …]
|
H A D | root-tree.c | 71 struct btrfs_key found_key; in btrfs_find_root() local 101 btrfs_item_key_to_cpu(l, &found_key, slot); in btrfs_find_root() 102 if (found_key.objectid != search_key->objectid || in btrfs_find_root() 103 found_key.type != BTRFS_ROOT_ITEM_KEY) { in btrfs_find_root() 111 memcpy(root_key, &found_key, sizeof(found_key)); in btrfs_find_root()
|
H A D | raid-stripe-tree.c | 261 struct btrfs_key found_key; in btrfs_get_raid_extent_offset() local 298 btrfs_item_key_to_cpu(leaf, &found_key, slot); in btrfs_get_raid_extent_offset() 299 found_logical = found_key.objectid; in btrfs_get_raid_extent_offset() 300 found_length = found_key.offset; in btrfs_get_raid_extent_offset()
|
H A D | xattr.c | 278 struct btrfs_key found_key; in btrfs_listxattr() local 302 btrfs_for_each_slot(root, &key, &found_key, path, iter_ret) { in btrfs_listxattr() 313 if (found_key.objectid != key.objectid) in btrfs_listxattr() 315 if (found_key.type > BTRFS_XATTR_ITEM_KEY) in btrfs_listxattr() 317 if (found_key.type < BTRFS_XATTR_ITEM_KEY) in btrfs_listxattr()
|
H A D | send.c | 994 struct btrfs_key *found_key, int resolve, in iterate_inode_ref() argument 1024 if (found_key->type == BTRFS_INODE_REF_KEY) { in iterate_inode_ref() 1038 if (found_key->type == BTRFS_INODE_REF_KEY) { in iterate_inode_ref() 1042 dir = found_key->offset; in iterate_inode_ref() 1075 found_key->objectid, in iterate_inode_ref() 1076 found_key->type, in iterate_inode_ref() 1077 found_key->offset); in iterate_inode_ref() 1244 struct btrfs_key key, found_key; in get_inode_path() local 1264 btrfs_item_key_to_cpu(p->nodes[0], &found_key, p->slots[0]); in get_inode_path() 1265 if (found_key.objectid != ino || in get_inode_path() [all …]
|
H A D | tree-log.c | 1805 struct btrfs_key found_key; in delete_conflicting_dir_entry() local 1807 btrfs_dir_item_key_to_cpu(path->nodes[0], dst_di, &found_key); in delete_conflicting_dir_entry() 1809 if (found_key.objectid == log_key->objectid && in delete_conflicting_dir_entry() 1810 found_key.type == log_key->type && in delete_conflicting_dir_entry() 1811 found_key.offset == log_key->offset && in delete_conflicting_dir_entry() 2310 struct btrfs_key found_key; in replay_dir_deletes() local 2360 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in replay_dir_deletes() 2362 if (found_key.objectid != dirid || in replay_dir_deletes() 2363 found_key.type != dir_key.type) { in replay_dir_deletes() 2368 if (found_key.offset > range_end) in replay_dir_deletes() [all …]
|
H A D | inode.c | 217 struct btrfs_key found_key = { 0 }; in print_data_reloc_error() local 250 ret = extent_from_logical(fs_info, logical, &path, &found_key, &flags); in print_data_reloc_error() 265 ret = tree_backref_for_extent(&ptr, eb, &found_key, ei, in print_data_reloc_error() 290 ctx.bytenr = found_key.objectid; in print_data_reloc_error() 291 ctx.extent_item_pos = logical - found_key.objectid; in print_data_reloc_error() 295 reloc_warn.extent_item_size = found_key.offset; in print_data_reloc_error() 2013 struct btrfs_key found_key; in run_delalloc_nocow() local 2034 btrfs_item_key_to_cpu(leaf, &found_key, in run_delalloc_nocow() 2036 if (found_key.objectid == ino && in run_delalloc_nocow() 2037 found_key.type == BTRFS_EXTENT_DATA_KEY) in run_delalloc_nocow() [all …]
|
H A D | ctree.c | 1710 struct btrfs_key *found_key) in btrfs_find_item() argument 1717 ASSERT(found_key); in btrfs_find_item() 1735 btrfs_item_key_to_cpu(eb, found_key, path->slots[0]); in btrfs_find_item() 1736 if (found_key->type != key.type || in btrfs_find_item() 1737 found_key->objectid != key.objectid) in btrfs_find_item() 2403 struct btrfs_disk_key found_key; in btrfs_prev_leaf() local 2439 btrfs_item_key(path->nodes[0], &found_key, path->slots[0]); in btrfs_prev_leaf() 2440 ret = btrfs_comp_keys(&found_key, &orig_key); in btrfs_prev_leaf() 2454 btrfs_item_key(path->nodes[0], &found_key, 0); in btrfs_prev_leaf() 2455 ret = btrfs_comp_keys(&found_key, &key); in btrfs_prev_leaf() [all …]
|
H A D | scrub.c | 483 struct btrfs_key found_key; in scrub_print_common_warning() local 506 ret = extent_from_logical(fs_info, swarn.logical, path, &found_key, in scrub_print_common_warning() 511 swarn.extent_item_size = found_key.offset; in scrub_print_common_warning() 523 ret = tree_backref_for_extent(&ptr, eb, &found_key, ei, in scrub_print_common_warning() 546 ctx.bytenr = found_key.objectid; in scrub_print_common_warning() 547 ctx.extent_item_pos = swarn.logical - found_key.objectid; in scrub_print_common_warning() 2487 struct btrfs_key found_key; in scrub_enumerate_chunks() local 2527 btrfs_item_key_to_cpu(l, &found_key, slot); in scrub_enumerate_chunks() 2529 if (found_key.objectid != scrub_dev->devid) in scrub_enumerate_chunks() 2532 if (found_key.type != BTRFS_DEV_EXTENT_KEY) in scrub_enumerate_chunks() [all …]
|
H A D | qgroup.c | 377 struct btrfs_key found_key; in btrfs_read_qgroup_config() local 422 btrfs_item_key_to_cpu(l, &found_key, slot); in btrfs_read_qgroup_config() 424 if (found_key.type == BTRFS_QGROUP_STATUS_KEY) { in btrfs_read_qgroup_config() 448 if (found_key.type != BTRFS_QGROUP_INFO_KEY && in btrfs_read_qgroup_config() 449 found_key.type != BTRFS_QGROUP_LIMIT_KEY) in btrfs_read_qgroup_config() 452 qgroup = find_qgroup_rb(fs_info, found_key.offset); in btrfs_read_qgroup_config() 453 if ((qgroup && found_key.type == BTRFS_QGROUP_INFO_KEY) || in btrfs_read_qgroup_config() 454 (!qgroup && found_key.type == BTRFS_QGROUP_LIMIT_KEY)) { in btrfs_read_qgroup_config() 467 qgroup = add_qgroup_rb(fs_info, prealloc, found_key.offset); in btrfs_read_qgroup_config() 492 switch (found_key.type) { in btrfs_read_qgroup_config() [all …]
|
H A D | print-tree.c | 244 struct btrfs_key found_key; in btrfs_print_leaf() local 273 btrfs_dir_item_key_to_cpu(l, di, &found_key); in btrfs_print_leaf() 275 found_key.objectid, in btrfs_print_leaf()
|
H A D | ctree.h | 613 u64 inum, u64 ioff, u8 key_type, struct btrfs_key *found_key); 719 #define btrfs_for_each_slot(root, key, found_key, path, iter_ret) \ argument 722 (iter_ret = btrfs_get_next_valid_item((root), (found_key), (path))) == 0; \
|
H A D | dev-replace.c | 457 struct btrfs_key found_key; in mark_block_group_to_copy() local 513 btrfs_for_each_slot(root, &key, &found_key, path, iter_ret) { in mark_block_group_to_copy() 516 if (found_key.objectid != src_dev->devid) in mark_block_group_to_copy() 519 if (found_key.type != BTRFS_DEV_EXTENT_KEY) in mark_block_group_to_copy() 522 if (found_key.offset < key.offset) in mark_block_group_to_copy()
|
H A D | volumes.c | 1890 struct btrfs_key found_key; in btrfs_free_dev_extent() local 1909 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_free_dev_extent() 1912 BUG_ON(found_key.offset > start || found_key.offset + in btrfs_free_dev_extent() 1914 key = found_key; in btrfs_free_dev_extent() 1958 struct btrfs_key found_key; in find_next_devid() local 1986 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in find_next_devid() 1988 *devid_ret = found_key.offset + 1; in find_next_devid() 3551 struct btrfs_key found_key; in btrfs_relocate_sys_chunks() local 3596 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_relocate_sys_chunks() 3604 ret = btrfs_relocate_chunk(fs_info, found_key.offset); in btrfs_relocate_sys_chunks() [all …]
|
H A D | tree-checker.c | 2216 struct btrfs_key found_key; in btrfs_verify_level_key() local 2251 btrfs_node_key_to_cpu(eb, &found_key, 0); in btrfs_verify_level_key() 2253 btrfs_item_key_to_cpu(eb, &found_key, 0); in btrfs_verify_level_key() 2254 ret = btrfs_comp_cpu_keys(&check->first_key, &found_key); in btrfs_verify_level_key() 2263 found_key.objectid, found_key.type, in btrfs_verify_level_key() 2264 found_key.offset); in btrfs_verify_level_key()
|
H A D | block-group.c | 583 struct btrfs_key *found_key) in sample_block_group_extent_item() argument 615 btrfs_for_each_slot(extent_root, &search_key, found_key, path, ret) { in sample_block_group_extent_item() 617 if (found_key->type == BTRFS_EXTENT_ITEM_KEY && in sample_block_group_extent_item() 618 found_key->objectid >= block_group->start && in sample_block_group_extent_item() 619 found_key->objectid + found_key->offset <= search_end) in sample_block_group_extent_item() 623 if (found_key->objectid >= search_end) { in sample_block_group_extent_item() 2062 struct btrfs_key found_key; in find_first_block_group() local 2064 btrfs_for_each_slot(root, key, &found_key, path, ret) { in find_first_block_group() 2065 if (found_key.objectid >= key->objectid && in find_first_block_group() 2066 found_key.type == BTRFS_BLOCK_GROUP_ITEM_KEY) { in find_first_block_group() [all …]
|
H A D | zoned.c | 1213 struct btrfs_key found_key; in calculate_alloc_pointer() local 1257 btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]); in calculate_alloc_pointer() 1259 if (found_key.type == BTRFS_EXTENT_ITEM_KEY) in calculate_alloc_pointer() 1260 length = found_key.offset; in calculate_alloc_pointer() 1264 if (!(found_key.objectid >= cache->start && in calculate_alloc_pointer() 1265 found_key.objectid + length <= cache->start + cache->length)) { in calculate_alloc_pointer() 1268 *offset_ret = found_key.objectid + length - cache->start; in calculate_alloc_pointer()
|
H A D | backref.h | 217 struct btrfs_path *path, struct btrfs_key *found_key,
|
H A D | disk-io.c | 433 struct btrfs_key found_key; in btrfs_validate_extent_buffer() local 436 btrfs_node_key_to_cpu(eb, &found_key, 0); in btrfs_validate_extent_buffer() 438 btrfs_item_key_to_cpu(eb, &found_key, 0); in btrfs_validate_extent_buffer() 439 if (unlikely(btrfs_comp_cpu_keys(expect_key, &found_key))) { in btrfs_validate_extent_buffer() 445 found_key.objectid, found_key.type, in btrfs_validate_extent_buffer() 446 found_key.offset); in btrfs_validate_extent_buffer() 4836 struct btrfs_key found_key; in btrfs_init_root_free_objectid() local 4860 btrfs_item_key_to_cpu(l, &found_key, slot); in btrfs_init_root_free_objectid() 4861 root->free_objectid = max_t(u64, found_key.objectid + 1, in btrfs_init_root_free_objectid()
|
H A D | free-space-cache.c | 1172 struct btrfs_key found_key; in update_cache_item() local 1175 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in update_cache_item() 1176 if (found_key.objectid != BTRFS_FREE_SPACE_OBJECTID || in update_cache_item() 1177 found_key.offset != offset) { in update_cache_item()
|