Lines Matching refs:ret
25 int ret; in insert_normal_tree_ref() local
39 ret = btrfs_insert_empty_item(&trans, root, path, &ins, size); in insert_normal_tree_ref()
40 if (ret) { in insert_normal_tree_ref()
41 test_err("couldn't insert ref %d", ret); in insert_normal_tree_ref()
43 return ret; in insert_normal_tree_ref()
74 int ret; in add_tree_ref() local
88 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in add_tree_ref()
89 if (ret) { in add_tree_ref()
92 return ret; in add_tree_ref()
110 ret = btrfs_insert_empty_item(&trans, root, path, &key, 0); in add_tree_ref()
111 if (ret) in add_tree_ref()
114 return ret; in add_tree_ref()
123 int ret; in remove_extent_item() local
137 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_item()
138 if (ret) { in remove_extent_item()
139 test_err("didn't find our key %d", ret); in remove_extent_item()
141 return ret; in remove_extent_item()
156 int ret; in remove_extent_ref() local
170 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in remove_extent_ref()
171 if (ret) { in remove_extent_ref()
174 return ret; in remove_extent_ref()
192 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_ref()
193 if (ret) { in remove_extent_ref()
194 test_err("couldn't find backref %d", ret); in remove_extent_ref()
196 return ret; in remove_extent_ref()
200 return ret; in remove_extent_ref()
210 int ret; in test_no_shared_qgroup() local
215 ret = btrfs_create_qgroup(&trans, BTRFS_FS_TREE_OBJECTID); in test_no_shared_qgroup()
216 if (ret) { in test_no_shared_qgroup()
217 test_err("couldn't create a qgroup %d", ret); in test_no_shared_qgroup()
218 return ret; in test_no_shared_qgroup()
226 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false); in test_no_shared_qgroup()
227 if (ret) { in test_no_shared_qgroup()
228 test_err("couldn't find old roots: %d", ret); in test_no_shared_qgroup()
229 return ret; in test_no_shared_qgroup()
232 ret = insert_normal_tree_ref(root, nodesize, nodesize, 0, in test_no_shared_qgroup()
234 if (ret) { in test_no_shared_qgroup()
236 return ret; in test_no_shared_qgroup()
239 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false); in test_no_shared_qgroup()
240 if (ret) { in test_no_shared_qgroup()
242 test_err("couldn't find old roots: %d", ret); in test_no_shared_qgroup()
243 return ret; in test_no_shared_qgroup()
246 ret = btrfs_qgroup_account_extent(&trans, nodesize, nodesize, old_roots, in test_no_shared_qgroup()
248 if (ret) { in test_no_shared_qgroup()
249 test_err("couldn't account space for a qgroup %d", ret); in test_no_shared_qgroup()
250 return ret; in test_no_shared_qgroup()
263 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false); in test_no_shared_qgroup()
264 if (ret) { in test_no_shared_qgroup()
265 test_err("couldn't find old roots: %d", ret); in test_no_shared_qgroup()
266 return ret; in test_no_shared_qgroup()
269 ret = remove_extent_item(root, nodesize, nodesize); in test_no_shared_qgroup()
270 if (ret) { in test_no_shared_qgroup()
275 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false); in test_no_shared_qgroup()
276 if (ret) { in test_no_shared_qgroup()
278 test_err("couldn't find old roots: %d", ret); in test_no_shared_qgroup()
279 return ret; in test_no_shared_qgroup()
282 ret = btrfs_qgroup_account_extent(&trans, nodesize, nodesize, old_roots, in test_no_shared_qgroup()
284 if (ret) { in test_no_shared_qgroup()
285 test_err("couldn't account space for a qgroup %d", ret); in test_no_shared_qgroup()
309 int ret; in test_multiple_refs() local
319 ret = btrfs_create_qgroup(&trans, BTRFS_FIRST_FREE_OBJECTID); in test_multiple_refs()
320 if (ret) { in test_multiple_refs()
321 test_err("couldn't create a qgroup %d", ret); in test_multiple_refs()
322 return ret; in test_multiple_refs()
325 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false); in test_multiple_refs()
326 if (ret) { in test_multiple_refs()
327 test_err("couldn't find old roots: %d", ret); in test_multiple_refs()
328 return ret; in test_multiple_refs()
331 ret = insert_normal_tree_ref(root, nodesize, nodesize, 0, in test_multiple_refs()
333 if (ret) { in test_multiple_refs()
335 return ret; in test_multiple_refs()
338 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false); in test_multiple_refs()
339 if (ret) { in test_multiple_refs()
341 test_err("couldn't find old roots: %d", ret); in test_multiple_refs()
342 return ret; in test_multiple_refs()
345 ret = btrfs_qgroup_account_extent(&trans, nodesize, nodesize, old_roots, in test_multiple_refs()
347 if (ret) { in test_multiple_refs()
348 test_err("couldn't account space for a qgroup %d", ret); in test_multiple_refs()
349 return ret; in test_multiple_refs()
358 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false); in test_multiple_refs()
359 if (ret) { in test_multiple_refs()
360 test_err("couldn't find old roots: %d", ret); in test_multiple_refs()
361 return ret; in test_multiple_refs()
364 ret = add_tree_ref(root, nodesize, nodesize, 0, in test_multiple_refs()
366 if (ret) { in test_multiple_refs()
368 return ret; in test_multiple_refs()
371 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false); in test_multiple_refs()
372 if (ret) { in test_multiple_refs()
374 test_err("couldn't find old roots: %d", ret); in test_multiple_refs()
375 return ret; in test_multiple_refs()
378 ret = btrfs_qgroup_account_extent(&trans, nodesize, nodesize, old_roots, in test_multiple_refs()
380 if (ret) { in test_multiple_refs()
381 test_err("couldn't account space for a qgroup %d", ret); in test_multiple_refs()
382 return ret; in test_multiple_refs()
397 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots, false); in test_multiple_refs()
398 if (ret) { in test_multiple_refs()
399 test_err("couldn't find old roots: %d", ret); in test_multiple_refs()
400 return ret; in test_multiple_refs()
403 ret = remove_extent_ref(root, nodesize, nodesize, 0, in test_multiple_refs()
405 if (ret) { in test_multiple_refs()
407 return ret; in test_multiple_refs()
410 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots, false); in test_multiple_refs()
411 if (ret) { in test_multiple_refs()
413 test_err("couldn't find old roots: %d", ret); in test_multiple_refs()
414 return ret; in test_multiple_refs()
417 ret = btrfs_qgroup_account_extent(&trans, nodesize, nodesize, old_roots, in test_multiple_refs()
419 if (ret) { in test_multiple_refs()
420 test_err("couldn't account space for a qgroup %d", ret); in test_multiple_refs()
421 return ret; in test_multiple_refs()
444 int ret = 0; in btrfs_test_qgroups() local
455 ret = PTR_ERR(root); in btrfs_test_qgroups()
477 ret = PTR_ERR(root->node); in btrfs_test_qgroups()
487 ret = PTR_ERR(tmp_root); in btrfs_test_qgroups()
493 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); in btrfs_test_qgroups()
494 if (ret) { in btrfs_test_qgroups()
495 test_err("couldn't insert fs root %d", ret); in btrfs_test_qgroups()
503 ret = PTR_ERR(tmp_root); in btrfs_test_qgroups()
508 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); in btrfs_test_qgroups()
509 if (ret) { in btrfs_test_qgroups()
510 test_err("couldn't insert fs root %d", ret); in btrfs_test_qgroups()
516 ret = test_no_shared_qgroup(root, sectorsize, nodesize); in btrfs_test_qgroups()
517 if (ret) in btrfs_test_qgroups()
519 ret = test_multiple_refs(root, sectorsize, nodesize); in btrfs_test_qgroups()
523 return ret; in btrfs_test_qgroups()