Lines Matching refs:ret
38 int ret; in insert_normal_tree_ref() local
53 ret = btrfs_insert_empty_item(&trans, root, path, &ins, size); in insert_normal_tree_ref()
54 if (ret) { in insert_normal_tree_ref()
55 test_msg("Couldn't insert ref %d\n", ret); in insert_normal_tree_ref()
57 return ret; in insert_normal_tree_ref()
88 int ret; in add_tree_ref() local
103 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in add_tree_ref()
104 if (ret) { in add_tree_ref()
107 return ret; in add_tree_ref()
125 ret = btrfs_insert_empty_item(&trans, root, path, &key, 0); in add_tree_ref()
126 if (ret) in add_tree_ref()
129 return ret; in add_tree_ref()
138 int ret; in remove_extent_item() local
153 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_item()
154 if (ret) { in remove_extent_item()
155 test_msg("Didn't find our key %d\n", ret); in remove_extent_item()
157 return ret; in remove_extent_item()
172 int ret; in remove_extent_ref() local
187 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in remove_extent_ref()
188 if (ret) { in remove_extent_ref()
191 return ret; in remove_extent_ref()
209 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_ref()
210 if (ret) { in remove_extent_ref()
211 test_msg("Couldn't find backref %d\n", ret); in remove_extent_ref()
213 return ret; in remove_extent_ref()
217 return ret; in remove_extent_ref()
227 int ret; in test_no_shared_qgroup() local
232 ret = btrfs_create_qgroup(NULL, fs_info, BTRFS_FS_TREE_OBJECTID); in test_no_shared_qgroup()
233 if (ret) { in test_no_shared_qgroup()
234 test_msg("Couldn't create a qgroup %d\n", ret); in test_no_shared_qgroup()
235 return ret; in test_no_shared_qgroup()
243 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots); in test_no_shared_qgroup()
244 if (ret) { in test_no_shared_qgroup()
246 test_msg("Couldn't find old roots: %d\n", ret); in test_no_shared_qgroup()
247 return ret; in test_no_shared_qgroup()
250 ret = insert_normal_tree_ref(root, nodesize, nodesize, 0, in test_no_shared_qgroup()
252 if (ret) in test_no_shared_qgroup()
253 return ret; in test_no_shared_qgroup()
255 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots); in test_no_shared_qgroup()
256 if (ret) { in test_no_shared_qgroup()
259 test_msg("Couldn't find old roots: %d\n", ret); in test_no_shared_qgroup()
260 return ret; in test_no_shared_qgroup()
263 ret = btrfs_qgroup_account_extent(&trans, fs_info, nodesize, in test_no_shared_qgroup()
265 if (ret) { in test_no_shared_qgroup()
266 test_msg("Couldn't account space for a qgroup %d\n", ret); in test_no_shared_qgroup()
267 return ret; in test_no_shared_qgroup()
278 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots); in test_no_shared_qgroup()
279 if (ret) { in test_no_shared_qgroup()
281 test_msg("Couldn't find old roots: %d\n", ret); in test_no_shared_qgroup()
282 return ret; in test_no_shared_qgroup()
285 ret = remove_extent_item(root, nodesize, nodesize); in test_no_shared_qgroup()
286 if (ret) in test_no_shared_qgroup()
289 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots); in test_no_shared_qgroup()
290 if (ret) { in test_no_shared_qgroup()
293 test_msg("Couldn't find old roots: %d\n", ret); in test_no_shared_qgroup()
294 return ret; in test_no_shared_qgroup()
297 ret = btrfs_qgroup_account_extent(&trans, fs_info, nodesize, in test_no_shared_qgroup()
299 if (ret) { in test_no_shared_qgroup()
300 test_msg("Couldn't account space for a qgroup %d\n", ret); in test_no_shared_qgroup()
324 int ret; in test_multiple_refs() local
334 ret = btrfs_create_qgroup(NULL, fs_info, BTRFS_FIRST_FREE_OBJECTID); 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, nodesize, 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, nodesize, nodesize, 0, in test_multiple_refs()
349 if (ret) in test_multiple_refs()
350 return ret; in test_multiple_refs()
352 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots); in test_multiple_refs()
353 if (ret) { in test_multiple_refs()
356 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
357 return ret; in test_multiple_refs()
360 ret = btrfs_qgroup_account_extent(&trans, fs_info, nodesize, in test_multiple_refs()
362 if (ret) { in test_multiple_refs()
363 test_msg("Couldn't account space for a qgroup %d\n", ret); in test_multiple_refs()
364 return ret; in test_multiple_refs()
373 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots); in test_multiple_refs()
374 if (ret) { in test_multiple_refs()
376 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
377 return ret; in test_multiple_refs()
380 ret = add_tree_ref(root, nodesize, nodesize, 0, in test_multiple_refs()
382 if (ret) in test_multiple_refs()
383 return ret; in test_multiple_refs()
385 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots); in test_multiple_refs()
386 if (ret) { in test_multiple_refs()
389 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
390 return ret; in test_multiple_refs()
393 ret = btrfs_qgroup_account_extent(&trans, fs_info, nodesize, in test_multiple_refs()
395 if (ret) { in test_multiple_refs()
396 test_msg("Couldn't account space for a qgroup %d\n", ret); in test_multiple_refs()
397 return ret; in test_multiple_refs()
412 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &old_roots); in test_multiple_refs()
413 if (ret) { in test_multiple_refs()
415 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
416 return ret; in test_multiple_refs()
419 ret = remove_extent_ref(root, nodesize, nodesize, 0, in test_multiple_refs()
421 if (ret) in test_multiple_refs()
422 return ret; in test_multiple_refs()
424 ret = btrfs_find_all_roots(&trans, fs_info, nodesize, 0, &new_roots); in test_multiple_refs()
425 if (ret) { in test_multiple_refs()
428 test_msg("Couldn't find old roots: %d\n", ret); in test_multiple_refs()
429 return ret; in test_multiple_refs()
432 ret = btrfs_qgroup_account_extent(&trans, fs_info, nodesize, in test_multiple_refs()
434 if (ret) { in test_multiple_refs()
435 test_msg("Couldn't account space for a qgroup %d\n", ret); in test_multiple_refs()
436 return ret; in test_multiple_refs()
459 int ret = 0; in btrfs_test_qgroups() local
470 ret = PTR_ERR(root); in btrfs_test_qgroups()
493 ret = -ENOMEM; in btrfs_test_qgroups()
503 ret = PTR_ERR(tmp_root); in btrfs_test_qgroups()
509 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); in btrfs_test_qgroups()
510 if (ret) { in btrfs_test_qgroups()
511 test_msg("Couldn't insert fs root %d\n", ret); in btrfs_test_qgroups()
518 ret = PTR_ERR(tmp_root); in btrfs_test_qgroups()
523 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); in btrfs_test_qgroups()
524 if (ret) { in btrfs_test_qgroups()
525 test_msg("Couldn't insert fs root %d\n", ret); in btrfs_test_qgroups()
530 ret = test_no_shared_qgroup(root, sectorsize, nodesize); in btrfs_test_qgroups()
531 if (ret) in btrfs_test_qgroups()
533 ret = test_multiple_refs(root, sectorsize, nodesize); in btrfs_test_qgroups()
537 return ret; in btrfs_test_qgroups()