Lines Matching refs:error

175 	int				error;  in xfs_refcount_get_rec()  local
177 error = xfs_btree_get_rec(cur, &rec, stat); in xfs_refcount_get_rec()
178 if (error || !*stat) in xfs_refcount_get_rec()
179 return error; in xfs_refcount_get_rec()
202 int error; in xfs_refcount_update() local
212 error = xfs_btree_update(cur, &rec); in xfs_refcount_update()
213 if (error) in xfs_refcount_update()
215 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_update()
216 return error; in xfs_refcount_update()
230 int error; in xfs_refcount_insert() local
239 error = xfs_btree_insert(cur, i); in xfs_refcount_insert()
240 if (error) in xfs_refcount_insert()
243 error = -EFSCORRUPTED; in xfs_refcount_insert()
248 if (error) in xfs_refcount_insert()
250 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_insert()
251 return error; in xfs_refcount_insert()
267 int error; in xfs_refcount_delete() local
269 error = xfs_refcount_get_rec(cur, &irec, &found_rec); in xfs_refcount_delete()
270 if (error) in xfs_refcount_delete()
273 error = -EFSCORRUPTED; in xfs_refcount_delete()
277 error = xfs_btree_delete(cur, i); in xfs_refcount_delete()
279 error = -EFSCORRUPTED; in xfs_refcount_delete()
282 if (error) in xfs_refcount_delete()
284 error = xfs_refcount_lookup_ge(cur, irec.rc_domain, irec.rc_startblock, in xfs_refcount_delete()
287 if (error) in xfs_refcount_delete()
289 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_delete()
290 return error; in xfs_refcount_delete()
390 int error; in xfs_refcount_split_extent() local
393 error = xfs_refcount_lookup_le(cur, domain, agbno, &found_rec); in xfs_refcount_split_extent()
394 if (error) in xfs_refcount_split_extent()
399 error = xfs_refcount_get_rec(cur, &rcext, &found_rec); in xfs_refcount_split_extent()
400 if (error) in xfs_refcount_split_extent()
403 error = -EFSCORRUPTED; in xfs_refcount_split_extent()
419 error = xfs_refcount_update(cur, &tmp); in xfs_refcount_split_extent()
420 if (error) in xfs_refcount_split_extent()
426 error = xfs_refcount_insert(cur, &tmp, &found_rec); in xfs_refcount_split_extent()
427 if (error) in xfs_refcount_split_extent()
430 error = -EFSCORRUPTED; in xfs_refcount_split_extent()
433 return error; in xfs_refcount_split_extent()
437 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_split_extent()
438 return error; in xfs_refcount_split_extent()
453 int error; in xfs_refcount_merge_center_extents() local
470 error = xfs_refcount_lookup_ge(cur, center->rc_domain, in xfs_refcount_merge_center_extents()
472 if (error) in xfs_refcount_merge_center_extents()
475 error = -EFSCORRUPTED; in xfs_refcount_merge_center_extents()
479 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_center_extents()
480 if (error) in xfs_refcount_merge_center_extents()
483 error = -EFSCORRUPTED; in xfs_refcount_merge_center_extents()
488 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_center_extents()
489 if (error) in xfs_refcount_merge_center_extents()
492 error = -EFSCORRUPTED; in xfs_refcount_merge_center_extents()
498 error = xfs_refcount_lookup_le(cur, left->rc_domain, in xfs_refcount_merge_center_extents()
500 if (error) in xfs_refcount_merge_center_extents()
503 error = -EFSCORRUPTED; in xfs_refcount_merge_center_extents()
508 error = xfs_refcount_update(cur, left); in xfs_refcount_merge_center_extents()
509 if (error) in xfs_refcount_merge_center_extents()
513 return error; in xfs_refcount_merge_center_extents()
517 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_merge_center_extents()
518 return error; in xfs_refcount_merge_center_extents()
532 int error; in xfs_refcount_merge_left_extent() local
542 error = xfs_refcount_lookup_le(cur, cleft->rc_domain, in xfs_refcount_merge_left_extent()
544 if (error) in xfs_refcount_merge_left_extent()
547 error = -EFSCORRUPTED; in xfs_refcount_merge_left_extent()
551 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_left_extent()
552 if (error) in xfs_refcount_merge_left_extent()
555 error = -EFSCORRUPTED; in xfs_refcount_merge_left_extent()
561 error = xfs_refcount_lookup_le(cur, left->rc_domain, in xfs_refcount_merge_left_extent()
563 if (error) in xfs_refcount_merge_left_extent()
566 error = -EFSCORRUPTED; in xfs_refcount_merge_left_extent()
571 error = xfs_refcount_update(cur, left); in xfs_refcount_merge_left_extent()
572 if (error) in xfs_refcount_merge_left_extent()
577 return error; in xfs_refcount_merge_left_extent()
581 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_merge_left_extent()
582 return error; in xfs_refcount_merge_left_extent()
595 int error; in xfs_refcount_merge_right_extent() local
608 error = xfs_refcount_lookup_le(cur, cright->rc_domain, in xfs_refcount_merge_right_extent()
610 if (error) in xfs_refcount_merge_right_extent()
613 error = -EFSCORRUPTED; in xfs_refcount_merge_right_extent()
617 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_right_extent()
618 if (error) in xfs_refcount_merge_right_extent()
621 error = -EFSCORRUPTED; in xfs_refcount_merge_right_extent()
627 error = xfs_refcount_lookup_le(cur, right->rc_domain, in xfs_refcount_merge_right_extent()
629 if (error) in xfs_refcount_merge_right_extent()
632 error = -EFSCORRUPTED; in xfs_refcount_merge_right_extent()
638 error = xfs_refcount_update(cur, right); in xfs_refcount_merge_right_extent()
639 if (error) in xfs_refcount_merge_right_extent()
643 return error; in xfs_refcount_merge_right_extent()
647 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_merge_right_extent()
648 return error; in xfs_refcount_merge_right_extent()
665 int error; in xfs_refcount_find_left_extents() local
669 error = xfs_refcount_lookup_le(cur, domain, agbno - 1, &found_rec); in xfs_refcount_find_left_extents()
670 if (error) in xfs_refcount_find_left_extents()
675 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_left_extents()
676 if (error) in xfs_refcount_find_left_extents()
679 error = -EFSCORRUPTED; in xfs_refcount_find_left_extents()
690 error = xfs_btree_increment(cur, 0, &found_rec); in xfs_refcount_find_left_extents()
691 if (error) in xfs_refcount_find_left_extents()
694 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_left_extents()
695 if (error) in xfs_refcount_find_left_extents()
698 error = -EFSCORRUPTED; in xfs_refcount_find_left_extents()
736 return error; in xfs_refcount_find_left_extents()
740 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_find_left_extents()
741 return error; in xfs_refcount_find_left_extents()
758 int error; in xfs_refcount_find_right_extents() local
762 error = xfs_refcount_lookup_ge(cur, domain, agbno + aglen, &found_rec); in xfs_refcount_find_right_extents()
763 if (error) in xfs_refcount_find_right_extents()
768 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_right_extents()
769 if (error) in xfs_refcount_find_right_extents()
772 error = -EFSCORRUPTED; in xfs_refcount_find_right_extents()
783 error = xfs_btree_decrement(cur, 0, &found_rec); in xfs_refcount_find_right_extents()
784 if (error) in xfs_refcount_find_right_extents()
787 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_right_extents()
788 if (error) in xfs_refcount_find_right_extents()
791 error = -EFSCORRUPTED; in xfs_refcount_find_right_extents()
829 return error; in xfs_refcount_find_right_extents()
833 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_find_right_extents()
834 return error; in xfs_refcount_find_right_extents()
984 int error; in xfs_refcount_merge_extents() local
994 error = xfs_refcount_find_left_extents(cur, &left, &cleft, domain, in xfs_refcount_merge_extents()
996 if (error) in xfs_refcount_merge_extents()
997 return error; in xfs_refcount_merge_extents()
998 error = xfs_refcount_find_right_extents(cur, &right, &cright, domain, in xfs_refcount_merge_extents()
1000 if (error) in xfs_refcount_merge_extents()
1001 return error; in xfs_refcount_merge_extents()
1021 error = xfs_refcount_merge_left_extent(cur, &left, &cleft, in xfs_refcount_merge_extents()
1023 if (error) in xfs_refcount_merge_extents()
1024 return error; in xfs_refcount_merge_extents()
1096 int error; in xfs_refcount_adjust_extents() local
1104 error = xfs_refcount_lookup_ge(cur, XFS_REFC_DOMAIN_SHARED, *agbno, in xfs_refcount_adjust_extents()
1106 if (error) in xfs_refcount_adjust_extents()
1110 error = xfs_refcount_get_rec(cur, &ext, &found_rec); in xfs_refcount_adjust_extents()
1111 if (error) in xfs_refcount_adjust_extents()
1141 error = xfs_refcount_insert(cur, &tmp, in xfs_refcount_adjust_extents()
1143 if (error) in xfs_refcount_adjust_extents()
1147 error = -EFSCORRUPTED; in xfs_refcount_adjust_extents()
1154 error = xfs_free_extent_later(cur->bc_tp, fsbno, in xfs_refcount_adjust_extents()
1157 if (error) in xfs_refcount_adjust_extents()
1169 error = xfs_refcount_lookup_ge(cur, in xfs_refcount_adjust_extents()
1172 if (error) in xfs_refcount_adjust_extents()
1185 error = -EFSCORRUPTED; in xfs_refcount_adjust_extents()
1200 error = xfs_refcount_update(cur, &ext); in xfs_refcount_adjust_extents()
1201 if (error) in xfs_refcount_adjust_extents()
1204 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_adjust_extents()
1205 if (error) in xfs_refcount_adjust_extents()
1208 error = -EFSCORRUPTED; in xfs_refcount_adjust_extents()
1216 error = xfs_free_extent_later(cur->bc_tp, fsbno, in xfs_refcount_adjust_extents()
1219 if (error) in xfs_refcount_adjust_extents()
1224 error = xfs_btree_increment(cur, 0, &found_rec); in xfs_refcount_adjust_extents()
1225 if (error) in xfs_refcount_adjust_extents()
1233 return error; in xfs_refcount_adjust_extents()
1236 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_adjust_extents()
1237 return error; in xfs_refcount_adjust_extents()
1250 int error; in xfs_refcount_adjust() local
1262 error = xfs_refcount_split_extent(cur, XFS_REFC_DOMAIN_SHARED, in xfs_refcount_adjust()
1264 if (error) in xfs_refcount_adjust()
1269 error = xfs_refcount_split_extent(cur, XFS_REFC_DOMAIN_SHARED, in xfs_refcount_adjust()
1271 if (error) in xfs_refcount_adjust()
1279 error = xfs_refcount_merge_extents(cur, XFS_REFC_DOMAIN_SHARED, in xfs_refcount_adjust()
1281 if (error) in xfs_refcount_adjust()
1289 error = xfs_refcount_adjust_extents(cur, agbno, aglen, adj); in xfs_refcount_adjust()
1290 if (error) in xfs_refcount_adjust()
1297 error, _RET_IP_); in xfs_refcount_adjust()
1298 return error; in xfs_refcount_adjust()
1306 int error) in xfs_refcount_finish_one_cleanup() argument
1313 xfs_btree_del_cursor(rcur, error); in xfs_refcount_finish_one_cleanup()
1314 if (error) in xfs_refcount_finish_one_cleanup()
1359 int error = 0; in xfs_refcount_finish_one() local
1386 error = xfs_alloc_read_agf(ri->ri_pag, tp, in xfs_refcount_finish_one()
1388 if (error) in xfs_refcount_finish_one()
1389 return error; in xfs_refcount_finish_one()
1399 error = xfs_refcount_adjust(rcur, &bno, &ri->ri_blockcount, in xfs_refcount_finish_one()
1401 if (error) in xfs_refcount_finish_one()
1402 return error; in xfs_refcount_finish_one()
1404 error = xfs_refcount_continue_op(rcur, ri, bno); in xfs_refcount_finish_one()
1407 error = xfs_refcount_adjust(rcur, &bno, &ri->ri_blockcount, in xfs_refcount_finish_one()
1409 if (error) in xfs_refcount_finish_one()
1410 return error; in xfs_refcount_finish_one()
1412 error = xfs_refcount_continue_op(rcur, ri, bno); in xfs_refcount_finish_one()
1415 error = __xfs_refcount_cow_alloc(rcur, bno, ri->ri_blockcount); in xfs_refcount_finish_one()
1416 if (error) in xfs_refcount_finish_one()
1417 return error; in xfs_refcount_finish_one()
1421 error = __xfs_refcount_cow_free(rcur, bno, ri->ri_blockcount); in xfs_refcount_finish_one()
1422 if (error) in xfs_refcount_finish_one()
1423 return error; in xfs_refcount_finish_one()
1430 if (!error && ri->ri_blockcount > 0) in xfs_refcount_finish_one()
1433 return error; in xfs_refcount_finish_one()
1514 int error; in xfs_refcount_find_shared() local
1524 error = xfs_refcount_lookup_le(cur, XFS_REFC_DOMAIN_SHARED, agbno, in xfs_refcount_find_shared()
1526 if (error) in xfs_refcount_find_shared()
1530 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1531 if (error) in xfs_refcount_find_shared()
1536 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1537 if (error) in xfs_refcount_find_shared()
1540 error = -EFSCORRUPTED; in xfs_refcount_find_shared()
1548 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1549 if (error) in xfs_refcount_find_shared()
1553 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1554 if (error) in xfs_refcount_find_shared()
1557 error = -EFSCORRUPTED; in xfs_refcount_find_shared()
1581 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1582 if (error) in xfs_refcount_find_shared()
1586 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1587 if (error) in xfs_refcount_find_shared()
1590 error = -EFSCORRUPTED; in xfs_refcount_find_shared()
1605 if (error) in xfs_refcount_find_shared()
1607 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_find_shared()
1608 return error; in xfs_refcount_find_shared()
1671 int error; in xfs_refcount_adjust_cow_extents() local
1678 error = xfs_refcount_lookup_ge(cur, XFS_REFC_DOMAIN_COW, agbno, in xfs_refcount_adjust_cow_extents()
1680 if (error) in xfs_refcount_adjust_cow_extents()
1682 error = xfs_refcount_get_rec(cur, &ext, &found_rec); in xfs_refcount_adjust_cow_extents()
1683 if (error) in xfs_refcount_adjust_cow_extents()
1687 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1702 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1714 error = xfs_refcount_insert(cur, &tmp, in xfs_refcount_adjust_cow_extents()
1716 if (error) in xfs_refcount_adjust_cow_extents()
1719 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1726 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1730 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1734 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1741 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_adjust_cow_extents()
1742 if (error) in xfs_refcount_adjust_cow_extents()
1745 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1753 return error; in xfs_refcount_adjust_cow_extents()
1756 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_adjust_cow_extents()
1757 return error; in xfs_refcount_adjust_cow_extents()
1771 int error; in xfs_refcount_adjust_cow() local
1776 error = xfs_refcount_split_extent(cur, XFS_REFC_DOMAIN_COW, in xfs_refcount_adjust_cow()
1778 if (error) in xfs_refcount_adjust_cow()
1781 error = xfs_refcount_split_extent(cur, XFS_REFC_DOMAIN_COW, in xfs_refcount_adjust_cow()
1783 if (error) in xfs_refcount_adjust_cow()
1789 error = xfs_refcount_merge_extents(cur, XFS_REFC_DOMAIN_COW, &agbno, in xfs_refcount_adjust_cow()
1791 if (error) in xfs_refcount_adjust_cow()
1795 error = xfs_refcount_adjust_cow_extents(cur, agbno, aglen, adj); in xfs_refcount_adjust_cow()
1796 if (error) in xfs_refcount_adjust_cow()
1803 error, _RET_IP_); in xfs_refcount_adjust_cow()
1804 return error; in xfs_refcount_adjust_cow()
1932 int error; in xfs_refcount_recover_cow_leftovers() local
1951 error = xfs_trans_alloc_empty(mp, &tp); in xfs_refcount_recover_cow_leftovers()
1952 if (error) in xfs_refcount_recover_cow_leftovers()
1953 return error; in xfs_refcount_recover_cow_leftovers()
1955 error = xfs_alloc_read_agf(pag, tp, 0, &agbp); in xfs_refcount_recover_cow_leftovers()
1956 if (error) in xfs_refcount_recover_cow_leftovers()
1961 error = xfs_btree_query_range(cur, &low, &high, in xfs_refcount_recover_cow_leftovers()
1963 xfs_btree_del_cursor(cur, error); in xfs_refcount_recover_cow_leftovers()
1966 if (error) in xfs_refcount_recover_cow_leftovers()
1972 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, 0, 0, 0, &tp); in xfs_refcount_recover_cow_leftovers()
1973 if (error) in xfs_refcount_recover_cow_leftovers()
1986 error = xfs_free_extent_later(tp, fsb, in xfs_refcount_recover_cow_leftovers()
1989 if (error) in xfs_refcount_recover_cow_leftovers()
1992 error = xfs_trans_commit(tp); in xfs_refcount_recover_cow_leftovers()
1993 if (error) in xfs_refcount_recover_cow_leftovers()
2000 return error; in xfs_refcount_recover_cow_leftovers()
2009 return error; in xfs_refcount_recover_cow_leftovers()