• Home
  • Raw
  • Download

Lines Matching refs:root

14 static int insert_normal_tree_ref(struct btrfs_root *root, u64 bytenr,  in insert_normal_tree_ref()  argument
40 ret = btrfs_insert_empty_item(&trans, root, path, &ins, size); in insert_normal_tree_ref()
67 static int add_tree_ref(struct btrfs_root *root, u64 bytenr, u64 num_bytes, in add_tree_ref() argument
90 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in add_tree_ref()
112 ret = btrfs_insert_empty_item(&trans, root, path, &key, 0); in add_tree_ref()
119 static int remove_extent_item(struct btrfs_root *root, u64 bytenr, in remove_extent_item() argument
140 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_item()
146 btrfs_del_item(&trans, root, path); in remove_extent_item()
151 static int remove_extent_ref(struct btrfs_root *root, u64 bytenr, in remove_extent_ref() argument
174 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in remove_extent_ref()
196 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_ref()
202 btrfs_del_item(&trans, root, path); in remove_extent_ref()
207 static int test_no_shared_qgroup(struct btrfs_root *root, in test_no_shared_qgroup() argument
211 struct btrfs_fs_info *fs_info = root->fs_info; in test_no_shared_qgroup()
237 ret = insert_normal_tree_ref(root, nodesize, nodesize, 0, in test_no_shared_qgroup()
276 ret = remove_extent_item(root, nodesize, nodesize); in test_no_shared_qgroup()
310 static int test_multiple_refs(struct btrfs_root *root, in test_multiple_refs() argument
314 struct btrfs_fs_info *fs_info = root->fs_info; in test_multiple_refs()
340 ret = insert_normal_tree_ref(root, nodesize, nodesize, 0, in test_multiple_refs()
375 ret = add_tree_ref(root, nodesize, nodesize, 0, in test_multiple_refs()
416 ret = remove_extent_ref(root, nodesize, nodesize, 0, in test_multiple_refs()
456 struct btrfs_root *root; in btrfs_test_qgroups() local
466 root = btrfs_alloc_dummy_root(fs_info); in btrfs_test_qgroups()
467 if (IS_ERR(root)) { in btrfs_test_qgroups()
469 ret = PTR_ERR(root); in btrfs_test_qgroups()
474 root->fs_info->extent_root = root; in btrfs_test_qgroups()
480 root->fs_info->tree_root = root; in btrfs_test_qgroups()
481 root->fs_info->quota_root = root; in btrfs_test_qgroups()
488 root->node = alloc_test_extent_buffer(root->fs_info, nodesize); in btrfs_test_qgroups()
489 if (IS_ERR(root->node)) { in btrfs_test_qgroups()
491 ret = PTR_ERR(root->node); in btrfs_test_qgroups()
494 btrfs_set_header_level(root->node, 0); in btrfs_test_qgroups()
495 btrfs_set_header_nritems(root->node, 0); in btrfs_test_qgroups()
496 root->alloc_bytenr += 2 * nodesize; in btrfs_test_qgroups()
506 root->fs_info->fs_root = tmp_root; in btrfs_test_qgroups()
507 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); in btrfs_test_qgroups()
522 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); in btrfs_test_qgroups()
530 ret = test_no_shared_qgroup(root, sectorsize, nodesize); in btrfs_test_qgroups()
533 ret = test_multiple_refs(root, sectorsize, nodesize); in btrfs_test_qgroups()
535 btrfs_free_dummy_root(root); in btrfs_test_qgroups()