• Home
  • Raw
  • Download

Lines Matching full:root

14  * Read a root item from the tree. In case we detect a root item smaller then
15 * sizeof(root_item), we know it's an old version of the root structure and
17 * generation numbers as then we know the root was once mounted with an older
18 * kernel that was not aware of the root item structure change.
36 …"mismatching generation and generation_v2 found in root item. This root was probably mounted with … in btrfs_read_root_item()
51 * btrfs_find_root - lookup the root by the key.
52 * root: the root of the root tree
55 * root_item: the root item of the tree we look for
56 * root_key: the root key of the tree we look for
59 * of the search key, just lookup the root with the highest offset for a
64 int btrfs_find_root(struct btrfs_root *root, const struct btrfs_key *search_key, in btrfs_find_root() argument
73 ret = btrfs_search_slot(NULL, root, search_key, path, 0, 0); in btrfs_find_root()
119 *root, struct btrfs_key *key, struct btrfs_root_item in btrfs_update_root()
122 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_update_root()
134 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root()
140 "unable to find root key (%llu %u %llu) in tree %llu", in btrfs_update_root()
142 root->root_key.objectid); in btrfs_update_root()
154 * If this is the first time we update the root item which originated in btrfs_update_root()
160 ret = btrfs_search_slot(trans, root, key, path, in btrfs_update_root()
167 ret = btrfs_del_item(trans, root, path); in btrfs_update_root()
173 ret = btrfs_insert_empty_item(trans, root, path, in btrfs_update_root()
185 * Update generation_v2 so at the next mount we know the new root in btrfs_update_root()
197 int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, in btrfs_insert_root() argument
204 return btrfs_insert_item(trans, root, key, item, sizeof(*item)); in btrfs_insert_root()
214 struct btrfs_root *root; in btrfs_find_orphan_roots() local
257 * The root might have been inserted already, as before we look in btrfs_find_orphan_roots()
263 root = btrfs_lookup_fs_root(fs_info, root_key.objectid); in btrfs_find_orphan_roots()
264 if (root) { in btrfs_find_orphan_roots()
266 &root->state)); in btrfs_find_orphan_roots()
267 if (btrfs_root_refs(&root->root_item) == 0) in btrfs_find_orphan_roots()
268 btrfs_add_dead_root(root); in btrfs_find_orphan_roots()
272 root = btrfs_read_fs_root(tree_root, &root_key); in btrfs_find_orphan_roots()
273 err = PTR_ERR_OR_ZERO(root); in btrfs_find_orphan_roots()
293 "Failed to delete root orphan item"); in btrfs_find_orphan_roots()
299 err = btrfs_init_fs_root(root); in btrfs_find_orphan_roots()
301 btrfs_free_fs_root(root); in btrfs_find_orphan_roots()
305 set_bit(BTRFS_ROOT_ORPHAN_ITEM_INSERTED, &root->state); in btrfs_find_orphan_roots()
307 err = btrfs_insert_fs_root(fs_info, root); in btrfs_find_orphan_roots()
310 btrfs_free_fs_root(root); in btrfs_find_orphan_roots()
314 if (btrfs_root_refs(&root->root_item) == 0) in btrfs_find_orphan_roots()
315 btrfs_add_dead_root(root); in btrfs_find_orphan_roots()
322 /* drop the root item for 'key' from the tree root */
326 struct btrfs_root *root = trans->fs_info->tree_root; in btrfs_del_root() local
333 ret = btrfs_search_slot(trans, root, key, path, -1, 1); in btrfs_del_root()
339 ret = btrfs_del_item(trans, root, path); in btrfs_del_root()
408 * that is referencing the root.
411 * the root and ref_id is the id of the subvol or snapshot.
486 struct btrfs_root *root) in btrfs_update_root_times() argument
488 struct btrfs_root_item *item = &root->root_item; in btrfs_update_root_times()
492 spin_lock(&root->root_item_lock); in btrfs_update_root_times()
496 spin_unlock(&root->root_item_lock); in btrfs_update_root_times()