Lines Matching refs:ret

45 	int ret;  in insert_normal_tree_ref()  local
60 ret = btrfs_insert_empty_item(&trans, root, path, &ins, size); in insert_normal_tree_ref()
61 if (ret) { in insert_normal_tree_ref()
62 test_msg("Couldn't insert ref %d\n", ret); in insert_normal_tree_ref()
64 return ret; in insert_normal_tree_ref()
95 int ret; in add_tree_ref() local
110 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in add_tree_ref()
111 if (ret) { in add_tree_ref()
114 return ret; in add_tree_ref()
132 ret = btrfs_insert_empty_item(&trans, root, path, &key, 0); in add_tree_ref()
133 if (ret) in add_tree_ref()
136 return ret; in add_tree_ref()
145 int ret; in remove_extent_item() local
160 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_item()
161 if (ret) { in remove_extent_item()
162 test_msg("Didn't find our key %d\n", ret); in remove_extent_item()
164 return ret; in remove_extent_item()
179 int ret; in remove_extent_ref() local
194 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in remove_extent_ref()
195 if (ret) { in remove_extent_ref()
198 return ret; in remove_extent_ref()
216 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_ref()
217 if (ret) { in remove_extent_ref()
218 test_msg("Couldn't find backref %d\n", ret); in remove_extent_ref()
220 return ret; in remove_extent_ref()
224 return ret; in remove_extent_ref()
233 int ret; in test_no_shared_qgroup() local
238 ret = btrfs_create_qgroup(NULL, fs_info, 5); in test_no_shared_qgroup()
239 if (ret) { in test_no_shared_qgroup()
240 test_msg("Couldn't create a qgroup %d\n", ret); in test_no_shared_qgroup()
241 return ret; in test_no_shared_qgroup()
249 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &old_roots); in test_no_shared_qgroup()
250 if (ret) { in test_no_shared_qgroup()
252 test_msg("Couldn't find old roots: %d\n", ret); in test_no_shared_qgroup()
253 return ret; in test_no_shared_qgroup()
256 ret = insert_normal_tree_ref(root, 4096, 4096, 0, 5); in test_no_shared_qgroup()
257 if (ret) in test_no_shared_qgroup()
258 return ret; in test_no_shared_qgroup()
260 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &new_roots); in test_no_shared_qgroup()
261 if (ret) { in test_no_shared_qgroup()
264 test_msg("Couldn't find old roots: %d\n", ret); in test_no_shared_qgroup()
265 return ret; in test_no_shared_qgroup()
268 ret = btrfs_qgroup_account_extent(&trans, fs_info, 4096, 4096, in test_no_shared_qgroup()
270 if (ret) { in test_no_shared_qgroup()
271 test_msg("Couldn't account space for a qgroup %d\n", ret); in test_no_shared_qgroup()
272 return ret; in test_no_shared_qgroup()
282 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &old_roots); in test_no_shared_qgroup()
283 if (ret) { in test_no_shared_qgroup()
285 test_msg("Couldn't find old roots: %d\n", ret); in test_no_shared_qgroup()
286 return ret; in test_no_shared_qgroup()
289 ret = remove_extent_item(root, 4096, 4096); in test_no_shared_qgroup()
290 if (ret) in test_no_shared_qgroup()
293 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &new_roots); in test_no_shared_qgroup()
294 if (ret) { in test_no_shared_qgroup()
297 test_msg("Couldn't find old roots: %d\n", ret); in test_no_shared_qgroup()
298 return ret; in test_no_shared_qgroup()
301 ret = btrfs_qgroup_account_extent(&trans, fs_info, 4096, 4096, in test_no_shared_qgroup()
303 if (ret) { in test_no_shared_qgroup()
304 test_msg("Couldn't account space for a qgroup %d\n", ret); in test_no_shared_qgroup()
327 int ret; in test_multiple_refs() local
334 ret = btrfs_create_qgroup(NULL, fs_info, 256); in test_multiple_refs()
335 if (ret) { in test_multiple_refs()
336 test_msg("Couldn't create a qgroup %d\n", ret); in test_multiple_refs()
337 return ret; in test_multiple_refs()
340 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &old_roots); in test_multiple_refs()
341 if (ret) { in test_multiple_refs()
343 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
344 return ret; in test_multiple_refs()
347 ret = insert_normal_tree_ref(root, 4096, 4096, 0, 5); in test_multiple_refs()
348 if (ret) in test_multiple_refs()
349 return ret; in test_multiple_refs()
351 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &new_roots); in test_multiple_refs()
352 if (ret) { in test_multiple_refs()
355 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
356 return ret; in test_multiple_refs()
359 ret = btrfs_qgroup_account_extent(&trans, fs_info, 4096, 4096, in test_multiple_refs()
361 if (ret) { in test_multiple_refs()
362 test_msg("Couldn't account space for a qgroup %d\n", ret); in test_multiple_refs()
363 return ret; in test_multiple_refs()
371 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &old_roots); in test_multiple_refs()
372 if (ret) { in test_multiple_refs()
374 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
375 return ret; in test_multiple_refs()
378 ret = add_tree_ref(root, 4096, 4096, 0, 256); in test_multiple_refs()
379 if (ret) in test_multiple_refs()
380 return ret; in test_multiple_refs()
382 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &new_roots); in test_multiple_refs()
383 if (ret) { in test_multiple_refs()
386 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
387 return ret; in test_multiple_refs()
390 ret = btrfs_qgroup_account_extent(&trans, fs_info, 4096, 4096, in test_multiple_refs()
392 if (ret) { in test_multiple_refs()
393 test_msg("Couldn't account space for a qgroup %d\n", ret); in test_multiple_refs()
394 return ret; in test_multiple_refs()
407 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &old_roots); in test_multiple_refs()
408 if (ret) { in test_multiple_refs()
410 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
411 return ret; in test_multiple_refs()
414 ret = remove_extent_ref(root, 4096, 4096, 0, 256); in test_multiple_refs()
415 if (ret) in test_multiple_refs()
416 return ret; in test_multiple_refs()
418 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &new_roots); in test_multiple_refs()
419 if (ret) { in test_multiple_refs()
422 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
423 return ret; in test_multiple_refs()
426 ret = btrfs_qgroup_account_extent(&trans, fs_info, 4096, 4096, in test_multiple_refs()
428 if (ret) { in test_multiple_refs()
429 test_msg("Couldn't account space for a qgroup %d\n", ret); in test_multiple_refs()
430 return ret; in test_multiple_refs()
450 int ret = 0; in btrfs_test_qgroups() local
461 ret = -ENOMEM; in btrfs_test_qgroups()
482 ret = -ENOMEM; in btrfs_test_qgroups()
492 ret = PTR_ERR(tmp_root); in btrfs_test_qgroups()
498 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); in btrfs_test_qgroups()
499 if (ret) { in btrfs_test_qgroups()
500 test_msg("Couldn't insert fs root %d\n", ret); in btrfs_test_qgroups()
507 ret = PTR_ERR(tmp_root); in btrfs_test_qgroups()
512 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); in btrfs_test_qgroups()
513 if (ret) { in btrfs_test_qgroups()
514 test_msg("Couldn't insert fs root %d\n", ret); in btrfs_test_qgroups()
519 ret = test_no_shared_qgroup(root); in btrfs_test_qgroups()
520 if (ret) in btrfs_test_qgroups()
522 ret = test_multiple_refs(root); in btrfs_test_qgroups()
525 return ret; in btrfs_test_qgroups()