Lines Matching refs:error
115 int error; in xfs_refcount_get_rec() local
118 error = xfs_btree_get_rec(cur, &rec, stat); in xfs_refcount_get_rec()
119 if (error || !*stat) in xfs_refcount_get_rec()
120 return error; in xfs_refcount_get_rec()
172 int error; in xfs_refcount_update() local
178 error = xfs_btree_update(cur, &rec); in xfs_refcount_update()
179 if (error) in xfs_refcount_update()
181 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_update()
182 return error; in xfs_refcount_update()
196 int error; in xfs_refcount_insert() local
202 error = xfs_btree_insert(cur, i); in xfs_refcount_insert()
203 if (error) in xfs_refcount_insert()
208 if (error) in xfs_refcount_insert()
210 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_insert()
211 return error; in xfs_refcount_insert()
227 int error; in xfs_refcount_delete() local
229 error = xfs_refcount_get_rec(cur, &irec, &found_rec); in xfs_refcount_delete()
230 if (error) in xfs_refcount_delete()
234 error = xfs_btree_delete(cur, i); in xfs_refcount_delete()
236 if (error) in xfs_refcount_delete()
238 error = xfs_refcount_lookup_ge(cur, irec.rc_startblock, &found_rec); in xfs_refcount_delete()
240 if (error) in xfs_refcount_delete()
242 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_delete()
243 return error; in xfs_refcount_delete()
342 int error; in xfs_refcount_split_extent() local
345 error = xfs_refcount_lookup_le(cur, agbno, &found_rec); in xfs_refcount_split_extent()
346 if (error) in xfs_refcount_split_extent()
351 error = xfs_refcount_get_rec(cur, &rcext, &found_rec); in xfs_refcount_split_extent()
352 if (error) in xfs_refcount_split_extent()
366 error = xfs_refcount_update(cur, &tmp); in xfs_refcount_split_extent()
367 if (error) in xfs_refcount_split_extent()
373 error = xfs_refcount_insert(cur, &tmp, &found_rec); in xfs_refcount_split_extent()
374 if (error) in xfs_refcount_split_extent()
377 return error; in xfs_refcount_split_extent()
381 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_split_extent()
382 return error; in xfs_refcount_split_extent()
397 int error; in xfs_refcount_merge_center_extents() local
411 error = xfs_refcount_lookup_ge(cur, center->rc_startblock, in xfs_refcount_merge_center_extents()
413 if (error) in xfs_refcount_merge_center_extents()
417 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_center_extents()
418 if (error) in xfs_refcount_merge_center_extents()
423 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_center_extents()
424 if (error) in xfs_refcount_merge_center_extents()
431 error = xfs_refcount_lookup_le(cur, left->rc_startblock, in xfs_refcount_merge_center_extents()
433 if (error) in xfs_refcount_merge_center_extents()
438 error = xfs_refcount_update(cur, left); in xfs_refcount_merge_center_extents()
439 if (error) in xfs_refcount_merge_center_extents()
443 return error; in xfs_refcount_merge_center_extents()
447 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_merge_center_extents()
448 return error; in xfs_refcount_merge_center_extents()
462 int error; in xfs_refcount_merge_left_extent() local
470 error = xfs_refcount_lookup_le(cur, cleft->rc_startblock, in xfs_refcount_merge_left_extent()
472 if (error) in xfs_refcount_merge_left_extent()
477 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_left_extent()
478 if (error) in xfs_refcount_merge_left_extent()
485 error = xfs_refcount_lookup_le(cur, left->rc_startblock, in xfs_refcount_merge_left_extent()
487 if (error) in xfs_refcount_merge_left_extent()
492 error = xfs_refcount_update(cur, left); in xfs_refcount_merge_left_extent()
493 if (error) in xfs_refcount_merge_left_extent()
498 return error; in xfs_refcount_merge_left_extent()
502 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_merge_left_extent()
503 return error; in xfs_refcount_merge_left_extent()
516 int error; in xfs_refcount_merge_right_extent() local
527 error = xfs_refcount_lookup_le(cur, cright->rc_startblock, in xfs_refcount_merge_right_extent()
529 if (error) in xfs_refcount_merge_right_extent()
534 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_right_extent()
535 if (error) in xfs_refcount_merge_right_extent()
542 error = xfs_refcount_lookup_le(cur, right->rc_startblock, in xfs_refcount_merge_right_extent()
544 if (error) in xfs_refcount_merge_right_extent()
550 error = xfs_refcount_update(cur, right); in xfs_refcount_merge_right_extent()
551 if (error) in xfs_refcount_merge_right_extent()
555 return error; in xfs_refcount_merge_right_extent()
559 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_merge_right_extent()
560 return error; in xfs_refcount_merge_right_extent()
579 int error; in xfs_refcount_find_left_extents() local
583 error = xfs_refcount_lookup_le(cur, agbno - 1, &found_rec); in xfs_refcount_find_left_extents()
584 if (error) in xfs_refcount_find_left_extents()
589 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_left_extents()
590 if (error) in xfs_refcount_find_left_extents()
603 error = xfs_btree_increment(cur, 0, &found_rec); in xfs_refcount_find_left_extents()
604 if (error) in xfs_refcount_find_left_extents()
607 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_left_extents()
608 if (error) in xfs_refcount_find_left_extents()
641 return error; in xfs_refcount_find_left_extents()
645 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_find_left_extents()
646 return error; in xfs_refcount_find_left_extents()
663 int error; in xfs_refcount_find_right_extents() local
667 error = xfs_refcount_lookup_ge(cur, agbno + aglen, &found_rec); in xfs_refcount_find_right_extents()
668 if (error) in xfs_refcount_find_right_extents()
673 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_right_extents()
674 if (error) in xfs_refcount_find_right_extents()
687 error = xfs_btree_decrement(cur, 0, &found_rec); in xfs_refcount_find_right_extents()
688 if (error) in xfs_refcount_find_right_extents()
691 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_right_extents()
692 if (error) in xfs_refcount_find_right_extents()
725 return error; in xfs_refcount_find_right_extents()
729 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_find_right_extents()
730 return error; in xfs_refcount_find_right_extents()
755 int error; in xfs_refcount_merge_extents() local
765 error = xfs_refcount_find_left_extents(cur, &left, &cleft, *agbno, in xfs_refcount_merge_extents()
767 if (error) in xfs_refcount_merge_extents()
768 return error; in xfs_refcount_merge_extents()
769 error = xfs_refcount_find_right_extents(cur, &right, &cright, *agbno, in xfs_refcount_merge_extents()
771 if (error) in xfs_refcount_merge_extents()
772 return error; in xfs_refcount_merge_extents()
800 error = xfs_refcount_merge_left_extent(cur, &left, &cleft, in xfs_refcount_merge_extents()
802 if (error) in xfs_refcount_merge_extents()
803 return error; in xfs_refcount_merge_extents()
823 return error; in xfs_refcount_merge_extents()
874 int error; in xfs_refcount_adjust_extents() local
882 error = xfs_refcount_lookup_ge(cur, *agbno, &found_rec); in xfs_refcount_adjust_extents()
883 if (error) in xfs_refcount_adjust_extents()
887 error = xfs_refcount_get_rec(cur, &ext, &found_rec); in xfs_refcount_adjust_extents()
888 if (error) in xfs_refcount_adjust_extents()
914 error = xfs_refcount_insert(cur, &tmp, in xfs_refcount_adjust_extents()
916 if (error) in xfs_refcount_adjust_extents()
932 error = xfs_refcount_lookup_ge(cur, *agbno, in xfs_refcount_adjust_extents()
934 if (error) in xfs_refcount_adjust_extents()
952 error = xfs_refcount_update(cur, &ext); in xfs_refcount_adjust_extents()
953 if (error) in xfs_refcount_adjust_extents()
957 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_adjust_extents()
958 if (error) in xfs_refcount_adjust_extents()
973 error = xfs_btree_increment(cur, 0, &found_rec); in xfs_refcount_adjust_extents()
974 if (error) in xfs_refcount_adjust_extents()
982 return error; in xfs_refcount_adjust_extents()
985 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_adjust_extents()
986 return error; in xfs_refcount_adjust_extents()
1002 int error; in xfs_refcount_adjust() local
1016 error = xfs_refcount_split_extent(cur, agbno, &shape_changed); in xfs_refcount_adjust()
1017 if (error) in xfs_refcount_adjust()
1022 error = xfs_refcount_split_extent(cur, agbno + aglen, &shape_changed); in xfs_refcount_adjust()
1023 if (error) in xfs_refcount_adjust()
1031 error = xfs_refcount_merge_extents(cur, new_agbno, new_aglen, adj, in xfs_refcount_adjust()
1033 if (error) in xfs_refcount_adjust()
1041 error = xfs_refcount_adjust_extents(cur, new_agbno, new_aglen, in xfs_refcount_adjust()
1043 if (error) in xfs_refcount_adjust()
1050 error, _RET_IP_); in xfs_refcount_adjust()
1051 return error; in xfs_refcount_adjust()
1059 int error) in xfs_refcount_finish_one_cleanup() argument
1066 xfs_btree_del_cursor(rcur, error); in xfs_refcount_finish_one_cleanup()
1067 if (error) in xfs_refcount_finish_one_cleanup()
1091 int error = 0; in xfs_refcount_finish_one() local
1123 error = xfs_alloc_read_agf(tp->t_mountp, tp, agno, in xfs_refcount_finish_one()
1125 if (error) in xfs_refcount_finish_one()
1126 return error; in xfs_refcount_finish_one()
1132 error = -ENOMEM; in xfs_refcount_finish_one()
1142 error = xfs_refcount_adjust(rcur, bno, blockcount, &new_agbno, in xfs_refcount_finish_one()
1147 error = xfs_refcount_adjust(rcur, bno, blockcount, &new_agbno, in xfs_refcount_finish_one()
1154 error = __xfs_refcount_cow_alloc(rcur, bno, blockcount); in xfs_refcount_finish_one()
1159 error = __xfs_refcount_cow_free(rcur, bno, blockcount); in xfs_refcount_finish_one()
1163 error = -EFSCORRUPTED; in xfs_refcount_finish_one()
1165 if (!error && *new_len > 0) in xfs_refcount_finish_one()
1168 return error; in xfs_refcount_finish_one()
1173 return error; in xfs_refcount_finish_one()
1254 int error; in xfs_refcount_find_shared() local
1264 error = xfs_refcount_lookup_le(cur, agbno, &have); in xfs_refcount_find_shared()
1265 if (error) in xfs_refcount_find_shared()
1269 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1270 if (error) in xfs_refcount_find_shared()
1275 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1276 if (error) in xfs_refcount_find_shared()
1282 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1283 if (error) in xfs_refcount_find_shared()
1287 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1288 if (error) in xfs_refcount_find_shared()
1310 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1311 if (error) in xfs_refcount_find_shared()
1315 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1316 if (error) in xfs_refcount_find_shared()
1330 if (error) in xfs_refcount_find_shared()
1332 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_find_shared()
1333 return error; in xfs_refcount_find_shared()
1396 int error; in xfs_refcount_adjust_cow_extents() local
1403 error = xfs_refcount_lookup_ge(cur, agbno, &found_rec); in xfs_refcount_adjust_cow_extents()
1404 if (error) in xfs_refcount_adjust_cow_extents()
1406 error = xfs_refcount_get_rec(cur, &ext, &found_rec); in xfs_refcount_adjust_cow_extents()
1407 if (error) in xfs_refcount_adjust_cow_extents()
1428 error = xfs_refcount_insert(cur, &tmp, in xfs_refcount_adjust_cow_extents()
1430 if (error) in xfs_refcount_adjust_cow_extents()
1447 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_adjust_cow_extents()
1448 if (error) in xfs_refcount_adjust_cow_extents()
1457 return error; in xfs_refcount_adjust_cow_extents()
1460 cur->bc_private.a.agno, error, _RET_IP_); in xfs_refcount_adjust_cow_extents()
1461 return error; in xfs_refcount_adjust_cow_extents()
1475 int error; in xfs_refcount_adjust_cow() local
1482 error = xfs_refcount_split_extent(cur, agbno, &shape_changed); in xfs_refcount_adjust_cow()
1483 if (error) in xfs_refcount_adjust_cow()
1486 error = xfs_refcount_split_extent(cur, agbno + aglen, &shape_changed); in xfs_refcount_adjust_cow()
1487 if (error) in xfs_refcount_adjust_cow()
1493 error = xfs_refcount_merge_extents(cur, &agbno, &aglen, adj, in xfs_refcount_adjust_cow()
1495 if (error) in xfs_refcount_adjust_cow()
1499 error = xfs_refcount_adjust_cow_extents(cur, agbno, aglen, adj); in xfs_refcount_adjust_cow()
1500 if (error) in xfs_refcount_adjust_cow()
1507 error, _RET_IP_); in xfs_refcount_adjust_cow()
1508 return error; in xfs_refcount_adjust_cow()
1553 int error; in xfs_refcount_alloc_cow_extent() local
1558 error = __xfs_refcount_add(tp, XFS_REFCOUNT_ALLOC_COW, fsb, len); in xfs_refcount_alloc_cow_extent()
1559 if (error) in xfs_refcount_alloc_cow_extent()
1560 return error; in xfs_refcount_alloc_cow_extent()
1575 int error; in xfs_refcount_free_cow_extent() local
1581 error = xfs_rmap_free_extent(tp, XFS_FSB_TO_AGNO(mp, fsb), in xfs_refcount_free_cow_extent()
1583 if (error) in xfs_refcount_free_cow_extent()
1584 return error; in xfs_refcount_free_cow_extent()
1629 int error; in xfs_refcount_recover_cow_leftovers() local
1646 error = xfs_trans_alloc_empty(mp, &tp); in xfs_refcount_recover_cow_leftovers()
1647 if (error) in xfs_refcount_recover_cow_leftovers()
1648 return error; in xfs_refcount_recover_cow_leftovers()
1650 error = xfs_alloc_read_agf(mp, tp, agno, 0, &agbp); in xfs_refcount_recover_cow_leftovers()
1651 if (error) in xfs_refcount_recover_cow_leftovers()
1654 error = -ENOMEM; in xfs_refcount_recover_cow_leftovers()
1664 error = xfs_btree_query_range(cur, &low, &high, in xfs_refcount_recover_cow_leftovers()
1666 xfs_btree_del_cursor(cur, error); in xfs_refcount_recover_cow_leftovers()
1669 if (error) in xfs_refcount_recover_cow_leftovers()
1675 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, 0, 0, 0, &tp); in xfs_refcount_recover_cow_leftovers()
1676 if (error) in xfs_refcount_recover_cow_leftovers()
1684 error = xfs_refcount_free_cow_extent(tp, fsb, in xfs_refcount_recover_cow_leftovers()
1686 if (error) in xfs_refcount_recover_cow_leftovers()
1692 error = xfs_trans_commit(tp); in xfs_refcount_recover_cow_leftovers()
1693 if (error) in xfs_refcount_recover_cow_leftovers()
1700 return error; in xfs_refcount_recover_cow_leftovers()
1709 return error; in xfs_refcount_recover_cow_leftovers()