Lines Matching refs:key
129 *root, struct btrfs_key *key, struct btrfs_root_item in btrfs_update_root() argument
144 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root()
151 key->objectid, key->type, key->offset, btrfs_root_id(root)); in btrfs_update_root()
169 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root()
183 key, sizeof(*item)); in btrfs_update_root()
206 const struct btrfs_key *key, struct btrfs_root_item *item) in btrfs_insert_root() argument
212 return btrfs_insert_item(trans, root, key, item, sizeof(*item)); in btrfs_insert_root()
220 struct btrfs_key key; in btrfs_find_orphan_roots() local
229 key.objectid = BTRFS_ORPHAN_OBJECTID; in btrfs_find_orphan_roots()
230 key.type = BTRFS_ORPHAN_ITEM_KEY; in btrfs_find_orphan_roots()
231 key.offset = 0; in btrfs_find_orphan_roots()
236 ret = btrfs_search_slot(NULL, tree_root, &key, path, 0, 0); in btrfs_find_orphan_roots()
252 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_find_orphan_roots()
255 if (key.objectid != BTRFS_ORPHAN_OBJECTID || in btrfs_find_orphan_roots()
256 key.type != BTRFS_ORPHAN_ITEM_KEY) in btrfs_find_orphan_roots()
259 root_objectid = key.offset; in btrfs_find_orphan_roots()
260 key.offset++; in btrfs_find_orphan_roots()
318 const struct btrfs_key *key) in btrfs_del_root() argument
327 ret = btrfs_search_slot(trans, root, key, path, -1, 1); in btrfs_del_root()
350 struct btrfs_key key; in btrfs_del_root_ref() local
358 key.objectid = root_id; in btrfs_del_root_ref()
359 key.type = BTRFS_ROOT_BACKREF_KEY; in btrfs_del_root_ref()
360 key.offset = ref_id; in btrfs_del_root_ref()
362 ret = btrfs_search_slot(trans, tree_root, &key, path, -1, 1); in btrfs_del_root_ref()
386 if (key.type == BTRFS_ROOT_BACKREF_KEY) { in btrfs_del_root_ref()
388 key.objectid = ref_id; in btrfs_del_root_ref()
389 key.type = BTRFS_ROOT_REF_KEY; in btrfs_del_root_ref()
390 key.offset = root_id; in btrfs_del_root_ref()
419 struct btrfs_key key; in btrfs_add_root_ref() local
430 key.objectid = root_id; in btrfs_add_root_ref()
431 key.type = BTRFS_ROOT_BACKREF_KEY; in btrfs_add_root_ref()
432 key.offset = ref_id; in btrfs_add_root_ref()
434 ret = btrfs_insert_empty_item(trans, tree_root, path, &key, in btrfs_add_root_ref()
450 if (key.type == BTRFS_ROOT_BACKREF_KEY) { in btrfs_add_root_ref()
452 key.objectid = ref_id; in btrfs_add_root_ref()
453 key.type = BTRFS_ROOT_REF_KEY; in btrfs_add_root_ref()
454 key.offset = root_id; in btrfs_add_root_ref()