Lines Matching refs:key

36 			      const struct btrfs_key *key,
42 u64 offset = key->offset;
73 ret = ctx->indirect_ref_iterator(key->objectid, offset,
86 e->inum = key->objectid;
109 struct btrfs_key key;
118 * the key. thus, we must look into all items and see that we
123 btrfs_item_key_to_cpu(eb, &key, slot);
124 if (key.type != BTRFS_EXTENT_DATA_KEY)
135 ret = check_extent_in_eb(ctx, &key, eb, fi, eie);
353 * - if you add a key, you must know that it is a correct key
354 * - if you cannot add the parent or a correct key, then we will look into the
355 * block later to set a correct key
363 * key to resolve | - | y | y | y
368 * - column 2, 3, 4: we use the key to find the parent
376 * key to resolve | - | - | - | y
381 * - column 2: we take the first key from the block to find the parent
383 * - column 4: we use the key to find the parent
390 const struct btrfs_key *key, int level, u64 parent,
404 if (key)
405 ref->key_for_search = *key;
418 /* direct refs use root == 0, key == NULL */
431 const struct btrfs_key *key, int level,
437 if (!key)
439 return add_prelim_ref(fs_info, tree, root_id, key, level, 0,
477 struct btrfs_key key;
519 btrfs_item_key_to_cpu(eb, &key, slot);
521 if (key.objectid != key_for_search->objectid ||
522 key.type != BTRFS_EXTENT_DATA_KEY)
549 if (ref->key_for_search.offset == key.offset - data_offset)
554 ret = check_extent_in_eb(ctx, &key, eb, fi, &eie);
588 * resolve an indirect backref in the form (root_id, key, level)
648 * So if we detect such case we set the search key's offset to zero to
670 "search slot in root %llu (level %d, ref count %d) returned %d for key (%llu %u %llu)",
718 * indirect refs which have a key, and one for indirect refs which do not
719 * have a key. Each tree does merge on insertion.
722 * indirect refs with missing keys. An appropriate key is located and
893 struct btrfs_key key;
926 btrfs_disk_key_to_cpu(&key, &head->extent_op->key);
927 key_ptr = &key;
953 key.objectid = ref->objectid;
954 key.type = BTRFS_EXTENT_DATA_KEY;
955 key.offset = ref->offset;
976 &key, 0, node->bytenr, count, sc,
1021 struct btrfs_key key;
1106 key.objectid = btrfs_extent_data_ref_objectid(leaf,
1108 key.type = BTRFS_EXTENT_DATA_KEY;
1109 key.offset = btrfs_extent_data_ref_offset(leaf, dref);
1111 if (sc && key.objectid != sc->inum &&
1120 !ctx->skip_data_ref(root, key.objectid, key.offset,
1123 root, &key, 0, ctx->bytenr,
1156 struct btrfs_key key;
1169 btrfs_item_key_to_cpu(leaf, &key, slot);
1171 if (key.objectid != ctx->bytenr)
1173 if (key.type < BTRFS_TREE_BLOCK_REF_KEY)
1175 if (key.type > BTRFS_SHARED_DATA_REF_KEY)
1178 switch (key.type) {
1182 info_level + 1, key.offset,
1194 key.offset, ctx->bytenr, count,
1200 ret = add_indirect_ref(fs_info, preftrees, key.offset,
1213 key.objectid = btrfs_extent_data_ref_objectid(leaf,
1215 key.type = BTRFS_EXTENT_DATA_KEY;
1216 key.offset = btrfs_extent_data_ref_offset(leaf, dref);
1218 if (sc && key.objectid != sc->inum &&
1227 !ctx->skip_data_ref(root, key.objectid, key.offset,
1230 &key, 0, ctx->bytenr,
1389 struct btrfs_key key;
1408 key.objectid = ctx->bytenr;
1409 key.offset = (u64)-1;
1411 key.type = BTRFS_METADATA_ITEM_KEY;
1413 key.type = BTRFS_EXTENT_ITEM_KEY;
1429 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
1486 btrfs_item_key_to_cpu(leaf, &key, slot);
1487 if (key.objectid == ctx->bytenr &&
1488 (key.type == BTRFS_EXTENT_ITEM_KEY ||
1489 key.type == BTRFS_METADATA_ITEM_KEY)) {
2055 struct btrfs_key key;
2061 key.objectid = inode_objectid;
2062 key.type = BTRFS_INODE_EXTREF_KEY;
2063 key.offset = start_off;
2065 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
2094 * Check that we're still looking at an extended ref key for
2213 struct btrfs_key key;
2216 key.type = BTRFS_METADATA_ITEM_KEY;
2218 key.type = BTRFS_EXTENT_ITEM_KEY;
2219 key.objectid = logical;
2220 key.offset = (u64)-1;
2222 ret = btrfs_search_slot(NULL, extent_root, &key, path, 0, 0);
2287 const struct btrfs_key *key,
2301 if (key->type == BTRFS_METADATA_ITEM_KEY) {
2306 WARN_ON(key->type != BTRFS_EXTENT_ITEM_KEY);
2342 struct btrfs_key *key, struct btrfs_extent_item *ei,
2353 ret = get_extent_inline_ref(ptr, eb, key, ei, item_size,
2369 if (key->type == BTRFS_EXTENT_ITEM_KEY) {
2375 ASSERT(key->type == BTRFS_METADATA_ITEM_KEY);
2376 *out_level = (u8)key->offset;
2395 "ref for %llu resolved, key (%llu EXTEND_DATA %llu), root %llu",
2866 struct btrfs_key key;
2869 key.objectid = bytenr;
2870 key.type = BTRFS_METADATA_ITEM_KEY;
2871 key.offset = (u64)-1;
2874 ret = btrfs_search_slot(NULL, extent_root, &key, path, 0, 0);
2892 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
2893 if ((key.type != BTRFS_EXTENT_ITEM_KEY &&
2894 key.type != BTRFS_METADATA_ITEM_KEY) || key.objectid != bytenr) {
2898 memcpy(&iter->cur_key, &key, sizeof(key));
3220 * @ref_key: The converted backref key.
3221 * For keyed backref, it's the item key.
3295 * @tree_key: The first key of this tree block.
3333 * completely relying on direct backref (key->offset is parent
3363 "couldn't find block (%llu) (level %d) in tree (%llu) with key (%llu %u %llu)",
3465 * @node_key: The first key of the tree block
3482 * We skip the first btrfs_tree_block_info, as we don't use the key
3518 struct btrfs_key key;
3524 key.objectid = iter->bytenr;
3528 /* Update key for inline backref */
3537 key.type = type;
3538 key.offset = btrfs_extent_inline_ref_offset(eb, iref);
3540 key.type = iter->cur_key.type;
3541 key.offset = iter->cur_key.offset;
3549 ((key.type == BTRFS_TREE_BLOCK_REF_KEY &&
3550 exist->owner == key.offset) ||
3551 (key.type == BTRFS_SHARED_BLOCK_REF_KEY &&
3552 exist->bytenr == key.offset))) {
3557 /* SHARED_BLOCK_REF means key.offset is the parent bytenr */
3558 if (key.type == BTRFS_SHARED_BLOCK_REF_KEY) {
3559 ret = handle_direct_tree_backref(cache, &key, cur);
3562 } else if (key.type == BTRFS_TREE_BLOCK_REF_KEY) {
3564 * key.type == BTRFS_TREE_BLOCK_REF_KEY, inline ref
3569 &key, node_key, cur);