Lines Matching refs:em

12 	struct extent_map *em;  in free_extent_map_tree()  local
17 em = rb_entry(node, struct extent_map, rb_node); in free_extent_map_tree()
18 remove_extent_mapping(em_tree, em); in free_extent_map_tree()
21 if (refcount_read(&em->refs) != 1) { in free_extent_map_tree()
24 em->start, em->len, em->block_start, in free_extent_map_tree()
25 em->block_len, refcount_read(&em->refs)); in free_extent_map_tree()
27 refcount_set(&em->refs, 1); in free_extent_map_tree()
30 free_extent_map(em); in free_extent_map_tree()
53 struct extent_map *em; in test_case_1() local
58 em = alloc_extent_map(); in test_case_1()
59 if (!em) in test_case_1()
64 em->start = 0; in test_case_1()
65 em->len = SZ_16K; in test_case_1()
66 em->block_start = 0; in test_case_1()
67 em->block_len = SZ_16K; in test_case_1()
68 ret = add_extent_mapping(em_tree, em, 0); in test_case_1()
70 free_extent_map(em); in test_case_1()
73 em = alloc_extent_map(); in test_case_1()
74 if (!em) in test_case_1()
77 em->start = SZ_16K; in test_case_1()
78 em->len = SZ_4K; in test_case_1()
79 em->block_start = SZ_32K; /* avoid merging */ in test_case_1()
80 em->block_len = SZ_4K; in test_case_1()
81 ret = add_extent_mapping(em_tree, em, 0); in test_case_1()
83 free_extent_map(em); in test_case_1()
85 em = alloc_extent_map(); in test_case_1()
86 if (!em) in test_case_1()
90 em->start = start; in test_case_1()
91 em->len = len; in test_case_1()
92 em->block_start = start; in test_case_1()
93 em->block_len = len; in test_case_1()
94 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, em->start, em->len); in test_case_1()
97 if (em && in test_case_1()
98 (em->start != 0 || extent_map_end(em) != SZ_16K || in test_case_1()
99 em->block_start != 0 || em->block_len != SZ_16K)) in test_case_1()
102 start, start + len, ret, em->start, em->len, in test_case_1()
103 em->block_start, em->block_len); in test_case_1()
104 free_extent_map(em); in test_case_1()
119 struct extent_map *em; in test_case_2() local
122 em = alloc_extent_map(); in test_case_2()
123 if (!em) in test_case_2()
128 em->start = 0; in test_case_2()
129 em->len = SZ_1K; in test_case_2()
130 em->block_start = EXTENT_MAP_INLINE; in test_case_2()
131 em->block_len = (u64)-1; in test_case_2()
132 ret = add_extent_mapping(em_tree, em, 0); in test_case_2()
134 free_extent_map(em); in test_case_2()
137 em = alloc_extent_map(); in test_case_2()
138 if (!em) in test_case_2()
141 em->start = SZ_4K; in test_case_2()
142 em->len = SZ_4K; in test_case_2()
143 em->block_start = SZ_4K; in test_case_2()
144 em->block_len = SZ_4K; in test_case_2()
145 ret = add_extent_mapping(em_tree, em, 0); in test_case_2()
147 free_extent_map(em); in test_case_2()
149 em = alloc_extent_map(); in test_case_2()
150 if (!em) in test_case_2()
154 em->start = 0; in test_case_2()
155 em->len = SZ_1K; in test_case_2()
156 em->block_start = EXTENT_MAP_INLINE; in test_case_2()
157 em->block_len = (u64)-1; in test_case_2()
158 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, em->start, em->len); in test_case_2()
161 if (em && in test_case_2()
162 (em->start != 0 || extent_map_end(em) != SZ_1K || in test_case_2()
163 em->block_start != EXTENT_MAP_INLINE || em->block_len != (u64)-1)) in test_case_2()
166 ret, em->start, em->len, em->block_start, in test_case_2()
167 em->block_len); in test_case_2()
168 free_extent_map(em); in test_case_2()
177 struct extent_map *em; in __test_case_3() local
181 em = alloc_extent_map(); in __test_case_3()
182 if (!em) in __test_case_3()
187 em->start = SZ_4K; in __test_case_3()
188 em->len = SZ_4K; in __test_case_3()
189 em->block_start = SZ_4K; in __test_case_3()
190 em->block_len = SZ_4K; in __test_case_3()
191 ret = add_extent_mapping(em_tree, em, 0); in __test_case_3()
193 free_extent_map(em); in __test_case_3()
195 em = alloc_extent_map(); in __test_case_3()
196 if (!em) in __test_case_3()
200 em->start = 0; in __test_case_3()
201 em->len = SZ_16K; in __test_case_3()
202 em->block_start = 0; in __test_case_3()
203 em->block_len = SZ_16K; in __test_case_3()
204 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len); in __test_case_3()
212 if (em && in __test_case_3()
213 (start < em->start || start + len > extent_map_end(em) || in __test_case_3()
214 em->start != em->block_start || em->len != em->block_len)) in __test_case_3()
217 start, start + len, ret, em->start, em->len, in __test_case_3()
218 em->block_start, em->block_len); in __test_case_3()
219 free_extent_map(em); in __test_case_3()
252 struct extent_map *em; in __test_case_4() local
256 em = alloc_extent_map(); in __test_case_4()
257 if (!em) in __test_case_4()
262 em->start = 0; in __test_case_4()
263 em->len = SZ_8K; in __test_case_4()
264 em->block_start = 0; in __test_case_4()
265 em->block_len = SZ_8K; in __test_case_4()
266 ret = add_extent_mapping(em_tree, em, 0); in __test_case_4()
268 free_extent_map(em); in __test_case_4()
270 em = alloc_extent_map(); in __test_case_4()
271 if (!em) in __test_case_4()
275 em->start = SZ_8K; in __test_case_4()
276 em->len = 24 * 1024ULL; in __test_case_4()
277 em->block_start = SZ_16K; /* avoid merging */ in __test_case_4()
278 em->block_len = 24 * 1024ULL; in __test_case_4()
279 ret = add_extent_mapping(em_tree, em, 0); in __test_case_4()
281 free_extent_map(em); in __test_case_4()
283 em = alloc_extent_map(); in __test_case_4()
284 if (!em) in __test_case_4()
287 em->start = 0; in __test_case_4()
288 em->len = SZ_32K; in __test_case_4()
289 em->block_start = 0; in __test_case_4()
290 em->block_len = SZ_32K; in __test_case_4()
291 ret = btrfs_add_extent_mapping(fs_info, em_tree, &em, start, len); in __test_case_4()
295 if (em && in __test_case_4()
296 (start < em->start || start + len > extent_map_end(em))) in __test_case_4()
299 start, len, ret, em->start, em->len, em->block_start, in __test_case_4()
300 em->block_len); in __test_case_4()
301 free_extent_map(em); in __test_case_4()