• Home
  • Raw
  • Download

Lines Matching full:em

15 	struct extent_map *em;  in free_extent_map_tree()  local
20 em = rb_entry(node, struct extent_map, rb_node); in free_extent_map_tree()
21 remove_extent_mapping(em_tree, em); in free_extent_map_tree()
24 if (refcount_read(&em->refs) != 1) { in free_extent_map_tree()
26 "em leak: em (start 0x%llx len 0x%llx block_start 0x%llx block_len 0x%llx) refs %d", in free_extent_map_tree()
27 em->start, em->len, em->block_start, in free_extent_map_tree()
28 em->block_len, refcount_read(&em->refs)); in free_extent_map_tree()
30 refcount_set(&em->refs, 1); in free_extent_map_tree()
33 free_extent_map(em); in free_extent_map_tree()
49 * -> return em
56 struct extent_map *em; in test_case_1() local
61 em = alloc_extent_map(); in test_case_1()
62 if (!em) { in test_case_1()
68 em->start = 0; in test_case_1()
69 em->len = SZ_16K; in test_case_1()
70 em->block_start = 0; in test_case_1()
71 em->block_len = SZ_16K; in test_case_1()
73 ret = add_extent_mapping(em_tree, em, 0); in test_case_1()
79 free_extent_map(em); in test_case_1()
82 em = alloc_extent_map(); in test_case_1()
83 if (!em) { in test_case_1()
89 em->start = SZ_16K; in test_case_1()
90 em->len = SZ_4K; in test_case_1()
91 em->block_start = SZ_32K; /* avoid merging */ in test_case_1()
92 em->block_len = SZ_4K; in test_case_1()
94 ret = add_extent_mapping(em_tree, em, 0); in test_case_1()
100 free_extent_map(em); in test_case_1()
102 em = alloc_extent_map(); in test_case_1()
103 if (!em) { in test_case_1()
110 em->start = start; in test_case_1()
111 em->len = len; in test_case_1()
112 em->block_start = start; in test_case_1()
113 em->block_len = len; in test_case_1()
115 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, em->start, em->len); in test_case_1()
121 if (em && in test_case_1()
122 (em->start != 0 || extent_map_end(em) != SZ_16K || in test_case_1()
123 em->block_start != 0 || em->block_len != SZ_16K)) { in test_case_1()
125 "case1 [%llu %llu]: ret %d return a wrong em (start %llu len %llu block_start %llu block_len %llu", in test_case_1()
126 start, start + len, ret, em->start, em->len, in test_case_1()
127 em->block_start, em->block_len); in test_case_1()
130 free_extent_map(em); in test_case_1()
146 struct extent_map *em; in test_case_2() local
149 em = alloc_extent_map(); in test_case_2()
150 if (!em) { in test_case_2()
156 em->start = 0; in test_case_2()
157 em->len = SZ_1K; in test_case_2()
158 em->block_start = EXTENT_MAP_INLINE; in test_case_2()
159 em->block_len = (u64)-1; in test_case_2()
161 ret = add_extent_mapping(em_tree, em, 0); in test_case_2()
167 free_extent_map(em); in test_case_2()
170 em = alloc_extent_map(); in test_case_2()
171 if (!em) { in test_case_2()
177 em->start = SZ_4K; in test_case_2()
178 em->len = SZ_4K; in test_case_2()
179 em->block_start = SZ_4K; in test_case_2()
180 em->block_len = SZ_4K; in test_case_2()
182 ret = add_extent_mapping(em_tree, em, 0); in test_case_2()
188 free_extent_map(em); in test_case_2()
190 em = alloc_extent_map(); in test_case_2()
191 if (!em) { in test_case_2()
198 em->start = 0; in test_case_2()
199 em->len = SZ_1K; in test_case_2()
200 em->block_start = EXTENT_MAP_INLINE; in test_case_2()
201 em->block_len = (u64)-1; in test_case_2()
203 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, em->start, em->len); in test_case_2()
209 if (em && in test_case_2()
210 (em->start != 0 || extent_map_end(em) != SZ_1K || in test_case_2()
211 em->block_start != EXTENT_MAP_INLINE || em->block_len != (u64)-1)) { in test_case_2()
213 "case2 [0 1K]: ret %d return a wrong em (start %llu len %llu block_start %llu block_len %llu", in test_case_2()
214 ret, em->start, em->len, em->block_start, in test_case_2()
215 em->block_len); in test_case_2()
218 free_extent_map(em); in test_case_2()
228 struct extent_map *em; in __test_case_3() local
232 em = alloc_extent_map(); in __test_case_3()
233 if (!em) { in __test_case_3()
239 em->start = SZ_4K; in __test_case_3()
240 em->len = SZ_4K; in __test_case_3()
241 em->block_start = SZ_4K; in __test_case_3()
242 em->block_len = SZ_4K; in __test_case_3()
244 ret = add_extent_mapping(em_tree, em, 0); in __test_case_3()
250 free_extent_map(em); in __test_case_3()
252 em = alloc_extent_map(); in __test_case_3()
253 if (!em) { in __test_case_3()
260 em->start = 0; in __test_case_3()
261 em->len = SZ_16K; in __test_case_3()
262 em->block_start = 0; in __test_case_3()
263 em->block_len = SZ_16K; in __test_case_3()
265 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len); in __test_case_3()
273 * Since bytes within em are contiguous, em->block_start is identical to in __test_case_3()
274 * em->start. in __test_case_3()
276 if (em && in __test_case_3()
277 (start < em->start || start + len > extent_map_end(em) || in __test_case_3()
278 em->start != em->block_start || em->len != em->block_len)) { in __test_case_3()
280 "case3 [0x%llx 0x%llx): ret %d em (start 0x%llx len 0x%llx block_start 0x%llx block_len 0x%llx)", in __test_case_3()
281 start, start + len, ret, em->start, em->len, in __test_case_3()
282 em->block_start, em->block_len); in __test_case_3()
285 free_extent_map(em); in __test_case_3()
300 * t1 goes ahead of t2 and adds em [4K, 8K) into tree.
327 struct extent_map *em; in __test_case_4() local
331 em = alloc_extent_map(); in __test_case_4()
332 if (!em) { in __test_case_4()
338 em->start = 0; in __test_case_4()
339 em->len = SZ_8K; in __test_case_4()
340 em->block_start = 0; in __test_case_4()
341 em->block_len = SZ_8K; in __test_case_4()
343 ret = add_extent_mapping(em_tree, em, 0); in __test_case_4()
349 free_extent_map(em); in __test_case_4()
351 em = alloc_extent_map(); in __test_case_4()
352 if (!em) { in __test_case_4()
359 em->start = SZ_8K; in __test_case_4()
360 em->len = 24 * SZ_1K; in __test_case_4()
361 em->block_start = SZ_16K; /* avoid merging */ in __test_case_4()
362 em->block_len = 24 * SZ_1K; in __test_case_4()
364 ret = add_extent_mapping(em_tree, em, 0); in __test_case_4()
370 free_extent_map(em); in __test_case_4()
372 em = alloc_extent_map(); in __test_case_4()
373 if (!em) { in __test_case_4()
379 em->start = 0; in __test_case_4()
380 em->len = SZ_32K; in __test_case_4()
381 em->block_start = 0; in __test_case_4()
382 em->block_len = SZ_32K; in __test_case_4()
384 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len); in __test_case_4()
391 if (em && (start < em->start || start + len > extent_map_end(em))) { in __test_case_4()
393 "case4 [0x%llx 0x%llx): ret %d, added wrong em (start 0x%llx len 0x%llx block_start 0x%llx block_le… in __test_case_4()
394 start, len, ret, em->start, em->len, em->block_start, in __test_case_4()
395 em->block_len); in __test_case_4()
398 free_extent_map(em); in __test_case_4()
413 * t1 goes ahead of t2 and splits em [0, 32K) to em [0K, 8K) and [8K 32K).
459 struct extent_map *em; in test_rmap_block() local
465 em = alloc_extent_map(); in test_rmap_block()
466 if (!em) { in test_rmap_block()
473 kfree(em); in test_rmap_block()
478 set_bit(EXTENT_FLAG_FS_MAPPING, &em->flags); in test_rmap_block()
480 em->start = SZ_4G; in test_rmap_block()
481 em->len = test->data_stripe_size * test->num_data_stripes; in test_rmap_block()
482 em->block_len = em->len; in test_rmap_block()
483 em->orig_block_len = test->data_stripe_size; in test_rmap_block()
484 em->map_lookup = map; in test_rmap_block()
503 ret = add_extent_mapping(&fs_info->mapping_tree, em, 0); in test_rmap_block()
510 ret = btrfs_rmap_block(fs_info, em->start, btrfs_sb_offset(1), in test_rmap_block()
540 remove_extent_mapping(&fs_info->mapping_tree, em); in test_rmap_block()
543 free_extent_map(em); in test_rmap_block()
546 free_extent_map(em); in test_rmap_block()