Lines Matching refs:root
428 struct btrfs_root *root = NULL;
441 root = btrfs_alloc_dummy_root(fs_info);
442 if (IS_ERR(root)) {
444 ret = PTR_ERR(root);
448 btrfs_set_super_compat_ro_flags(root->fs_info->super_copy,
450 root->root_key.objectid = BTRFS_FREE_SPACE_TREE_OBJECTID;
451 root->root_key.type = BTRFS_ROOT_ITEM_KEY;
452 root->root_key.offset = 0;
453 btrfs_global_root_insert(root);
454 root->fs_info->tree_root = root;
456 root->node = alloc_test_extent_buffer(root->fs_info, nodesize);
457 if (IS_ERR(root->node)) {
459 ret = PTR_ERR(root->node);
462 btrfs_set_header_level(root->node, 0);
463 btrfs_set_header_nritems(root->node, 0);
464 root->alloc_bytenr += 2 * nodesize;
475 cache->fs_info = root->fs_info;
477 btrfs_init_dummy_trans(&trans, root->fs_info);
500 ret = test_func(&trans, root->fs_info, cache, path, alignment);
510 if (btrfs_header_nritems(root->node) != 0) {
520 btrfs_free_dummy_root(root);