Lines Matching refs:em_tree

13 static void free_extent_map_tree(struct extent_map_tree *em_tree)  in free_extent_map_tree()  argument
18 write_lock(&em_tree->lock); in free_extent_map_tree()
19 while (!RB_EMPTY_ROOT(&em_tree->map.rb_root)) { in free_extent_map_tree()
20 node = rb_first_cached(&em_tree->map); in free_extent_map_tree()
22 remove_extent_mapping(em_tree, em); in free_extent_map_tree()
36 write_unlock(&em_tree->lock); in free_extent_map_tree()
56 struct extent_map_tree *em_tree) in test_case_1() argument
74 write_lock(&em_tree->lock); in test_case_1()
75 ret = add_extent_mapping(em_tree, em, 0); in test_case_1()
76 write_unlock(&em_tree->lock); in test_case_1()
95 write_lock(&em_tree->lock); in test_case_1()
96 ret = add_extent_mapping(em_tree, em, 0); in test_case_1()
97 write_unlock(&em_tree->lock); in test_case_1()
116 write_lock(&em_tree->lock); in test_case_1()
117 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, em->start, em->len); in test_case_1()
118 write_unlock(&em_tree->lock); in test_case_1()
134 free_extent_map_tree(em_tree); in test_case_1()
146 struct extent_map_tree *em_tree) in test_case_2() argument
162 write_lock(&em_tree->lock); in test_case_2()
163 ret = add_extent_mapping(em_tree, em, 0); in test_case_2()
164 write_unlock(&em_tree->lock); in test_case_2()
183 write_lock(&em_tree->lock); in test_case_2()
184 ret = add_extent_mapping(em_tree, em, 0); in test_case_2()
185 write_unlock(&em_tree->lock); in test_case_2()
204 write_lock(&em_tree->lock); in test_case_2()
205 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, em->start, em->len); in test_case_2()
206 write_unlock(&em_tree->lock); in test_case_2()
222 free_extent_map_tree(em_tree); in test_case_2()
228 struct extent_map_tree *em_tree, u64 start) in __test_case_3() argument
245 write_lock(&em_tree->lock); in __test_case_3()
246 ret = add_extent_mapping(em_tree, em, 0); in __test_case_3()
247 write_unlock(&em_tree->lock); in __test_case_3()
266 write_lock(&em_tree->lock); in __test_case_3()
267 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len); in __test_case_3()
268 write_unlock(&em_tree->lock); in __test_case_3()
289 free_extent_map_tree(em_tree); in __test_case_3()
311 struct extent_map_tree *em_tree) in test_case_3() argument
315 ret = __test_case_3(fs_info, em_tree, 0); in test_case_3()
318 ret = __test_case_3(fs_info, em_tree, SZ_8K); in test_case_3()
321 ret = __test_case_3(fs_info, em_tree, (12 * SZ_1K)); in test_case_3()
327 struct extent_map_tree *em_tree, u64 start) in __test_case_4() argument
344 write_lock(&em_tree->lock); in __test_case_4()
345 ret = add_extent_mapping(em_tree, em, 0); in __test_case_4()
346 write_unlock(&em_tree->lock); in __test_case_4()
365 write_lock(&em_tree->lock); in __test_case_4()
366 ret = add_extent_mapping(em_tree, em, 0); in __test_case_4()
367 write_unlock(&em_tree->lock); in __test_case_4()
385 write_lock(&em_tree->lock); in __test_case_4()
386 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len); in __test_case_4()
387 write_unlock(&em_tree->lock); in __test_case_4()
402 free_extent_map_tree(em_tree); in __test_case_4()
433 struct extent_map_tree *em_tree) in test_case_4() argument
437 ret = __test_case_4(fs_info, em_tree, 0); in test_case_4()
440 ret = __test_case_4(fs_info, em_tree, SZ_4K); in test_case_4()
556 struct extent_map_tree *em_tree; in btrfs_test_extent_map() local
605 em_tree = kzalloc(sizeof(*em_tree), GFP_KERNEL); in btrfs_test_extent_map()
606 if (!em_tree) { in btrfs_test_extent_map()
611 extent_map_tree_init(em_tree); in btrfs_test_extent_map()
613 ret = test_case_1(fs_info, em_tree); in btrfs_test_extent_map()
616 ret = test_case_2(fs_info, em_tree); in btrfs_test_extent_map()
619 ret = test_case_3(fs_info, em_tree); in btrfs_test_extent_map()
622 ret = test_case_4(fs_info, em_tree); in btrfs_test_extent_map()
632 kfree(em_tree); in btrfs_test_extent_map()