Lines Matching defs:key

54  * btrfs_find_root - lookup the root by the key.
56 * search_key: the key to search
59 * root_key: the root key of the tree we look for
62 * of the search key, just lookup the root with the highest offset for a
80 if (search_key->offset != -1ULL) { /* the search key is exact */
122 *root, struct btrfs_key *key, struct btrfs_root_item
137 ret = btrfs_search_slot(trans, root, key, path, 0, 1);
143 "unable to find root key (%llu %u %llu) in tree %llu",
144 key->objectid, key->type, key->offset,
163 ret = btrfs_search_slot(trans, root, key, path,
177 key, sizeof(*item));
201 const struct btrfs_key *key, struct btrfs_root_item *item)
207 return btrfs_insert_item(trans, root, key, item, sizeof(*item));
215 struct btrfs_key key;
224 key.objectid = BTRFS_ORPHAN_OBJECTID;
225 key.type = BTRFS_ORPHAN_ITEM_KEY;
226 key.offset = 0;
231 ret = btrfs_search_slot(NULL, tree_root, &key, path, 0, 0);
247 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
250 if (key.objectid != BTRFS_ORPHAN_OBJECTID ||
251 key.type != BTRFS_ORPHAN_ITEM_KEY)
254 root_objectid = key.offset;
255 key.offset++;
311 /* drop the root item for 'key' from the tree root */
313 const struct btrfs_key *key)
322 ret = btrfs_search_slot(trans, root, key, path, -1, 1);
342 struct btrfs_key key;
350 key.objectid = root_id;
351 key.type = BTRFS_ROOT_BACKREF_KEY;
352 key.offset = ref_id;
354 ret = btrfs_search_slot(trans, tree_root, &key, path, -1, 1);
378 if (key.type == BTRFS_ROOT_BACKREF_KEY) {
380 key.objectid = ref_id;
381 key.type = BTRFS_ROOT_REF_KEY;
382 key.offset = root_id;
411 struct btrfs_key key;
422 key.objectid = root_id;
423 key.type = BTRFS_ROOT_BACKREF_KEY;
424 key.offset = ref_id;
426 ret = btrfs_insert_empty_item(trans, tree_root, path, &key,
443 if (key.type == BTRFS_ROOT_BACKREF_KEY) {
445 key.objectid = ref_id;
446 key.type = BTRFS_ROOT_REF_KEY;
447 key.offset = root_id;