Lines Matching refs:key

137 		      *root, struct btrfs_key *key, struct btrfs_root_item  in btrfs_update_root()  argument
151 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root()
160 key->objectid, key->type, key->offset); in btrfs_update_root()
176 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root()
190 key, sizeof(*item)); in btrfs_update_root()
214 struct btrfs_key *key, struct btrfs_root_item *item) in btrfs_insert_root() argument
220 return btrfs_insert_item(trans, root, key, item, sizeof(*item)); in btrfs_insert_root()
227 struct btrfs_key key; in btrfs_find_orphan_roots() local
241 key.objectid = BTRFS_ORPHAN_OBJECTID; in btrfs_find_orphan_roots()
242 key.type = BTRFS_ORPHAN_ITEM_KEY; in btrfs_find_orphan_roots()
243 key.offset = 0; in btrfs_find_orphan_roots()
249 ret = btrfs_search_slot(NULL, tree_root, &key, path, 0, 0); in btrfs_find_orphan_roots()
265 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_find_orphan_roots()
268 if (key.objectid != BTRFS_ORPHAN_OBJECTID || in btrfs_find_orphan_roots()
269 key.type != BTRFS_ORPHAN_ITEM_KEY) in btrfs_find_orphan_roots()
272 root_key.objectid = key.offset; in btrfs_find_orphan_roots()
273 key.offset++; in btrfs_find_orphan_roots()
337 struct btrfs_key *key) in btrfs_del_root() argument
345 ret = btrfs_search_slot(trans, root, key, path, -1, 1); in btrfs_del_root()
366 struct btrfs_key key; in btrfs_del_root_ref() local
375 key.objectid = root_id; in btrfs_del_root_ref()
376 key.type = BTRFS_ROOT_BACKREF_KEY; in btrfs_del_root_ref()
377 key.offset = ref_id; in btrfs_del_root_ref()
379 ret = btrfs_search_slot(trans, tree_root, &key, path, -1, 1); in btrfs_del_root_ref()
400 if (key.type == BTRFS_ROOT_BACKREF_KEY) { in btrfs_del_root_ref()
402 key.objectid = ref_id; in btrfs_del_root_ref()
403 key.type = BTRFS_ROOT_REF_KEY; in btrfs_del_root_ref()
404 key.offset = root_id; in btrfs_del_root_ref()
433 struct btrfs_key key; in btrfs_add_root_ref() local
444 key.objectid = root_id; in btrfs_add_root_ref()
445 key.type = BTRFS_ROOT_BACKREF_KEY; in btrfs_add_root_ref()
446 key.offset = ref_id; in btrfs_add_root_ref()
448 ret = btrfs_insert_empty_item(trans, tree_root, path, &key, in btrfs_add_root_ref()
465 if (key.type == BTRFS_ROOT_BACKREF_KEY) { in btrfs_add_root_ref()
467 key.objectid = ref_id; in btrfs_add_root_ref()
468 key.type = BTRFS_ROOT_REF_KEY; in btrfs_add_root_ref()
469 key.offset = root_id; in btrfs_add_root_ref()