• Home
  • Raw
  • Download

Lines Matching refs:ret

62 	int ret = 0;  in test_extents()  local
67 ret = btrfs_add_free_space(cache, 0, 4 * 1024 * 1024); in test_extents()
68 if (ret) { in test_extents()
69 test_msg("Error adding initial extents %d\n", ret); in test_extents()
70 return ret; in test_extents()
73 ret = btrfs_remove_free_space(cache, 0, 4 * 1024 * 1024); in test_extents()
74 if (ret) { in test_extents()
75 test_msg("Error removing extent %d\n", ret); in test_extents()
76 return ret; in test_extents()
85 ret = btrfs_add_free_space(cache, 0, 4 * 1024 * 1024); in test_extents()
86 if (ret) { in test_extents()
87 test_msg("Error adding half extent %d\n", ret); in test_extents()
88 return ret; in test_extents()
91 ret = btrfs_remove_free_space(cache, 3 * 1024 * 1024, 1 * 1024 * 1024); in test_extents()
92 if (ret) { in test_extents()
93 test_msg("Error removing tail end %d\n", ret); in test_extents()
94 return ret; in test_extents()
97 ret = btrfs_remove_free_space(cache, 0, 1 * 1024 * 1024); in test_extents()
98 if (ret) { in test_extents()
99 test_msg("Error removing front end %d\n", ret); in test_extents()
100 return ret; in test_extents()
103 ret = btrfs_remove_free_space(cache, 2 * 1024 * 1024, 4096); in test_extents()
104 if (ret) { in test_extents()
105 test_msg("Error removing middle piece %d\n", ret); in test_extents()
106 return ret; in test_extents()
133 int ret; in test_bitmaps() local
137 ret = test_add_free_space_entry(cache, 0, 4 * 1024 * 1024, 1); in test_bitmaps()
138 if (ret) { in test_bitmaps()
139 test_msg("Couldn't create a bitmap entry %d\n", ret); in test_bitmaps()
140 return ret; in test_bitmaps()
143 ret = btrfs_remove_free_space(cache, 0, 4 * 1024 * 1024); in test_bitmaps()
144 if (ret) { in test_bitmaps()
145 test_msg("Error removing bitmap full range %d\n", ret); in test_bitmaps()
146 return ret; in test_bitmaps()
154 ret = test_add_free_space_entry(cache, 0, 4 * 1024 * 1024, 1); in test_bitmaps()
155 if (ret) { in test_bitmaps()
156 test_msg("Couldn't add to our bitmap entry %d\n", ret); in test_bitmaps()
157 return ret; in test_bitmaps()
160 ret = btrfs_remove_free_space(cache, 1 * 1024 * 1024, 2 * 1024 * 1024); in test_bitmaps()
161 if (ret) { in test_bitmaps()
162 test_msg("Couldn't remove middle chunk %d\n", ret); in test_bitmaps()
163 return ret; in test_bitmaps()
173 ret = test_add_free_space_entry(cache, next_bitmap_offset - in test_bitmaps()
175 if (ret) { in test_bitmaps()
177 ret); in test_bitmaps()
178 return ret; in test_bitmaps()
181 ret = btrfs_remove_free_space(cache, next_bitmap_offset - in test_bitmaps()
183 if (ret) { in test_bitmaps()
184 test_msg("Couldn't remove overlapping space %d\n", ret); in test_bitmaps()
185 return ret; in test_bitmaps()
203 int ret; in test_bitmaps_and_extents() local
212 ret = test_add_free_space_entry(cache, 4 * 1024 * 1024, 1 * 1024 * 1024, 1); in test_bitmaps_and_extents()
213 if (ret) { in test_bitmaps_and_extents()
214 test_msg("Couldn't create bitmap entry %d\n", ret); in test_bitmaps_and_extents()
215 return ret; in test_bitmaps_and_extents()
218 ret = test_add_free_space_entry(cache, 0, 1 * 1024 * 1024, 0); in test_bitmaps_and_extents()
219 if (ret) { in test_bitmaps_and_extents()
220 test_msg("Couldn't add extent entry %d\n", ret); in test_bitmaps_and_extents()
221 return ret; in test_bitmaps_and_extents()
224 ret = btrfs_remove_free_space(cache, 0, 1 * 1024 * 1024); in test_bitmaps_and_extents()
225 if (ret) { in test_bitmaps_and_extents()
226 test_msg("Couldn't remove extent entry %d\n", ret); in test_bitmaps_and_extents()
227 return ret; in test_bitmaps_and_extents()
236 ret = test_add_free_space_entry(cache, 0, 1 * 1024 * 1024, 0); in test_bitmaps_and_extents()
237 if (ret) { in test_bitmaps_and_extents()
238 test_msg("Couldn't re-add extent entry %d\n", ret); in test_bitmaps_and_extents()
239 return ret; in test_bitmaps_and_extents()
242 ret = btrfs_remove_free_space(cache, 4 * 1024 * 1024, 1 * 1024 * 1024); in test_bitmaps_and_extents()
243 if (ret) { in test_bitmaps_and_extents()
244 test_msg("Couldn't remove from bitmap %d\n", ret); in test_bitmaps_and_extents()
245 return ret; in test_bitmaps_and_extents()
257 ret = test_add_free_space_entry(cache, 1 * 1024 * 1024, 4 * 1024 * 1024, 1); in test_bitmaps_and_extents()
258 if (ret) { in test_bitmaps_and_extents()
259 test_msg("Couldn't add to a bitmap %d\n", ret); in test_bitmaps_and_extents()
260 return ret; in test_bitmaps_and_extents()
263 ret = btrfs_remove_free_space(cache, 512 * 1024, 3 * 1024 * 1024); in test_bitmaps_and_extents()
264 if (ret) { in test_bitmaps_and_extents()
265 test_msg("Couldn't remove overlapping space %d\n", ret); in test_bitmaps_and_extents()
266 return ret; in test_bitmaps_and_extents()
277 ret = test_add_free_space_entry(cache, 4 * 1024 * 1024, 4 * 1024 * 1024, 1); in test_bitmaps_and_extents()
278 if (ret) { in test_bitmaps_and_extents()
279 test_msg("Couldn't add space to the bitmap %d\n", ret); in test_bitmaps_and_extents()
280 return ret; in test_bitmaps_and_extents()
283 ret = test_add_free_space_entry(cache, 2 * 1024 * 1024, 2 * 1024 * 1024, 0); in test_bitmaps_and_extents()
284 if (ret) { in test_bitmaps_and_extents()
285 test_msg("Couldn't add extent to the cache %d\n", ret); in test_bitmaps_and_extents()
286 return ret; in test_bitmaps_and_extents()
289 ret = btrfs_remove_free_space(cache, 3 * 1024 * 1024, 4 * 1024 * 1024); in test_bitmaps_and_extents()
290 if (ret) { in test_bitmaps_and_extents()
291 test_msg("Problem removing overlapping space %d\n", ret); in test_bitmaps_and_extents()
292 return ret; in test_bitmaps_and_extents()
311 ret = test_add_free_space_entry(cache, bitmap_offset + 4 * 1024 * 1024, in test_bitmaps_and_extents()
313 if (ret) { in test_bitmaps_and_extents()
314 test_msg("Couldn't add bitmap %d\n", ret); in test_bitmaps_and_extents()
315 return ret; in test_bitmaps_and_extents()
318 ret = test_add_free_space_entry(cache, bitmap_offset - 1 * 1024 * 1024, in test_bitmaps_and_extents()
320 if (ret) { in test_bitmaps_and_extents()
321 test_msg("Couldn't add extent entry %d\n", ret); in test_bitmaps_and_extents()
322 return ret; in test_bitmaps_and_extents()
325 ret = btrfs_remove_free_space(cache, bitmap_offset + 1 * 1024 * 1024, in test_bitmaps_and_extents()
327 if (ret) { in test_bitmaps_and_extents()
328 test_msg("Failed to free our space %d\n", ret); in test_bitmaps_and_extents()
329 return ret; in test_bitmaps_and_extents()
346 ret = test_add_free_space_entry(cache, 1 * 1024 * 1024, 2 * 1024 * 1024, 1); in test_bitmaps_and_extents()
347 if (ret) { in test_bitmaps_and_extents()
348 test_msg("Couldn't add bitmap entry %d\n", ret); in test_bitmaps_and_extents()
349 return ret; in test_bitmaps_and_extents()
352 ret = test_add_free_space_entry(cache, 3 * 1024 * 1024, 1 * 1024 * 1024, 0); in test_bitmaps_and_extents()
353 if (ret) { in test_bitmaps_and_extents()
354 test_msg("Couldn't add extent entry %d\n", ret); in test_bitmaps_and_extents()
355 return ret; in test_bitmaps_and_extents()
358 ret = btrfs_remove_free_space(cache, 1 * 1024 * 1024, 3 * 1024 * 1024); in test_bitmaps_and_extents()
359 if (ret) { in test_bitmaps_and_extents()
360 test_msg("Error removing bitmap and extent overlapping %d\n", ret); in test_bitmaps_and_extents()
361 return ret; in test_bitmaps_and_extents()
438 int ret; in test_steal_space_from_bitmap_to_extent() local
471 ret = test_add_free_space_entry(cache, 128 * 1024 * 1024 - 256 * 1024, in test_steal_space_from_bitmap_to_extent()
473 if (ret) { in test_steal_space_from_bitmap_to_extent()
474 test_msg("Couldn't add extent entry %d\n", ret); in test_steal_space_from_bitmap_to_extent()
475 return ret; in test_steal_space_from_bitmap_to_extent()
479 ret = test_add_free_space_entry(cache, 128 * 1024 * 1024 + 512 * 1024, in test_steal_space_from_bitmap_to_extent()
481 if (ret) { in test_steal_space_from_bitmap_to_extent()
482 test_msg("Couldn't add bitmap entry %d\n", ret); in test_steal_space_from_bitmap_to_extent()
483 return ret; in test_steal_space_from_bitmap_to_extent()
486 ret = check_num_extents_and_bitmaps(cache, 2, 1); in test_steal_space_from_bitmap_to_extent()
487 if (ret) in test_steal_space_from_bitmap_to_extent()
488 return ret; in test_steal_space_from_bitmap_to_extent()
497 ret = btrfs_remove_free_space(cache, in test_steal_space_from_bitmap_to_extent()
500 if (ret) { in test_steal_space_from_bitmap_to_extent()
501 test_msg("Failed to free part of bitmap space %d\n", ret); in test_steal_space_from_bitmap_to_extent()
502 return ret; in test_steal_space_from_bitmap_to_extent()
552 ret = btrfs_add_free_space(cache, 128 * 1024 * 1024, 512 * 1024); in test_steal_space_from_bitmap_to_extent()
553 if (ret) { in test_steal_space_from_bitmap_to_extent()
554 test_msg("Error adding free space: %d\n", ret); in test_steal_space_from_bitmap_to_extent()
555 return ret; in test_steal_space_from_bitmap_to_extent()
567 ret = check_num_extents_and_bitmaps(cache, 2, 1); in test_steal_space_from_bitmap_to_extent()
568 if (ret) in test_steal_space_from_bitmap_to_extent()
569 return ret; in test_steal_space_from_bitmap_to_extent()
577 ret = btrfs_add_free_space(cache, 128 * 1024 * 1024 + 16 * 1024 * 1024, in test_steal_space_from_bitmap_to_extent()
579 if (ret) { in test_steal_space_from_bitmap_to_extent()
580 test_msg("Error adding free space: %d\n", ret); in test_steal_space_from_bitmap_to_extent()
581 return ret; in test_steal_space_from_bitmap_to_extent()
588 ret = check_num_extents_and_bitmaps(cache, 2, 1); in test_steal_space_from_bitmap_to_extent()
589 if (ret) in test_steal_space_from_bitmap_to_extent()
590 return ret; in test_steal_space_from_bitmap_to_extent()
597 ret = btrfs_add_free_space(cache, 128 * 1024 * 1024 - 128 * 1024, in test_steal_space_from_bitmap_to_extent()
599 if (ret) { in test_steal_space_from_bitmap_to_extent()
600 test_msg("Error adding free space: %d\n", ret); in test_steal_space_from_bitmap_to_extent()
601 return ret; in test_steal_space_from_bitmap_to_extent()
614 ret = check_num_extents_and_bitmaps(cache, 2, 1); in test_steal_space_from_bitmap_to_extent()
615 if (ret) in test_steal_space_from_bitmap_to_extent()
616 return ret; in test_steal_space_from_bitmap_to_extent()
654 ret = check_num_extents_and_bitmaps(cache, 1, 1); in test_steal_space_from_bitmap_to_extent()
655 if (ret) in test_steal_space_from_bitmap_to_extent()
656 return ret; in test_steal_space_from_bitmap_to_extent()
672 ret = check_cache_empty(cache); in test_steal_space_from_bitmap_to_extent()
673 if (ret) in test_steal_space_from_bitmap_to_extent()
674 return ret; in test_steal_space_from_bitmap_to_extent()
687 ret = test_add_free_space_entry(cache, 128 * 1024 * 1024 + 128 * 1024, in test_steal_space_from_bitmap_to_extent()
689 if (ret) { in test_steal_space_from_bitmap_to_extent()
690 test_msg("Couldn't add extent entry %d\n", ret); in test_steal_space_from_bitmap_to_extent()
691 return ret; in test_steal_space_from_bitmap_to_extent()
695 ret = test_add_free_space_entry(cache, 0, in test_steal_space_from_bitmap_to_extent()
697 if (ret) { in test_steal_space_from_bitmap_to_extent()
698 test_msg("Couldn't add bitmap entry %d\n", ret); in test_steal_space_from_bitmap_to_extent()
699 return ret; in test_steal_space_from_bitmap_to_extent()
702 ret = check_num_extents_and_bitmaps(cache, 2, 1); in test_steal_space_from_bitmap_to_extent()
703 if (ret) in test_steal_space_from_bitmap_to_extent()
704 return ret; in test_steal_space_from_bitmap_to_extent()
713 ret = btrfs_remove_free_space(cache, in test_steal_space_from_bitmap_to_extent()
716 if (ret) { in test_steal_space_from_bitmap_to_extent()
717 test_msg("Failed to free part of bitmap space %d\n", ret); in test_steal_space_from_bitmap_to_extent()
718 return ret; in test_steal_space_from_bitmap_to_extent()
758 ret = btrfs_add_free_space(cache, 128 * 1024 * 1024 - 512 * 1024, in test_steal_space_from_bitmap_to_extent()
760 if (ret) { in test_steal_space_from_bitmap_to_extent()
761 test_msg("Error adding free space: %d\n", ret); in test_steal_space_from_bitmap_to_extent()
762 return ret; in test_steal_space_from_bitmap_to_extent()
775 ret = check_num_extents_and_bitmaps(cache, 2, 1); in test_steal_space_from_bitmap_to_extent()
776 if (ret) in test_steal_space_from_bitmap_to_extent()
777 return ret; in test_steal_space_from_bitmap_to_extent()
785 ret = btrfs_add_free_space(cache, 32 * 1024 * 1024, 8192); in test_steal_space_from_bitmap_to_extent()
786 if (ret) { in test_steal_space_from_bitmap_to_extent()
787 test_msg("Error adding free space: %d\n", ret); in test_steal_space_from_bitmap_to_extent()
788 return ret; in test_steal_space_from_bitmap_to_extent()
796 ret = btrfs_add_free_space(cache, 128 * 1024 * 1024, 128 * 1024); in test_steal_space_from_bitmap_to_extent()
797 if (ret) { in test_steal_space_from_bitmap_to_extent()
798 test_msg("Error adding free space: %d\n", ret); in test_steal_space_from_bitmap_to_extent()
799 return ret; in test_steal_space_from_bitmap_to_extent()
811 ret = check_num_extents_and_bitmaps(cache, 2, 1); in test_steal_space_from_bitmap_to_extent()
812 if (ret) in test_steal_space_from_bitmap_to_extent()
813 return ret; in test_steal_space_from_bitmap_to_extent()
851 ret = check_num_extents_and_bitmaps(cache, 1, 1); in test_steal_space_from_bitmap_to_extent()
852 if (ret) in test_steal_space_from_bitmap_to_extent()
853 return ret; in test_steal_space_from_bitmap_to_extent()
869 ret = check_cache_empty(cache); in test_steal_space_from_bitmap_to_extent()
870 if (ret) in test_steal_space_from_bitmap_to_extent()
871 return ret; in test_steal_space_from_bitmap_to_extent()
882 int ret; in btrfs_test_free_space_cache() local
892 ret = test_extents(cache); in btrfs_test_free_space_cache()
893 if (ret) in btrfs_test_free_space_cache()
895 ret = test_bitmaps(cache); in btrfs_test_free_space_cache()
896 if (ret) in btrfs_test_free_space_cache()
898 ret = test_bitmaps_and_extents(cache); in btrfs_test_free_space_cache()
899 if (ret) in btrfs_test_free_space_cache()
902 ret = test_steal_space_from_bitmap_to_extent(cache); in btrfs_test_free_space_cache()
908 return ret; in btrfs_test_free_space_cache()