• Home
  • Raw
  • Download

Lines Matching refs:reloc_root

544 	if (!root->reloc_root)  in have_reloc_root()
551 struct btrfs_root *reloc_root; in should_ignore_root() local
560 reloc_root = root->reloc_root; in should_ignore_root()
561 if (!reloc_root) in should_ignore_root()
564 if (btrfs_header_generation(reloc_root->commit_root) == in should_ignore_root()
1206 struct btrfs_root *reloc_root = src->reloc_root; in clone_backref_node() local
1223 BUG_ON(node->new_bytenr != reloc_root->node->start); in clone_backref_node()
1228 reloc_root->commit_root->start); in clone_backref_node()
1386 struct btrfs_root *reloc_root; in create_reloc_root() local
1449 reloc_root = btrfs_read_fs_root(fs_info->tree_root, &root_key); in create_reloc_root()
1450 BUG_ON(IS_ERR(reloc_root)); in create_reloc_root()
1451 reloc_root->last_trans = trans->transid; in create_reloc_root()
1452 return reloc_root; in create_reloc_root()
1463 struct btrfs_root *reloc_root; in btrfs_init_reloc_root() local
1487 if (root->reloc_root) { in btrfs_init_reloc_root()
1488 reloc_root = root->reloc_root; in btrfs_init_reloc_root()
1489 reloc_root->last_trans = trans->transid; in btrfs_init_reloc_root()
1506 reloc_root = create_reloc_root(trans, root, root->root_key.objectid); in btrfs_init_reloc_root()
1510 ret = __add_reloc_root(reloc_root); in btrfs_init_reloc_root()
1512 root->reloc_root = reloc_root; in btrfs_init_reloc_root()
1523 struct btrfs_root *reloc_root; in btrfs_update_reloc_root() local
1530 reloc_root = root->reloc_root; in btrfs_update_reloc_root()
1531 root_item = &reloc_root->root_item; in btrfs_update_reloc_root()
1542 __del_reloc_root(reloc_root); in btrfs_update_reloc_root()
1545 if (reloc_root->commit_root != reloc_root->node) { in btrfs_update_reloc_root()
1546 __update_reloc_root(reloc_root); in btrfs_update_reloc_root()
1547 btrfs_set_root_node(root_item, reloc_root->node); in btrfs_update_reloc_root()
1548 free_extent_buffer(reloc_root->commit_root); in btrfs_update_reloc_root()
1549 reloc_root->commit_root = btrfs_root_node(reloc_root); in btrfs_update_reloc_root()
1553 &reloc_root->root_key, root_item); in btrfs_update_reloc_root()
2215 struct btrfs_root *reloc_root = root->reloc_root; in insert_dirty_subvol() local
2220 ASSERT(reloc_root); in insert_dirty_subvol()
2222 reloc_root_item = &reloc_root->root_item; in insert_dirty_subvol()
2246 struct btrfs_root *reloc_root = root->reloc_root; in clean_dirty_subvols() local
2249 root->reloc_root = NULL; in clean_dirty_subvols()
2250 if (reloc_root) { in clean_dirty_subvols()
2252 ret2 = btrfs_drop_snapshot(reloc_root, NULL, 0, 1); in clean_dirty_subvols()
2284 struct btrfs_root *reloc_root; in merge_reloc_root() local
2301 reloc_root = root->reloc_root; in merge_reloc_root()
2302 root_item = &reloc_root->root_item; in merge_reloc_root()
2306 extent_buffer_get(reloc_root->node); in merge_reloc_root()
2307 path->nodes[level] = reloc_root->node; in merge_reloc_root()
2315 ret = btrfs_search_slot(NULL, reloc_root, &key, path, 0, 0); in merge_reloc_root()
2365 reloc_root->last_trans = trans->transid; in merge_reloc_root()
2371 ret = walk_down_reloc_tree(reloc_root, path, &level); in merge_reloc_root()
2383 ret = replace_path(trans, rc, root, reloc_root, path, in merge_reloc_root()
2398 ret = walk_up_reloc_tree(reloc_root, path, &level); in merge_reloc_root()
2452 struct btrfs_root *reloc_root; in prepare_to_merge() local
2492 reloc_root = list_entry(rc->reloc_roots.next, in prepare_to_merge()
2494 list_del_init(&reloc_root->root_list); in prepare_to_merge()
2496 root = read_fs_root(fs_info, reloc_root->root_key.offset); in prepare_to_merge()
2498 BUG_ON(root->reloc_root != reloc_root); in prepare_to_merge()
2505 btrfs_set_root_refs(&reloc_root->root_item, 1); in prepare_to_merge()
2508 list_add(&reloc_root->root_list, &reloc_roots); in prepare_to_merge()
2523 struct btrfs_root *reloc_root; in free_reloc_roots() local
2526 reloc_root = list_entry(list->next, struct btrfs_root, in free_reloc_roots()
2528 __del_reloc_root(reloc_root); in free_reloc_roots()
2529 free_extent_buffer(reloc_root->node); in free_reloc_roots()
2530 free_extent_buffer(reloc_root->commit_root); in free_reloc_roots()
2531 reloc_root->node = NULL; in free_reloc_roots()
2532 reloc_root->commit_root = NULL; in free_reloc_roots()
2541 struct btrfs_root *reloc_root; in merge_reloc_roots() local
2560 reloc_root = list_entry(reloc_roots.next, in merge_reloc_roots()
2563 root = read_fs_root(fs_info, reloc_root->root_key.offset); in merge_reloc_roots()
2564 if (btrfs_root_refs(&reloc_root->root_item) > 0) { in merge_reloc_roots()
2566 BUG_ON(root->reloc_root != reloc_root); in merge_reloc_roots()
2569 if (list_empty(&reloc_root->root_list)) in merge_reloc_roots()
2570 list_add_tail(&reloc_root->root_list, in merge_reloc_roots()
2576 if (root->reloc_root == reloc_root) in merge_reloc_roots()
2577 root->reloc_root = NULL; in merge_reloc_roots()
2582 list_del_init(&reloc_root->root_list); in merge_reloc_roots()
2584 list_add_tail(&reloc_root->reloc_dirty_list, in merge_reloc_roots()
2636 struct btrfs_root *reloc_root) in record_reloc_root_in_trans() argument
2638 struct btrfs_fs_info *fs_info = reloc_root->fs_info; in record_reloc_root_in_trans()
2641 if (reloc_root->last_trans == trans->transid) in record_reloc_root_in_trans()
2644 root = read_fs_root(fs_info, reloc_root->root_key.offset); in record_reloc_root_in_trans()
2646 BUG_ON(root->reloc_root != reloc_root); in record_reloc_root_in_trans()
2675 root = root->reloc_root; in select_reloc_root()
3151 root = root->reloc_root; in relocate_tree_block()
4561 struct btrfs_root *reloc_root; in btrfs_recover_relocation() local
4598 reloc_root = btrfs_read_fs_root(root, &key); in btrfs_recover_relocation()
4599 if (IS_ERR(reloc_root)) { in btrfs_recover_relocation()
4600 err = PTR_ERR(reloc_root); in btrfs_recover_relocation()
4604 list_add(&reloc_root->root_list, &reloc_roots); in btrfs_recover_relocation()
4606 if (btrfs_root_refs(&reloc_root->root_item) > 0) { in btrfs_recover_relocation()
4608 reloc_root->root_key.offset); in btrfs_recover_relocation()
4615 ret = mark_garbage_root(reloc_root); in btrfs_recover_relocation()
4652 reloc_root = list_entry(reloc_roots.next, in btrfs_recover_relocation()
4654 list_del(&reloc_root->root_list); in btrfs_recover_relocation()
4656 if (btrfs_root_refs(&reloc_root->root_item) == 0) { in btrfs_recover_relocation()
4657 list_add_tail(&reloc_root->root_list, in btrfs_recover_relocation()
4662 fs_root = read_fs_root(fs_info, reloc_root->root_key.offset); in btrfs_recover_relocation()
4665 list_add_tail(&reloc_root->root_list, &reloc_roots); in btrfs_recover_relocation()
4670 err = __add_reloc_root(reloc_root); in btrfs_recover_relocation()
4672 fs_root->reloc_root = reloc_root; in btrfs_recover_relocation()
4834 root = root->reloc_root; in btrfs_reloc_pre_snapshot()
4857 struct btrfs_root *reloc_root; in btrfs_reloc_post_snapshot() local
4877 reloc_root = create_reloc_root(trans, root->reloc_root, in btrfs_reloc_post_snapshot()
4879 if (IS_ERR(reloc_root)) in btrfs_reloc_post_snapshot()
4880 return PTR_ERR(reloc_root); in btrfs_reloc_post_snapshot()
4882 ret = __add_reloc_root(reloc_root); in btrfs_reloc_post_snapshot()
4884 new_root->reloc_root = reloc_root; in btrfs_reloc_post_snapshot()
4887 ret = clone_backref_node(trans, rc, root, reloc_root); in btrfs_reloc_post_snapshot()