Lines Matching refs:cache

21 				      struct btrfs_block_group *cache,  in __check_free_space_extents()  argument
34 info = search_free_space_info(trans, cache, path, 0); in __check_free_space_extents()
51 end = cache->start + cache->length; in __check_free_space_extents()
59 bit = free_space_test_bit(cache, path, offset); in __check_free_space_extents()
108 struct btrfs_block_group *cache, in check_free_space_extents() argument
117 info = search_free_space_info(trans, cache, path, 0); in check_free_space_extents()
126 ret = __check_free_space_extents(trans, fs_info, cache, path, extents, in check_free_space_extents()
133 ret = convert_free_space_to_extents(trans, cache, path); in check_free_space_extents()
139 ret = convert_free_space_to_bitmaps(trans, cache, path); in check_free_space_extents()
145 return __check_free_space_extents(trans, fs_info, cache, path, extents, in check_free_space_extents()
151 struct btrfs_block_group *cache, in test_empty_block_group() argument
156 {cache->start, cache->length}, in test_empty_block_group()
159 return check_free_space_extents(trans, fs_info, cache, path, in test_empty_block_group()
165 struct btrfs_block_group *cache, in test_remove_all() argument
172 ret = __remove_from_free_space_tree(trans, cache, path, in test_remove_all()
173 cache->start, in test_remove_all()
174 cache->length); in test_remove_all()
180 return check_free_space_extents(trans, fs_info, cache, path, in test_remove_all()
186 struct btrfs_block_group *cache, in test_remove_beginning() argument
191 {cache->start + alignment, cache->length - alignment}, in test_remove_beginning()
195 ret = __remove_from_free_space_tree(trans, cache, path, in test_remove_beginning()
196 cache->start, alignment); in test_remove_beginning()
202 return check_free_space_extents(trans, fs_info, cache, path, in test_remove_beginning()
209 struct btrfs_block_group *cache, in test_remove_end() argument
214 {cache->start, cache->length - alignment}, in test_remove_end()
218 ret = __remove_from_free_space_tree(trans, cache, path, in test_remove_end()
219 cache->start + cache->length - alignment, in test_remove_end()
226 return check_free_space_extents(trans, fs_info, cache, path, in test_remove_end()
232 struct btrfs_block_group *cache, in test_remove_middle() argument
237 {cache->start, alignment}, in test_remove_middle()
238 {cache->start + 2 * alignment, cache->length - 2 * alignment}, in test_remove_middle()
242 ret = __remove_from_free_space_tree(trans, cache, path, in test_remove_middle()
243 cache->start + alignment, in test_remove_middle()
250 return check_free_space_extents(trans, fs_info, cache, path, in test_remove_middle()
256 struct btrfs_block_group *cache, in test_merge_left() argument
261 {cache->start, 2 * alignment}, in test_merge_left()
265 ret = __remove_from_free_space_tree(trans, cache, path, in test_merge_left()
266 cache->start, cache->length); in test_merge_left()
272 ret = __add_to_free_space_tree(trans, cache, path, cache->start, in test_merge_left()
279 ret = __add_to_free_space_tree(trans, cache, path, in test_merge_left()
280 cache->start + alignment, in test_merge_left()
287 return check_free_space_extents(trans, fs_info, cache, path, in test_merge_left()
293 struct btrfs_block_group *cache, in test_merge_right() argument
298 {cache->start + alignment, 2 * alignment}, in test_merge_right()
302 ret = __remove_from_free_space_tree(trans, cache, path, in test_merge_right()
303 cache->start, cache->length); in test_merge_right()
309 ret = __add_to_free_space_tree(trans, cache, path, in test_merge_right()
310 cache->start + 2 * alignment, in test_merge_right()
317 ret = __add_to_free_space_tree(trans, cache, path, in test_merge_right()
318 cache->start + alignment, in test_merge_right()
325 return check_free_space_extents(trans, fs_info, cache, path, in test_merge_right()
331 struct btrfs_block_group *cache, in test_merge_both() argument
336 {cache->start, 3 * alignment}, in test_merge_both()
340 ret = __remove_from_free_space_tree(trans, cache, path, in test_merge_both()
341 cache->start, cache->length); in test_merge_both()
347 ret = __add_to_free_space_tree(trans, cache, path, cache->start, in test_merge_both()
354 ret = __add_to_free_space_tree(trans, cache, path, in test_merge_both()
355 cache->start + 2 * alignment, alignment); in test_merge_both()
361 ret = __add_to_free_space_tree(trans, cache, path, in test_merge_both()
362 cache->start + alignment, alignment); in test_merge_both()
368 return check_free_space_extents(trans, fs_info, cache, path, in test_merge_both()
374 struct btrfs_block_group *cache, in test_merge_none() argument
379 {cache->start, alignment}, in test_merge_none()
380 {cache->start + 2 * alignment, alignment}, in test_merge_none()
381 {cache->start + 4 * alignment, alignment}, in test_merge_none()
385 ret = __remove_from_free_space_tree(trans, cache, path, in test_merge_none()
386 cache->start, cache->length); in test_merge_none()
392 ret = __add_to_free_space_tree(trans, cache, path, cache->start, in test_merge_none()
399 ret = __add_to_free_space_tree(trans, cache, path, in test_merge_none()
400 cache->start + 4 * alignment, alignment); in test_merge_none()
406 ret = __add_to_free_space_tree(trans, cache, path, in test_merge_none()
407 cache->start + 2 * alignment, alignment); in test_merge_none()
413 return check_free_space_extents(trans, fs_info, cache, path, in test_merge_none()
428 struct btrfs_block_group *cache = NULL; in run_test() local
465 cache = btrfs_alloc_dummy_block_group(fs_info, 8 * alignment); in run_test()
466 if (!cache) { in run_test()
471 cache->bitmap_low_thresh = 0; in run_test()
472 cache->bitmap_high_thresh = (u32)-1; in run_test()
473 cache->needs_free_space = 1; in run_test()
474 cache->fs_info = root->fs_info; in run_test()
485 ret = add_block_group_free_space(&trans, cache); in run_test()
492 ret = convert_free_space_to_bitmaps(&trans, cache, path); in run_test()
499 ret = test_func(&trans, root->fs_info, cache, path, alignment); in run_test()
503 ret = remove_block_group_free_space(&trans, cache); in run_test()
518 btrfs_free_dummy_block_group(cache); in run_test()