1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2017 Oracle. All rights reserved.
6 #include <linux/types.h>
7 #include "btrfs-tests.h"
9 #include "../btrfs_inode.h"
10 #include "../volumes.h"
11 #include "../disk-io.h"
12 #include "../block-group.h"
14 static void free_extent_map_tree(struct extent_map_tree *em_tree)
16 struct extent_map *em;
19 write_lock(&em_tree->lock);
20 while (!RB_EMPTY_ROOT(&em_tree->map.rb_root)) {
21 node = rb_first_cached(&em_tree->map);
22 em = rb_entry(node, struct extent_map, rb_node);
23 remove_extent_mapping(em_tree, em);
25 #ifdef CONFIG_BTRFS_DEBUG
26 if (refcount_read(&em->refs) != 1) {
28 "em leak: em (start 0x%llx len 0x%llx block_start 0x%llx block_len 0x%llx) refs %d",
29 em->start, em->len, em->block_start,
30 em->block_len, refcount_read(&em->refs));
32 refcount_set(&em->refs, 1);
37 write_unlock(&em_tree->lock);
43 * Suppose that no extent map has been loaded into memory yet, there is a file
44 * extent [0, 16K), followed by another file extent [16K, 20K), two dio reads
45 * are entering btrfs_get_extent() concurrently, t1 is reading [8K, 16K), t2 is
49 * btrfs_get_extent() btrfs_get_extent()
50 * -> lookup_extent_mapping() ->lookup_extent_mapping()
51 * -> add_extent_mapping(0, 16K)
53 * ->add_extent_mapping(0, 16K)
56 static int test_case_1(struct btrfs_fs_info *fs_info,
57 struct extent_map_tree *em_tree)
59 struct extent_map *em;
64 em = alloc_extent_map();
66 test_std_err(TEST_ALLOC_EXTENT_MAP);
74 em->block_len = SZ_16K;
75 write_lock(&em_tree->lock);
76 ret = add_extent_mapping(em_tree, em, 0);
77 write_unlock(&em_tree->lock);
79 test_err("cannot add extent range [0, 16K)");
84 /* Add [16K, 20K) following [0, 16K) */
85 em = alloc_extent_map();
87 test_std_err(TEST_ALLOC_EXTENT_MAP);
94 em->block_start = SZ_32K; /* avoid merging */
95 em->block_len = SZ_4K;
96 write_lock(&em_tree->lock);
97 ret = add_extent_mapping(em_tree, em, 0);
98 write_unlock(&em_tree->lock);
100 test_err("cannot add extent range [16K, 20K)");
105 em = alloc_extent_map();
107 test_std_err(TEST_ALLOC_EXTENT_MAP);
112 /* Add [0, 8K), should return [0, 16K) instead. */
115 em->block_start = start;
117 write_lock(&em_tree->lock);
118 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, em->start, em->len);
119 write_unlock(&em_tree->lock);
121 test_err("case1 [%llu %llu]: ret %d", start, start + len, ret);
125 (em->start != 0 || extent_map_end(em) != SZ_16K ||
126 em->block_start != 0 || em->block_len != SZ_16K)) {
128 "case1 [%llu %llu]: ret %d return a wrong em (start %llu len %llu block_start %llu block_len %llu",
129 start, start + len, ret, em->start, em->len,
130 em->block_start, em->block_len);
135 free_extent_map_tree(em_tree);
143 * Reading the inline ending up with EEXIST, ie. read an inline
144 * extent and discard page cache and read it again.
146 static int test_case_2(struct btrfs_fs_info *fs_info,
147 struct extent_map_tree *em_tree)
149 struct extent_map *em;
152 em = alloc_extent_map();
154 test_std_err(TEST_ALLOC_EXTENT_MAP);
161 em->block_start = EXTENT_MAP_INLINE;
162 em->block_len = (u64)-1;
163 write_lock(&em_tree->lock);
164 ret = add_extent_mapping(em_tree, em, 0);
165 write_unlock(&em_tree->lock);
167 test_err("cannot add extent range [0, 1K)");
172 /* Add [4K, 8K) following [0, 1K) */
173 em = alloc_extent_map();
175 test_std_err(TEST_ALLOC_EXTENT_MAP);
182 em->block_start = SZ_4K;
183 em->block_len = SZ_4K;
184 write_lock(&em_tree->lock);
185 ret = add_extent_mapping(em_tree, em, 0);
186 write_unlock(&em_tree->lock);
188 test_err("cannot add extent range [4K, 8K)");
193 em = alloc_extent_map();
195 test_std_err(TEST_ALLOC_EXTENT_MAP);
203 em->block_start = EXTENT_MAP_INLINE;
204 em->block_len = (u64)-1;
205 write_lock(&em_tree->lock);
206 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, em->start, em->len);
207 write_unlock(&em_tree->lock);
209 test_err("case2 [0 1K]: ret %d", ret);
213 (em->start != 0 || extent_map_end(em) != SZ_1K ||
214 em->block_start != EXTENT_MAP_INLINE || em->block_len != (u64)-1)) {
216 "case2 [0 1K]: ret %d return a wrong em (start %llu len %llu block_start %llu block_len %llu",
217 ret, em->start, em->len, em->block_start,
223 free_extent_map_tree(em_tree);
228 static int __test_case_3(struct btrfs_fs_info *fs_info,
229 struct extent_map_tree *em_tree, u64 start)
231 struct extent_map *em;
235 em = alloc_extent_map();
237 test_std_err(TEST_ALLOC_EXTENT_MAP);
244 em->block_start = SZ_4K;
245 em->block_len = SZ_4K;
246 write_lock(&em_tree->lock);
247 ret = add_extent_mapping(em_tree, em, 0);
248 write_unlock(&em_tree->lock);
250 test_err("cannot add extent range [4K, 8K)");
255 em = alloc_extent_map();
257 test_std_err(TEST_ALLOC_EXTENT_MAP);
266 em->block_len = SZ_16K;
267 write_lock(&em_tree->lock);
268 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len);
269 write_unlock(&em_tree->lock);
271 test_err("case3 [0x%llx 0x%llx): ret %d",
272 start, start + len, ret);
276 * Since bytes within em are contiguous, em->block_start is identical to
280 (start < em->start || start + len > extent_map_end(em) ||
281 em->start != em->block_start || em->len != em->block_len)) {
283 "case3 [0x%llx 0x%llx): ret %d em (start 0x%llx len 0x%llx block_start 0x%llx block_len 0x%llx)",
284 start, start + len, ret, em->start, em->len,
285 em->block_start, em->block_len);
290 free_extent_map_tree(em_tree);
298 * Suppose that no extent map has been loaded into memory yet.
299 * There is a file extent [0, 16K), two jobs are running concurrently
300 * against it, t1 is buffered writing to [4K, 8K) and t2 is doing dio
301 * read from [0, 4K) or [8K, 12K) or [12K, 16K).
303 * t1 goes ahead of t2 and adds em [4K, 8K) into tree.
306 * cow_file_range() btrfs_get_extent()
307 * -> lookup_extent_mapping()
308 * -> add_extent_mapping()
309 * -> add_extent_mapping()
311 static int test_case_3(struct btrfs_fs_info *fs_info,
312 struct extent_map_tree *em_tree)
316 ret = __test_case_3(fs_info, em_tree, 0);
319 ret = __test_case_3(fs_info, em_tree, SZ_8K);
322 ret = __test_case_3(fs_info, em_tree, (12 * SZ_1K));
327 static int __test_case_4(struct btrfs_fs_info *fs_info,
328 struct extent_map_tree *em_tree, u64 start)
330 struct extent_map *em;
334 em = alloc_extent_map();
336 test_std_err(TEST_ALLOC_EXTENT_MAP);
344 em->block_len = SZ_8K;
345 write_lock(&em_tree->lock);
346 ret = add_extent_mapping(em_tree, em, 0);
347 write_unlock(&em_tree->lock);
349 test_err("cannot add extent range [0, 8K)");
354 em = alloc_extent_map();
356 test_std_err(TEST_ALLOC_EXTENT_MAP);
363 em->len = 24 * SZ_1K;
364 em->block_start = SZ_16K; /* avoid merging */
365 em->block_len = 24 * SZ_1K;
366 write_lock(&em_tree->lock);
367 ret = add_extent_mapping(em_tree, em, 0);
368 write_unlock(&em_tree->lock);
370 test_err("cannot add extent range [8K, 32K)");
375 em = alloc_extent_map();
377 test_std_err(TEST_ALLOC_EXTENT_MAP);
385 em->block_len = SZ_32K;
386 write_lock(&em_tree->lock);
387 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len);
388 write_unlock(&em_tree->lock);
390 test_err("case4 [0x%llx 0x%llx): ret %d",
394 if (em && (start < em->start || start + len > extent_map_end(em))) {
396 "case4 [0x%llx 0x%llx): ret %d, added wrong em (start 0x%llx len 0x%llx block_start 0x%llx block_len 0x%llx)",
397 start, len, ret, em->start, em->len, em->block_start,
403 free_extent_map_tree(em_tree);
411 * Suppose that no extent map has been loaded into memory yet.
412 * There is a file extent [0, 32K), two jobs are running concurrently
413 * against it, t1 is doing dio write to [8K, 32K) and t2 is doing dio
414 * read from [0, 4K) or [4K, 8K).
416 * t1 goes ahead of t2 and splits em [0, 32K) to em [0K, 8K) and [8K 32K).
419 * btrfs_get_blocks_direct() btrfs_get_blocks_direct()
420 * -> btrfs_get_extent() -> btrfs_get_extent()
421 * -> lookup_extent_mapping()
422 * -> add_extent_mapping() -> lookup_extent_mapping()
424 * -> btrfs_new_extent_direct()
425 * -> btrfs_drop_extent_cache()
427 * -> add_extent_mapping()
429 * -> add_extent_mapping()
430 * # handle -EEXIST when adding
433 static int test_case_4(struct btrfs_fs_info *fs_info,
434 struct extent_map_tree *em_tree)
438 ret = __test_case_4(fs_info, em_tree, 0);
441 ret = __test_case_4(fs_info, em_tree, SZ_4K);
446 static int add_compressed_extent(struct extent_map_tree *em_tree,
447 u64 start, u64 len, u64 block_start)
449 struct extent_map *em;
452 em = alloc_extent_map();
454 test_std_err(TEST_ALLOC_EXTENT_MAP);
460 em->block_start = block_start;
461 em->block_len = SZ_4K;
462 set_bit(EXTENT_FLAG_COMPRESSED, &em->flags);
463 write_lock(&em_tree->lock);
464 ret = add_extent_mapping(em_tree, em, 0);
465 write_unlock(&em_tree->lock);
468 test_err("cannot add extent map [%llu, %llu)", start, start + len);
475 struct extent_range {
480 /* The valid states of the tree after every drop, as described below. */
481 struct extent_range valid_ranges[][7] = {
483 { .start = 0, .len = SZ_8K }, /* [0, 8K) */
484 { .start = SZ_4K * 3, .len = SZ_4K * 3}, /* [12k, 24k) */
485 { .start = SZ_4K * 6, .len = SZ_4K * 3}, /* [24k, 36k) */
486 { .start = SZ_32K + SZ_4K, .len = SZ_4K}, /* [36k, 40k) */
487 { .start = SZ_4K * 10, .len = SZ_4K * 6}, /* [40k, 64k) */
490 { .start = 0, .len = SZ_8K }, /* [0, 8K) */
491 { .start = SZ_4K * 5, .len = SZ_4K}, /* [20k, 24k) */
492 { .start = SZ_4K * 6, .len = SZ_4K * 3}, /* [24k, 36k) */
493 { .start = SZ_32K + SZ_4K, .len = SZ_4K}, /* [36k, 40k) */
494 { .start = SZ_4K * 10, .len = SZ_4K * 6}, /* [40k, 64k) */
497 { .start = 0, .len = SZ_8K }, /* [0, 8K) */
498 { .start = SZ_4K * 5, .len = SZ_4K}, /* [20k, 24k) */
499 { .start = SZ_4K * 6, .len = SZ_4K}, /* [24k, 28k) */
500 { .start = SZ_32K, .len = SZ_4K}, /* [32k, 36k) */
501 { .start = SZ_32K + SZ_4K, .len = SZ_4K}, /* [36k, 40k) */
502 { .start = SZ_4K * 10, .len = SZ_4K * 6}, /* [40k, 64k) */
505 { .start = 0, .len = SZ_8K}, /* [0, 8K) */
506 { .start = SZ_4K * 5, .len = SZ_4K}, /* [20k, 24k) */
507 { .start = SZ_4K * 6, .len = SZ_4K}, /* [24k, 28k) */
511 static int validate_range(struct extent_map_tree *em_tree, int index)
516 for (i = 0, n = rb_first_cached(&em_tree->map);
517 valid_ranges[index][i].len && n;
518 i++, n = rb_next(n)) {
519 struct extent_map *entry = rb_entry(n, struct extent_map, rb_node);
521 if (entry->start != valid_ranges[index][i].start) {
522 test_err("mapping has start %llu expected %llu",
523 entry->start, valid_ranges[index][i].start);
527 if (entry->len != valid_ranges[index][i].len) {
528 test_err("mapping has len %llu expected %llu",
529 entry->len, valid_ranges[index][i].len);
535 * We exited because we don't have any more entries in the extent_map
536 * but we still expect more valid entries.
538 if (valid_ranges[index][i].len) {
539 test_err("missing an entry");
543 /* We exited the loop but still have entries in the extent map. */
545 test_err("we have a left over entry in the extent map we didn't expect");
555 * Test the various edge cases of btrfs_drop_extent_map_range, create the
558 * [0, 12k)[12k, 24k)[24k, 36k)[36k, 40k)[40k,64k)
560 * And then we'll drop:
562 * [8k, 12k) - test the single front split
563 * [12k, 20k) - test the single back split
564 * [28k, 32k) - test the double split
565 * [32k, 64k) - test whole em dropping
567 * They'll have the EXTENT_FLAG_COMPRESSED flag set to keep the em tree from
570 static int test_case_5(void)
572 struct extent_map_tree *em_tree;
577 test_msg("Running btrfs_drop_extent_map_range tests");
579 inode = btrfs_new_test_inode();
581 test_std_err(TEST_ALLOC_INODE);
585 em_tree = &BTRFS_I(inode)->extent_tree;
588 ret = add_compressed_extent(em_tree, 0, SZ_4K * 3, 0);
590 test_err("cannot add extent range [0, 12K)");
595 ret = add_compressed_extent(em_tree, SZ_4K * 3, SZ_4K * 3, SZ_4K);
597 test_err("cannot add extent range [12k, 24k)");
602 ret = add_compressed_extent(em_tree, SZ_4K * 6, SZ_4K * 3, SZ_8K);
604 test_err("cannot add extent range [12k, 24k)");
609 ret = add_compressed_extent(em_tree, SZ_32K + SZ_4K, SZ_4K, SZ_4K * 3);
611 test_err("cannot add extent range [12k, 24k)");
616 ret = add_compressed_extent(em_tree, SZ_4K * 10, SZ_4K * 6, SZ_16K);
618 test_err("cannot add extent range [12k, 24k)");
624 end = (3 * SZ_4K) - 1;
625 btrfs_drop_extent_map_range(BTRFS_I(inode), start, end, false);
626 ret = validate_range(&BTRFS_I(inode)->extent_tree, 0);
630 /* Drop [12k, 20k) */
632 end = SZ_16K + SZ_4K - 1;
633 btrfs_drop_extent_map_range(BTRFS_I(inode), start, end, false);
634 ret = validate_range(&BTRFS_I(inode)->extent_tree, 1);
638 /* Drop [28k, 32k) */
639 start = SZ_32K - SZ_4K;
641 btrfs_drop_extent_map_range(BTRFS_I(inode), start, end, false);
642 ret = validate_range(&BTRFS_I(inode)->extent_tree, 2);
646 /* Drop [32k, 64k) */
649 btrfs_drop_extent_map_range(BTRFS_I(inode), start, end, false);
650 ret = validate_range(&BTRFS_I(inode)->extent_tree, 3);
659 * Test the btrfs_add_extent_mapping helper which will attempt to create an em
660 * for areas between two existing ems. Validate it doesn't do this when there
661 * are two unmerged em's side by side.
663 static int test_case_6(struct btrfs_fs_info *fs_info, struct extent_map_tree *em_tree)
665 struct extent_map *em = NULL;
668 ret = add_compressed_extent(em_tree, 0, SZ_4K, 0);
672 ret = add_compressed_extent(em_tree, SZ_4K, SZ_4K, 0);
676 em = alloc_extent_map();
678 test_std_err(TEST_ALLOC_EXTENT_MAP);
684 em->block_start = SZ_16K;
685 em->block_len = SZ_16K;
686 write_lock(&em_tree->lock);
687 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, 0, SZ_8K);
688 write_unlock(&em_tree->lock);
691 test_err("got an error when adding our em: %d", ret);
696 if (em->start != 0) {
697 test_err("unexpected em->start at %llu, wanted 0", em->start);
700 if (em->len != SZ_4K) {
701 test_err("unexpected em->len %llu, expected 4K", em->len);
707 free_extent_map_tree(em_tree);
712 * Regression test for btrfs_drop_extent_map_range. Calling with skip_pinned ==
713 * true would mess up the start/end calculations and subsequent splits would be
716 static int test_case_7(void)
718 struct extent_map_tree *em_tree;
719 struct extent_map *em;
723 test_msg("Running btrfs_drop_extent_cache with pinned");
725 inode = btrfs_new_test_inode();
727 test_std_err(TEST_ALLOC_INODE);
731 em_tree = &BTRFS_I(inode)->extent_tree;
733 em = alloc_extent_map();
735 test_std_err(TEST_ALLOC_EXTENT_MAP);
740 /* [0, 16K), pinned */
744 em->block_len = SZ_4K;
745 set_bit(EXTENT_FLAG_PINNED, &em->flags);
746 write_lock(&em_tree->lock);
747 ret = add_extent_mapping(em_tree, em, 0);
748 write_unlock(&em_tree->lock);
750 test_err("couldn't add extent map");
755 em = alloc_extent_map();
757 test_std_err(TEST_ALLOC_EXTENT_MAP);
762 /* [32K, 48K), not pinned */
765 em->block_start = SZ_32K;
766 em->block_len = SZ_16K;
767 write_lock(&em_tree->lock);
768 ret = add_extent_mapping(em_tree, em, 0);
769 write_unlock(&em_tree->lock);
771 test_err("couldn't add extent map");
777 * Drop [0, 36K) This should skip the [0, 4K) extent and then split the
780 btrfs_drop_extent_map_range(BTRFS_I(inode), 0, (36 * SZ_1K) - 1, true);
782 /* Make sure our extent maps look sane. */
785 em = lookup_extent_mapping(em_tree, 0, SZ_16K);
787 test_err("didn't find an em at 0 as expected");
791 if (em->start != 0) {
792 test_err("em->start is %llu, expected 0", em->start);
796 if (em->len != SZ_16K) {
797 test_err("em->len is %llu, expected 16K", em->len);
803 read_lock(&em_tree->lock);
804 em = lookup_extent_mapping(em_tree, SZ_16K, SZ_16K);
805 read_unlock(&em_tree->lock);
807 test_err("found an em when we weren't expecting one");
811 read_lock(&em_tree->lock);
812 em = lookup_extent_mapping(em_tree, SZ_32K, SZ_16K);
813 read_unlock(&em_tree->lock);
815 test_err("didn't find an em at 32K as expected");
819 if (em->start != (36 * SZ_1K)) {
820 test_err("em->start is %llu, expected 36K", em->start);
824 if (em->len != (12 * SZ_1K)) {
825 test_err("em->len is %llu, expected 12K", em->len);
831 read_lock(&em_tree->lock);
832 em = lookup_extent_mapping(em_tree, 48 * SZ_1K, (u64)-1);
833 read_unlock(&em_tree->lock);
835 test_err("found an unexpected em above 48K");
846 struct rmap_test_vector {
849 u64 data_stripe_size;
850 u64 num_data_stripes;
852 /* Assume we won't have more than 5 physical stripes */
853 u64 data_stripe_phys_start[5];
854 bool expected_mapped_addr;
855 /* Physical to logical addresses */
856 u64 mapped_logical[5];
859 static int test_rmap_block(struct btrfs_fs_info *fs_info,
860 struct rmap_test_vector *test)
862 struct extent_map *em;
863 struct map_lookup *map = NULL;
865 int i, out_ndaddrs, out_stripe_len;
868 em = alloc_extent_map();
870 test_std_err(TEST_ALLOC_EXTENT_MAP);
874 map = kmalloc(map_lookup_size(test->num_stripes), GFP_KERNEL);
877 test_std_err(TEST_ALLOC_EXTENT_MAP);
881 set_bit(EXTENT_FLAG_FS_MAPPING, &em->flags);
882 /* Start at 4GiB logical address */
884 em->len = test->data_stripe_size * test->num_data_stripes;
885 em->block_len = em->len;
886 em->orig_block_len = test->data_stripe_size;
887 em->map_lookup = map;
889 map->num_stripes = test->num_stripes;
890 map->type = test->raid_type;
892 for (i = 0; i < map->num_stripes; i++) {
893 struct btrfs_device *dev = btrfs_alloc_dummy_device(fs_info);
896 test_err("cannot allocate device");
900 map->stripes[i].dev = dev;
901 map->stripes[i].physical = test->data_stripe_phys_start[i];
904 write_lock(&fs_info->mapping_tree.lock);
905 ret = add_extent_mapping(&fs_info->mapping_tree, em, 0);
906 write_unlock(&fs_info->mapping_tree.lock);
908 test_err("error adding block group mapping to mapping tree");
912 ret = btrfs_rmap_block(fs_info, em->start, btrfs_sb_offset(1),
913 &logical, &out_ndaddrs, &out_stripe_len);
914 if (ret || (out_ndaddrs == 0 && test->expected_mapped_addr)) {
915 test_err("didn't rmap anything but expected %d",
916 test->expected_mapped_addr);
920 if (out_stripe_len != BTRFS_STRIPE_LEN) {
921 test_err("calculated stripe length doesn't match");
925 if (out_ndaddrs != test->expected_mapped_addr) {
926 for (i = 0; i < out_ndaddrs; i++)
927 test_msg("mapped %llu", logical[i]);
928 test_err("unexpected number of mapped addresses: %d", out_ndaddrs);
932 for (i = 0; i < out_ndaddrs; i++) {
933 if (logical[i] != test->mapped_logical[i]) {
934 test_err("unexpected logical address mapped");
941 write_lock(&fs_info->mapping_tree.lock);
942 remove_extent_mapping(&fs_info->mapping_tree, em);
943 write_unlock(&fs_info->mapping_tree.lock);
953 int btrfs_test_extent_map(void)
955 struct btrfs_fs_info *fs_info = NULL;
956 struct extent_map_tree *em_tree;
958 struct rmap_test_vector rmap_tests[] = {
961 * Test a chunk with 2 data stripes one of which
962 * intersects the physical address of the super block
963 * is correctly recognised.
965 .raid_type = BTRFS_BLOCK_GROUP_RAID1,
966 .physical_start = SZ_64M - SZ_4M,
967 .data_stripe_size = SZ_256M,
968 .num_data_stripes = 2,
970 .data_stripe_phys_start =
971 {SZ_64M - SZ_4M, SZ_64M - SZ_4M + SZ_256M},
972 .expected_mapped_addr = true,
973 .mapped_logical= {SZ_4G + SZ_4M}
977 * Test that out-of-range physical addresses are
981 /* SINGLE chunk type */
983 .physical_start = SZ_4G,
984 .data_stripe_size = SZ_256M,
985 .num_data_stripes = 1,
987 .data_stripe_phys_start = {SZ_256M},
988 .expected_mapped_addr = false,
989 .mapped_logical = {0}
993 test_msg("running extent_map tests");
996 * Note: the fs_info is not set up completely, we only need
997 * fs_info::fsid for the tracepoint.
999 fs_info = btrfs_alloc_dummy_fs_info(PAGE_SIZE, PAGE_SIZE);
1001 test_std_err(TEST_ALLOC_FS_INFO);
1005 em_tree = kzalloc(sizeof(*em_tree), GFP_KERNEL);
1011 extent_map_tree_init(em_tree);
1013 ret = test_case_1(fs_info, em_tree);
1016 ret = test_case_2(fs_info, em_tree);
1019 ret = test_case_3(fs_info, em_tree);
1022 ret = test_case_4(fs_info, em_tree);
1025 ret = test_case_5();
1028 ret = test_case_6(fs_info, em_tree);
1031 ret = test_case_7();
1035 test_msg("running rmap tests");
1036 for (i = 0; i < ARRAY_SIZE(rmap_tests); i++) {
1037 ret = test_rmap_block(fs_info, &rmap_tests[i]);
1044 btrfs_free_dummy_fs_info(fs_info);