Lines Matching refs:error
113 int error; in xfs_refcount_get_rec() local
116 error = xfs_btree_get_rec(cur, &rec, stat); in xfs_refcount_get_rec()
117 if (error || !*stat) in xfs_refcount_get_rec()
118 return error; in xfs_refcount_get_rec()
170 int error; in xfs_refcount_update() local
176 error = xfs_btree_update(cur, &rec); in xfs_refcount_update()
177 if (error) in xfs_refcount_update()
179 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_update()
180 return error; in xfs_refcount_update()
194 int error; in xfs_refcount_insert() local
200 error = xfs_btree_insert(cur, i); in xfs_refcount_insert()
201 if (error) in xfs_refcount_insert()
206 if (error) in xfs_refcount_insert()
208 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_insert()
209 return error; in xfs_refcount_insert()
225 int error; in xfs_refcount_delete() local
227 error = xfs_refcount_get_rec(cur, &irec, &found_rec); in xfs_refcount_delete()
228 if (error) in xfs_refcount_delete()
232 error = xfs_btree_delete(cur, i); in xfs_refcount_delete()
234 if (error) in xfs_refcount_delete()
236 error = xfs_refcount_lookup_ge(cur, irec.rc_startblock, &found_rec); in xfs_refcount_delete()
238 if (error) in xfs_refcount_delete()
240 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_delete()
241 return error; in xfs_refcount_delete()
340 int error; in xfs_refcount_split_extent() local
343 error = xfs_refcount_lookup_le(cur, agbno, &found_rec); in xfs_refcount_split_extent()
344 if (error) in xfs_refcount_split_extent()
349 error = xfs_refcount_get_rec(cur, &rcext, &found_rec); in xfs_refcount_split_extent()
350 if (error) in xfs_refcount_split_extent()
364 error = xfs_refcount_update(cur, &tmp); in xfs_refcount_split_extent()
365 if (error) in xfs_refcount_split_extent()
371 error = xfs_refcount_insert(cur, &tmp, &found_rec); in xfs_refcount_split_extent()
372 if (error) in xfs_refcount_split_extent()
375 return error; in xfs_refcount_split_extent()
379 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_split_extent()
380 return error; in xfs_refcount_split_extent()
395 int error; in xfs_refcount_merge_center_extents() local
409 error = xfs_refcount_lookup_ge(cur, center->rc_startblock, in xfs_refcount_merge_center_extents()
411 if (error) in xfs_refcount_merge_center_extents()
415 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_center_extents()
416 if (error) in xfs_refcount_merge_center_extents()
421 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_center_extents()
422 if (error) in xfs_refcount_merge_center_extents()
429 error = xfs_refcount_lookup_le(cur, left->rc_startblock, in xfs_refcount_merge_center_extents()
431 if (error) in xfs_refcount_merge_center_extents()
436 error = xfs_refcount_update(cur, left); in xfs_refcount_merge_center_extents()
437 if (error) in xfs_refcount_merge_center_extents()
441 return error; in xfs_refcount_merge_center_extents()
445 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_merge_center_extents()
446 return error; in xfs_refcount_merge_center_extents()
460 int error; in xfs_refcount_merge_left_extent() local
468 error = xfs_refcount_lookup_le(cur, cleft->rc_startblock, in xfs_refcount_merge_left_extent()
470 if (error) in xfs_refcount_merge_left_extent()
475 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_left_extent()
476 if (error) in xfs_refcount_merge_left_extent()
483 error = xfs_refcount_lookup_le(cur, left->rc_startblock, in xfs_refcount_merge_left_extent()
485 if (error) in xfs_refcount_merge_left_extent()
490 error = xfs_refcount_update(cur, left); in xfs_refcount_merge_left_extent()
491 if (error) in xfs_refcount_merge_left_extent()
496 return error; in xfs_refcount_merge_left_extent()
500 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_merge_left_extent()
501 return error; in xfs_refcount_merge_left_extent()
514 int error; in xfs_refcount_merge_right_extent() local
525 error = xfs_refcount_lookup_le(cur, cright->rc_startblock, in xfs_refcount_merge_right_extent()
527 if (error) in xfs_refcount_merge_right_extent()
532 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_right_extent()
533 if (error) in xfs_refcount_merge_right_extent()
540 error = xfs_refcount_lookup_le(cur, right->rc_startblock, in xfs_refcount_merge_right_extent()
542 if (error) in xfs_refcount_merge_right_extent()
548 error = xfs_refcount_update(cur, right); in xfs_refcount_merge_right_extent()
549 if (error) in xfs_refcount_merge_right_extent()
553 return error; in xfs_refcount_merge_right_extent()
557 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_merge_right_extent()
558 return error; in xfs_refcount_merge_right_extent()
577 int error; in xfs_refcount_find_left_extents() local
581 error = xfs_refcount_lookup_le(cur, agbno - 1, &found_rec); in xfs_refcount_find_left_extents()
582 if (error) in xfs_refcount_find_left_extents()
587 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_left_extents()
588 if (error) in xfs_refcount_find_left_extents()
601 error = xfs_btree_increment(cur, 0, &found_rec); in xfs_refcount_find_left_extents()
602 if (error) in xfs_refcount_find_left_extents()
605 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_left_extents()
606 if (error) in xfs_refcount_find_left_extents()
639 return error; in xfs_refcount_find_left_extents()
643 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_find_left_extents()
644 return error; in xfs_refcount_find_left_extents()
661 int error; in xfs_refcount_find_right_extents() local
665 error = xfs_refcount_lookup_ge(cur, agbno + aglen, &found_rec); in xfs_refcount_find_right_extents()
666 if (error) in xfs_refcount_find_right_extents()
671 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_right_extents()
672 if (error) in xfs_refcount_find_right_extents()
685 error = xfs_btree_decrement(cur, 0, &found_rec); in xfs_refcount_find_right_extents()
686 if (error) in xfs_refcount_find_right_extents()
689 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_right_extents()
690 if (error) in xfs_refcount_find_right_extents()
723 return error; in xfs_refcount_find_right_extents()
727 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_find_right_extents()
728 return error; in xfs_refcount_find_right_extents()
753 int error; in xfs_refcount_merge_extents() local
763 error = xfs_refcount_find_left_extents(cur, &left, &cleft, *agbno, in xfs_refcount_merge_extents()
765 if (error) in xfs_refcount_merge_extents()
766 return error; in xfs_refcount_merge_extents()
767 error = xfs_refcount_find_right_extents(cur, &right, &cright, *agbno, in xfs_refcount_merge_extents()
769 if (error) in xfs_refcount_merge_extents()
770 return error; in xfs_refcount_merge_extents()
798 error = xfs_refcount_merge_left_extent(cur, &left, &cleft, in xfs_refcount_merge_extents()
800 if (error) in xfs_refcount_merge_extents()
801 return error; in xfs_refcount_merge_extents()
821 return error; in xfs_refcount_merge_extents()
872 int error; in xfs_refcount_adjust_extents() local
880 error = xfs_refcount_lookup_ge(cur, *agbno, &found_rec); in xfs_refcount_adjust_extents()
881 if (error) in xfs_refcount_adjust_extents()
885 error = xfs_refcount_get_rec(cur, &ext, &found_rec); in xfs_refcount_adjust_extents()
886 if (error) in xfs_refcount_adjust_extents()
912 error = xfs_refcount_insert(cur, &tmp, in xfs_refcount_adjust_extents()
914 if (error) in xfs_refcount_adjust_extents()
930 error = xfs_refcount_lookup_ge(cur, *agbno, in xfs_refcount_adjust_extents()
932 if (error) in xfs_refcount_adjust_extents()
950 error = xfs_refcount_update(cur, &ext); in xfs_refcount_adjust_extents()
951 if (error) in xfs_refcount_adjust_extents()
955 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_adjust_extents()
956 if (error) in xfs_refcount_adjust_extents()
971 error = xfs_btree_increment(cur, 0, &found_rec); in xfs_refcount_adjust_extents()
972 if (error) in xfs_refcount_adjust_extents()
980 return error; in xfs_refcount_adjust_extents()
983 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_adjust_extents()
984 return error; in xfs_refcount_adjust_extents()
1000 int error; in xfs_refcount_adjust() local
1014 error = xfs_refcount_split_extent(cur, agbno, &shape_changed); in xfs_refcount_adjust()
1015 if (error) in xfs_refcount_adjust()
1020 error = xfs_refcount_split_extent(cur, agbno + aglen, &shape_changed); in xfs_refcount_adjust()
1021 if (error) in xfs_refcount_adjust()
1029 error = xfs_refcount_merge_extents(cur, new_agbno, new_aglen, adj, in xfs_refcount_adjust()
1031 if (error) in xfs_refcount_adjust()
1039 error = xfs_refcount_adjust_extents(cur, new_agbno, new_aglen, in xfs_refcount_adjust()
1041 if (error) in xfs_refcount_adjust()
1048 error, _RET_IP_); in xfs_refcount_adjust()
1049 return error; in xfs_refcount_adjust()
1057 int error) in xfs_refcount_finish_one_cleanup() argument
1064 xfs_btree_del_cursor(rcur, error); in xfs_refcount_finish_one_cleanup()
1065 if (error) in xfs_refcount_finish_one_cleanup()
1089 int error = 0; in xfs_refcount_finish_one() local
1121 error = xfs_alloc_read_agf(tp->t_mountp, tp, agno, in xfs_refcount_finish_one()
1123 if (error) in xfs_refcount_finish_one()
1124 return error; in xfs_refcount_finish_one()
1130 error = -ENOMEM; in xfs_refcount_finish_one()
1140 error = xfs_refcount_adjust(rcur, bno, blockcount, &new_agbno, in xfs_refcount_finish_one()
1145 error = xfs_refcount_adjust(rcur, bno, blockcount, &new_agbno, in xfs_refcount_finish_one()
1152 error = __xfs_refcount_cow_alloc(rcur, bno, blockcount); in xfs_refcount_finish_one()
1157 error = __xfs_refcount_cow_free(rcur, bno, blockcount); in xfs_refcount_finish_one()
1161 error = -EFSCORRUPTED; in xfs_refcount_finish_one()
1163 if (!error && *new_len > 0) in xfs_refcount_finish_one()
1166 return error; in xfs_refcount_finish_one()
1171 return error; in xfs_refcount_finish_one()
1251 int error; in xfs_refcount_find_shared() local
1261 error = xfs_refcount_lookup_le(cur, agbno, &have); in xfs_refcount_find_shared()
1262 if (error) in xfs_refcount_find_shared()
1266 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1267 if (error) in xfs_refcount_find_shared()
1272 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1273 if (error) in xfs_refcount_find_shared()
1279 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1280 if (error) in xfs_refcount_find_shared()
1284 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1285 if (error) in xfs_refcount_find_shared()
1307 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1308 if (error) in xfs_refcount_find_shared()
1312 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1313 if (error) in xfs_refcount_find_shared()
1327 if (error) in xfs_refcount_find_shared()
1329 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_find_shared()
1330 return error; in xfs_refcount_find_shared()
1393 int error; in xfs_refcount_adjust_cow_extents() local
1400 error = xfs_refcount_lookup_ge(cur, agbno, &found_rec); in xfs_refcount_adjust_cow_extents()
1401 if (error) in xfs_refcount_adjust_cow_extents()
1403 error = xfs_refcount_get_rec(cur, &ext, &found_rec); in xfs_refcount_adjust_cow_extents()
1404 if (error) in xfs_refcount_adjust_cow_extents()
1425 error = xfs_refcount_insert(cur, &tmp, in xfs_refcount_adjust_cow_extents()
1427 if (error) in xfs_refcount_adjust_cow_extents()
1444 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_adjust_cow_extents()
1445 if (error) in xfs_refcount_adjust_cow_extents()
1454 return error; in xfs_refcount_adjust_cow_extents()
1457 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_adjust_cow_extents()
1458 return error; in xfs_refcount_adjust_cow_extents()
1472 int error; in xfs_refcount_adjust_cow() local
1479 error = xfs_refcount_split_extent(cur, agbno, &shape_changed); in xfs_refcount_adjust_cow()
1480 if (error) in xfs_refcount_adjust_cow()
1483 error = xfs_refcount_split_extent(cur, agbno + aglen, &shape_changed); in xfs_refcount_adjust_cow()
1484 if (error) in xfs_refcount_adjust_cow()
1490 error = xfs_refcount_merge_extents(cur, &agbno, &aglen, adj, in xfs_refcount_adjust_cow()
1492 if (error) in xfs_refcount_adjust_cow()
1496 error = xfs_refcount_adjust_cow_extents(cur, agbno, aglen, adj); in xfs_refcount_adjust_cow()
1497 if (error) in xfs_refcount_adjust_cow()
1504 error, _RET_IP_); in xfs_refcount_adjust_cow()
1505 return error; in xfs_refcount_adjust_cow()
1619 int error; in xfs_refcount_recover_cow_leftovers() local
1636 error = xfs_trans_alloc_empty(mp, &tp); in xfs_refcount_recover_cow_leftovers()
1637 if (error) in xfs_refcount_recover_cow_leftovers()
1638 return error; in xfs_refcount_recover_cow_leftovers()
1640 error = xfs_alloc_read_agf(mp, tp, agno, 0, &agbp); in xfs_refcount_recover_cow_leftovers()
1641 if (error) in xfs_refcount_recover_cow_leftovers()
1644 error = -ENOMEM; in xfs_refcount_recover_cow_leftovers()
1654 error = xfs_btree_query_range(cur, &low, &high, in xfs_refcount_recover_cow_leftovers()
1656 xfs_btree_del_cursor(cur, error); in xfs_refcount_recover_cow_leftovers()
1659 if (error) in xfs_refcount_recover_cow_leftovers()
1665 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, 0, 0, 0, &tp); in xfs_refcount_recover_cow_leftovers()
1666 if (error) in xfs_refcount_recover_cow_leftovers()
1680 error = xfs_trans_commit(tp); in xfs_refcount_recover_cow_leftovers()
1681 if (error) in xfs_refcount_recover_cow_leftovers()
1688 return error; in xfs_refcount_recover_cow_leftovers()
1697 return error; in xfs_refcount_recover_cow_leftovers()