Lines Matching refs:root

67 int btrfs_find_root(struct btrfs_root *root, const struct btrfs_key *search_key,  in btrfs_find_root()  argument
76 ret = btrfs_search_slot(NULL, root, search_key, path, 0, 0); in btrfs_find_root()
122 *root, struct btrfs_key *key, struct btrfs_root_item in btrfs_update_root()
125 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_update_root()
137 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root()
145 root->root_key.objectid); in btrfs_update_root()
163 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root()
170 ret = btrfs_del_item(trans, root, path); in btrfs_update_root()
176 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_update_root()
200 int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, in btrfs_insert_root() argument
207 return btrfs_insert_item(trans, root, key, item, sizeof(*item)); in btrfs_insert_root()
216 struct btrfs_root *root; in btrfs_find_orphan_roots() local
257 root = btrfs_get_fs_root(fs_info, root_objectid, false); in btrfs_find_orphan_roots()
258 err = PTR_ERR_OR_ZERO(root); in btrfs_find_orphan_roots()
284 WARN_ON(!test_bit(BTRFS_ROOT_ORPHAN_ITEM_INSERTED, &root->state)); in btrfs_find_orphan_roots()
285 if (btrfs_root_refs(&root->root_item) == 0) { in btrfs_find_orphan_roots()
288 btrfs_disk_key_to_cpu(&drop_key, &root->root_item.drop_progress); in btrfs_find_orphan_roots()
298 set_bit(BTRFS_ROOT_UNFINISHED_DROP, &root->state); in btrfs_find_orphan_roots()
301 set_bit(BTRFS_ROOT_DEAD_TREE, &root->state); in btrfs_find_orphan_roots()
302 btrfs_add_dead_root(root); in btrfs_find_orphan_roots()
304 btrfs_put_root(root); in btrfs_find_orphan_roots()
315 struct btrfs_root *root = trans->fs_info->tree_root; in btrfs_del_root() local
322 ret = btrfs_search_slot(trans, root, key, path, -1, 1); in btrfs_del_root()
328 ret = btrfs_del_item(trans, root, path); in btrfs_del_root()
474 struct btrfs_root *root) in btrfs_update_root_times() argument
476 struct btrfs_root_item *item = &root->root_item; in btrfs_update_root_times()
480 spin_lock(&root->root_item_lock); in btrfs_update_root_times()
484 spin_unlock(&root->root_item_lock); in btrfs_update_root_times()
501 int btrfs_subvolume_reserve_metadata(struct btrfs_root *root, in btrfs_subvolume_reserve_metadata() argument
508 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_subvolume_reserve_metadata()
514 ret = btrfs_qgroup_reserve_meta_prealloc(root, in btrfs_subvolume_reserve_metadata()
531 btrfs_qgroup_free_meta_prealloc(root, qgroup_num_bytes); in btrfs_subvolume_reserve_metadata()
541 void btrfs_subvolume_release_metadata(struct btrfs_root *root, in btrfs_subvolume_release_metadata() argument
544 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_subvolume_release_metadata()
548 btrfs_qgroup_convert_reserved_meta(root, qgroup_to_release); in btrfs_subvolume_release_metadata()