Lines Matching refs:ret
44 int ret; in insert_normal_tree_ref() local
59 ret = btrfs_insert_empty_item(&trans, root, path, &ins, size); in insert_normal_tree_ref()
60 if (ret) { in insert_normal_tree_ref()
61 test_msg("Couldn't insert ref %d\n", ret); in insert_normal_tree_ref()
63 return ret; in insert_normal_tree_ref()
94 int ret; in add_tree_ref() local
109 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in add_tree_ref()
110 if (ret) { in add_tree_ref()
113 return ret; in add_tree_ref()
131 ret = btrfs_insert_empty_item(&trans, root, path, &key, 0); in add_tree_ref()
132 if (ret) in add_tree_ref()
135 return ret; in add_tree_ref()
144 int ret; in remove_extent_item() local
159 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_item()
160 if (ret) { in remove_extent_item()
161 test_msg("Didn't find our key %d\n", ret); in remove_extent_item()
163 return ret; in remove_extent_item()
178 int ret; in remove_extent_ref() local
193 ret = btrfs_search_slot(&trans, root, &key, path, 0, 1); in remove_extent_ref()
194 if (ret) { in remove_extent_ref()
197 return ret; in remove_extent_ref()
215 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); in remove_extent_ref()
216 if (ret) { in remove_extent_ref()
217 test_msg("Couldn't find backref %d\n", ret); in remove_extent_ref()
219 return ret; in remove_extent_ref()
223 return ret; in remove_extent_ref()
230 int ret; in test_no_shared_qgroup() local
235 ret = btrfs_create_qgroup(NULL, fs_info, 5); in test_no_shared_qgroup()
236 if (ret) { in test_no_shared_qgroup()
237 test_msg("Couldn't create a qgroup %d\n", ret); in test_no_shared_qgroup()
238 return ret; in test_no_shared_qgroup()
241 ret = btrfs_qgroup_record_ref(&trans, fs_info, 5, 4096, 4096, in test_no_shared_qgroup()
243 if (ret) { in test_no_shared_qgroup()
244 test_msg("Couldn't add space to a qgroup %d\n", ret); in test_no_shared_qgroup()
245 return ret; in test_no_shared_qgroup()
248 ret = insert_normal_tree_ref(root, 4096, 4096, 0, 5); in test_no_shared_qgroup()
249 if (ret) in test_no_shared_qgroup()
250 return ret; in test_no_shared_qgroup()
252 ret = btrfs_delayed_qgroup_accounting(&trans, fs_info); in test_no_shared_qgroup()
253 if (ret) { in test_no_shared_qgroup()
254 test_msg("Delayed qgroup accounting failed %d\n", ret); in test_no_shared_qgroup()
255 return ret; in test_no_shared_qgroup()
263 ret = remove_extent_item(root, 4096, 4096); in test_no_shared_qgroup()
264 if (ret) in test_no_shared_qgroup()
267 ret = btrfs_qgroup_record_ref(&trans, fs_info, 5, 4096, 4096, in test_no_shared_qgroup()
269 if (ret) { in test_no_shared_qgroup()
270 test_msg("Couldn't remove space from the qgroup %d\n", ret); in test_no_shared_qgroup()
274 ret = btrfs_delayed_qgroup_accounting(&trans, fs_info); in test_no_shared_qgroup()
275 if (ret) { in test_no_shared_qgroup()
276 test_msg("Qgroup accounting failed %d\n", ret); in test_no_shared_qgroup()
297 int ret; in test_multiple_refs() local
304 ret = btrfs_create_qgroup(NULL, fs_info, 256); in test_multiple_refs()
305 if (ret) { in test_multiple_refs()
306 test_msg("Couldn't create a qgroup %d\n", ret); in test_multiple_refs()
307 return ret; in test_multiple_refs()
310 ret = insert_normal_tree_ref(root, 4096, 4096, 0, 5); in test_multiple_refs()
311 if (ret) in test_multiple_refs()
312 return ret; in test_multiple_refs()
314 ret = btrfs_qgroup_record_ref(&trans, fs_info, 5, 4096, 4096, in test_multiple_refs()
316 if (ret) { in test_multiple_refs()
317 test_msg("Couldn't add space to a qgroup %d\n", ret); in test_multiple_refs()
318 return ret; in test_multiple_refs()
321 ret = btrfs_delayed_qgroup_accounting(&trans, fs_info); in test_multiple_refs()
322 if (ret) { in test_multiple_refs()
323 test_msg("Delayed qgroup accounting failed %d\n", ret); in test_multiple_refs()
324 return ret; in test_multiple_refs()
332 ret = add_tree_ref(root, 4096, 4096, 0, 256); in test_multiple_refs()
333 if (ret) in test_multiple_refs()
334 return ret; in test_multiple_refs()
336 ret = btrfs_qgroup_record_ref(&trans, fs_info, 256, 4096, 4096, in test_multiple_refs()
338 if (ret) { in test_multiple_refs()
339 test_msg("Qgroup record ref failed %d\n", ret); in test_multiple_refs()
340 return ret; in test_multiple_refs()
343 ret = btrfs_delayed_qgroup_accounting(&trans, fs_info); in test_multiple_refs()
344 if (ret) { in test_multiple_refs()
345 test_msg("Qgroup accounting failed %d\n", ret); in test_multiple_refs()
346 return ret; in test_multiple_refs()
359 ret = remove_extent_ref(root, 4096, 4096, 0, 256); in test_multiple_refs()
360 if (ret) in test_multiple_refs()
361 return ret; in test_multiple_refs()
363 ret = btrfs_qgroup_record_ref(&trans, fs_info, 256, 4096, 4096, in test_multiple_refs()
365 if (ret) { in test_multiple_refs()
366 test_msg("Qgroup record ref failed %d\n", ret); in test_multiple_refs()
367 return ret; in test_multiple_refs()
370 ret = btrfs_delayed_qgroup_accounting(&trans, fs_info); in test_multiple_refs()
371 if (ret) { in test_multiple_refs()
372 test_msg("Qgroup accounting failed %d\n", ret); in test_multiple_refs()
373 return ret; in test_multiple_refs()
393 int ret = 0; in btrfs_test_qgroups() local
404 ret = -ENOMEM; in btrfs_test_qgroups()
425 ret = -ENOMEM; in btrfs_test_qgroups()
435 ret = PTR_ERR(tmp_root); in btrfs_test_qgroups()
441 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); in btrfs_test_qgroups()
442 if (ret) { in btrfs_test_qgroups()
443 test_msg("Couldn't insert fs root %d\n", ret); in btrfs_test_qgroups()
450 ret = PTR_ERR(tmp_root); in btrfs_test_qgroups()
455 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); in btrfs_test_qgroups()
456 if (ret) { in btrfs_test_qgroups()
457 test_msg("Couldn't insert fs root %d\n", ret); in btrfs_test_qgroups()
462 ret = test_no_shared_qgroup(root); in btrfs_test_qgroups()
463 if (ret) in btrfs_test_qgroups()
465 ret = test_multiple_refs(root); in btrfs_test_qgroups()
468 return ret; in btrfs_test_qgroups()