Lines Matching refs:key
142 struct btrfs_key key; member
583 struct btrfs_key key; in read_fs_root() local
585 key.objectid = root_objectid; in read_fs_root()
586 key.type = BTRFS_ROOT_ITEM_KEY; in read_fs_root()
588 key.offset = 0; in read_fs_root()
590 key.offset = (u64)-1; in read_fs_root()
592 return btrfs_read_fs_root_no_name(fs_info, &key); in read_fs_root()
679 struct btrfs_key key; local
711 key.objectid = cur->bytenr;
712 key.type = BTRFS_EXTENT_ITEM_KEY;
713 key.offset = (u64)-1;
717 ret = btrfs_search_slot(NULL, rc->extent_root, &key, path1,
764 btrfs_item_key_to_cpu(eb, &key, path1->slots[0]);
765 if (key.objectid != cur->bytenr) {
770 if (key.type == BTRFS_EXTENT_ITEM_KEY) {
782 key.type = btrfs_extent_inline_ref_type(eb, iref);
783 key.offset = btrfs_extent_inline_ref_offset(eb, iref);
784 WARN_ON(key.type != BTRFS_TREE_BLOCK_REF_KEY &&
785 key.type != BTRFS_SHARED_BLOCK_REF_KEY);
789 ((key.type == BTRFS_TREE_BLOCK_REF_KEY &&
790 exist->owner == key.offset) ||
791 (key.type == BTRFS_SHARED_BLOCK_REF_KEY &&
792 exist->bytenr == key.offset))) {
798 if (key.type == BTRFS_SHARED_BLOCK_REF_KEY ||
799 key.type == BTRFS_EXTENT_REF_V0_KEY) {
800 if (key.type == BTRFS_EXTENT_REF_V0_KEY) {
804 if (key.objectid == key.offset) {
817 BUG_ON(key.type == BTRFS_EXTENT_REF_V0_KEY);
818 if (key.type == BTRFS_SHARED_BLOCK_REF_KEY) {
820 if (key.objectid == key.offset) {
836 rb_node = tree_search(&cache->rb_root, key.offset);
844 upper->bytenr = key.offset;
862 } else if (key.type != BTRFS_TREE_BLOCK_REF_KEY) {
867 root = read_fs_root(rc->extent_root->fs_info, key.offset);
984 ptr += btrfs_extent_inline_ref_size(key.type);
1486 if (bytenr >= block_group->key.objectid &&
1487 bytenr < block_group->key.objectid + block_group->key.offset)
1549 struct btrfs_key key; local
1575 btrfs_item_key_to_cpu(leaf, &key, i);
1576 if (key.type != BTRFS_EXTENT_DATA_KEY)
1595 inode = find_next_inode(root, key.objectid);
1597 } else if (inode && btrfs_ino(inode) < key.objectid) {
1599 inode = find_next_inode(root, key.objectid);
1601 if (inode && btrfs_ino(inode) == key.objectid) {
1602 end = key.offset +
1604 WARN_ON(!IS_ALIGNED(key.offset,
1609 key.offset, end);
1613 btrfs_drop_extent_cache(inode, key.offset, end,
1616 key.offset, end);
1631 key.offset -= btrfs_file_extent_offset(leaf, fi);
1635 key.objectid, key.offset, 1);
1640 key.objectid, key.offset, 1);
1678 struct btrfs_key key; local
1696 btrfs_node_key_to_cpu(path->nodes[lowest_level], &key, slot);
1725 ret = btrfs_bin_search(parent, &key, level, &slot);
1785 btrfs_node_key_to_cpu(path->nodes[level], &key,
1790 ret = btrfs_search_slot(trans, src, &key, path, 0, 1);
1995 struct btrfs_key *key) argument
2003 btrfs_node_key_to_cpu(path->nodes[level], key,
2020 struct btrfs_key key; local
2049 btrfs_disk_key_to_cpu(&key, &root_item->drop_progress);
2054 ret = btrfs_search_slot(NULL, reloc_root, &key, path, 0, 0);
2063 WARN_ON(memcmp(&key, &next_key, sizeof(key)));
2095 if (!find_next_key(path, level, &key) &&
2096 btrfs_comp_cpu_keys(&next_key, &key) >= 0) {
2109 btrfs_node_key_to_cpu(path->nodes[level], &key,
2133 invalidate_extent_cache(root, &key, &next_key);
2163 invalidate_extent_cache(root, &key, &next_key);
2488 struct btrfs_key *key, argument
2517 ret = btrfs_bin_search(upper->eb, key,
2528 ret = btrfs_search_slot(trans, root, key, path, 0, 1);
2548 ret = btrfs_bin_search(upper->eb, key, upper->level,
2623 struct btrfs_key key; local
2625 btrfs_node_key_to_cpu(node->eb, &key, 0);
2626 return do_relocation(trans, rc, node, &key, path, 0);
2724 block->key.objectid, block->key.offset);
2728 btrfs_item_key_to_cpu(eb, &block->key, 0);
2730 btrfs_node_key_to_cpu(eb, &block->key, 0);
2741 block->key.objectid, block->key.offset);
2751 struct btrfs_key *key, argument
2786 ret = btrfs_search_slot(trans, root, key, path, 0, 1);
2794 ret = do_relocation(trans, rc, node, key, path, 1);
2843 node = build_backref_tree(rc, &block->key,
2850 ret = relocate_tree_block(trans, rc, node, &block->key,
3088 struct btrfs_key key; local
3107 btrfs_item_key_to_cpu(leaf, &key, slot);
3108 if (key.objectid != extent_key->objectid)
3111 if (key.type != BTRFS_EXTENT_REF_V0_KEY) {
3179 block->key.objectid = extent_key->offset;
3180 block->key.offset = generation;
3199 struct btrfs_key key; local
3212 key.objectid = bytenr;
3213 key.type = BTRFS_EXTENT_ITEM_KEY;
3214 key.offset = blocksize;
3218 ret = btrfs_search_slot(NULL, rc->extent_root, &key, path, 0, 0);
3223 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
3224 ret = add_tree_block(rc, &key, path, blocks);
3257 struct btrfs_key key; local
3267 key.objectid = ino;
3268 key.type = BTRFS_INODE_ITEM_KEY;
3269 key.offset = 0;
3271 inode = btrfs_iget(fs_info->sb, &key, root, NULL);
3318 struct btrfs_key key; local
3357 key.objectid = ref_objectid;
3358 key.type = BTRFS_EXTENT_DATA_KEY;
3360 key.offset = 0;
3362 key.offset = ref_offset;
3366 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
3419 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
3420 if (key.objectid != ref_objectid ||
3421 key.type != BTRFS_EXTENT_DATA_KEY) {
3437 key.offset -= btrfs_file_extent_offset(leaf, fi);
3438 if (key.offset != ref_offset)
3453 btrfs_item_key_to_cpu(leaf, &block->key, 0);
3484 struct btrfs_key key; local
3506 key.type = btrfs_extent_inline_ref_type(eb, iref);
3507 if (key.type == BTRFS_SHARED_DATA_REF_KEY) {
3508 key.offset = btrfs_extent_inline_ref_offset(eb, iref);
3509 ret = __add_tree_block(rc, key.offset, blocksize,
3511 } else if (key.type == BTRFS_EXTENT_DATA_REF_KEY) {
3518 ptr += btrfs_extent_inline_ref_size(key.type);
3536 btrfs_item_key_to_cpu(eb, &key, path->slots[0]);
3537 if (key.objectid != extent_key->objectid)
3541 if (key.type == BTRFS_SHARED_DATA_REF_KEY ||
3542 key.type == BTRFS_EXTENT_REF_V0_KEY) {
3544 BUG_ON(key.type == BTRFS_EXTENT_REF_V0_KEY);
3545 if (key.type == BTRFS_SHARED_DATA_REF_KEY) {
3547 ret = __add_tree_block(rc, key.offset, blocksize,
3549 } else if (key.type == BTRFS_EXTENT_DATA_REF_KEY) {
3577 struct btrfs_key key; local
3582 last = rc->block_group->key.objectid + rc->block_group->key.offset;
3590 key.objectid = rc->search_start;
3591 key.type = BTRFS_EXTENT_ITEM_KEY;
3592 key.offset = 0;
3596 ret = btrfs_search_slot(NULL, rc->extent_root, &key, path,
3609 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
3610 if (key.objectid >= last) {
3615 if (key.type != BTRFS_EXTENT_ITEM_KEY ||
3616 key.objectid + key.offset <= rc->search_start) {
3622 key.objectid, &start, &end,
3625 if (ret == 0 && start <= key.objectid) {
3629 rc->search_start = key.objectid + key.offset;
3630 memcpy(extent_key, &key, sizeof(key));
3691 rc->search_start = rc->block_group->key.objectid;
3708 struct btrfs_key key; local
3740 ret = find_next_extent(trans, rc, path, &key);
3763 ret = get_ref_objectid_v0(rc, path, &key, &ref_owner,
3776 &key, path, 0, 0);
3789 ret = add_tree_block(rc, &key, path, &blocks);
3792 ret = add_data_references(rc, &key, path, &blocks);
3810 rc->search_start = key.objectid;
3839 &key, &rc->cluster);
3941 struct btrfs_key key; local
3961 key.objectid = objectid;
3962 key.type = BTRFS_INODE_ITEM_KEY;
3963 key.offset = 0;
3964 inode = btrfs_iget(root->fs_info->sb, &key, root, NULL);
3966 BTRFS_I(inode)->index_cnt = group->key.objectid;
4055 (unsigned long long)rc->block_group->key.objectid,
4088 rc->block_group->key.objectid,
4089 rc->block_group->key.objectid +
4090 rc->block_group->key.offset - 1);
4135 struct btrfs_key key; local
4150 key.objectid = BTRFS_TREE_RELOC_OBJECTID;
4151 key.type = BTRFS_ROOT_ITEM_KEY;
4152 key.offset = (u64)-1;
4155 ret = btrfs_search_slot(NULL, root->fs_info->tree_root, &key,
4167 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
4170 if (key.objectid != BTRFS_TREE_RELOC_OBJECTID ||
4171 key.type != BTRFS_ROOT_ITEM_KEY)
4174 reloc_root = btrfs_read_fs_root_no_radix(root, &key);
4199 if (key.offset == 0)
4202 key.offset--;