Lines Matching refs:error
135 int error; in xfs_refcount_get_rec() local
137 error = xfs_btree_get_rec(cur, &rec, stat); in xfs_refcount_get_rec()
138 if (error || !*stat) in xfs_refcount_get_rec()
139 return error; in xfs_refcount_get_rec()
180 int error; in xfs_refcount_update() local
190 error = xfs_btree_update(cur, &rec); in xfs_refcount_update()
191 if (error) in xfs_refcount_update()
193 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_update()
194 return error; in xfs_refcount_update()
208 int error; in xfs_refcount_insert() local
217 error = xfs_btree_insert(cur, i); in xfs_refcount_insert()
218 if (error) in xfs_refcount_insert()
221 error = -EFSCORRUPTED; in xfs_refcount_insert()
226 if (error) in xfs_refcount_insert()
228 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_insert()
229 return error; in xfs_refcount_insert()
245 int error; in xfs_refcount_delete() local
247 error = xfs_refcount_get_rec(cur, &irec, &found_rec); in xfs_refcount_delete()
248 if (error) in xfs_refcount_delete()
251 error = -EFSCORRUPTED; in xfs_refcount_delete()
255 error = xfs_btree_delete(cur, i); in xfs_refcount_delete()
257 error = -EFSCORRUPTED; in xfs_refcount_delete()
260 if (error) in xfs_refcount_delete()
262 error = xfs_refcount_lookup_ge(cur, irec.rc_domain, irec.rc_startblock, in xfs_refcount_delete()
265 if (error) in xfs_refcount_delete()
267 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_delete()
268 return error; in xfs_refcount_delete()
368 int error; in xfs_refcount_split_extent() local
371 error = xfs_refcount_lookup_le(cur, domain, agbno, &found_rec); in xfs_refcount_split_extent()
372 if (error) in xfs_refcount_split_extent()
377 error = xfs_refcount_get_rec(cur, &rcext, &found_rec); in xfs_refcount_split_extent()
378 if (error) in xfs_refcount_split_extent()
381 error = -EFSCORRUPTED; in xfs_refcount_split_extent()
397 error = xfs_refcount_update(cur, &tmp); in xfs_refcount_split_extent()
398 if (error) in xfs_refcount_split_extent()
404 error = xfs_refcount_insert(cur, &tmp, &found_rec); in xfs_refcount_split_extent()
405 if (error) in xfs_refcount_split_extent()
408 error = -EFSCORRUPTED; in xfs_refcount_split_extent()
411 return error; in xfs_refcount_split_extent()
415 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_split_extent()
416 return error; in xfs_refcount_split_extent()
431 int error; in xfs_refcount_merge_center_extents() local
448 error = xfs_refcount_lookup_ge(cur, center->rc_domain, in xfs_refcount_merge_center_extents()
450 if (error) in xfs_refcount_merge_center_extents()
453 error = -EFSCORRUPTED; in xfs_refcount_merge_center_extents()
457 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_center_extents()
458 if (error) in xfs_refcount_merge_center_extents()
461 error = -EFSCORRUPTED; in xfs_refcount_merge_center_extents()
466 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_center_extents()
467 if (error) in xfs_refcount_merge_center_extents()
470 error = -EFSCORRUPTED; in xfs_refcount_merge_center_extents()
476 error = xfs_refcount_lookup_le(cur, left->rc_domain, in xfs_refcount_merge_center_extents()
478 if (error) in xfs_refcount_merge_center_extents()
481 error = -EFSCORRUPTED; in xfs_refcount_merge_center_extents()
486 error = xfs_refcount_update(cur, left); in xfs_refcount_merge_center_extents()
487 if (error) in xfs_refcount_merge_center_extents()
491 return error; in xfs_refcount_merge_center_extents()
495 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_merge_center_extents()
496 return error; in xfs_refcount_merge_center_extents()
510 int error; in xfs_refcount_merge_left_extent() local
520 error = xfs_refcount_lookup_le(cur, cleft->rc_domain, in xfs_refcount_merge_left_extent()
522 if (error) in xfs_refcount_merge_left_extent()
525 error = -EFSCORRUPTED; in xfs_refcount_merge_left_extent()
529 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_left_extent()
530 if (error) in xfs_refcount_merge_left_extent()
533 error = -EFSCORRUPTED; in xfs_refcount_merge_left_extent()
539 error = xfs_refcount_lookup_le(cur, left->rc_domain, in xfs_refcount_merge_left_extent()
541 if (error) in xfs_refcount_merge_left_extent()
544 error = -EFSCORRUPTED; in xfs_refcount_merge_left_extent()
549 error = xfs_refcount_update(cur, left); in xfs_refcount_merge_left_extent()
550 if (error) in xfs_refcount_merge_left_extent()
555 return error; in xfs_refcount_merge_left_extent()
559 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_merge_left_extent()
560 return error; in xfs_refcount_merge_left_extent()
573 int error; in xfs_refcount_merge_right_extent() local
586 error = xfs_refcount_lookup_le(cur, cright->rc_domain, in xfs_refcount_merge_right_extent()
588 if (error) in xfs_refcount_merge_right_extent()
591 error = -EFSCORRUPTED; in xfs_refcount_merge_right_extent()
595 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_merge_right_extent()
596 if (error) in xfs_refcount_merge_right_extent()
599 error = -EFSCORRUPTED; in xfs_refcount_merge_right_extent()
605 error = xfs_refcount_lookup_le(cur, right->rc_domain, in xfs_refcount_merge_right_extent()
607 if (error) in xfs_refcount_merge_right_extent()
610 error = -EFSCORRUPTED; in xfs_refcount_merge_right_extent()
616 error = xfs_refcount_update(cur, right); in xfs_refcount_merge_right_extent()
617 if (error) in xfs_refcount_merge_right_extent()
621 return error; in xfs_refcount_merge_right_extent()
625 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_merge_right_extent()
626 return error; in xfs_refcount_merge_right_extent()
643 int error; in xfs_refcount_find_left_extents() local
647 error = xfs_refcount_lookup_le(cur, domain, agbno - 1, &found_rec); in xfs_refcount_find_left_extents()
648 if (error) in xfs_refcount_find_left_extents()
653 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_left_extents()
654 if (error) in xfs_refcount_find_left_extents()
657 error = -EFSCORRUPTED; in xfs_refcount_find_left_extents()
668 error = xfs_btree_increment(cur, 0, &found_rec); in xfs_refcount_find_left_extents()
669 if (error) in xfs_refcount_find_left_extents()
672 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_left_extents()
673 if (error) in xfs_refcount_find_left_extents()
676 error = -EFSCORRUPTED; in xfs_refcount_find_left_extents()
714 return error; in xfs_refcount_find_left_extents()
718 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_find_left_extents()
719 return error; in xfs_refcount_find_left_extents()
736 int error; in xfs_refcount_find_right_extents() local
740 error = xfs_refcount_lookup_ge(cur, domain, agbno + aglen, &found_rec); in xfs_refcount_find_right_extents()
741 if (error) in xfs_refcount_find_right_extents()
746 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_right_extents()
747 if (error) in xfs_refcount_find_right_extents()
750 error = -EFSCORRUPTED; in xfs_refcount_find_right_extents()
761 error = xfs_btree_decrement(cur, 0, &found_rec); in xfs_refcount_find_right_extents()
762 if (error) in xfs_refcount_find_right_extents()
765 error = xfs_refcount_get_rec(cur, &tmp, &found_rec); in xfs_refcount_find_right_extents()
766 if (error) in xfs_refcount_find_right_extents()
769 error = -EFSCORRUPTED; in xfs_refcount_find_right_extents()
807 return error; in xfs_refcount_find_right_extents()
811 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_find_right_extents()
812 return error; in xfs_refcount_find_right_extents()
837 int error; in xfs_refcount_merge_extents() local
847 error = xfs_refcount_find_left_extents(cur, &left, &cleft, domain, in xfs_refcount_merge_extents()
849 if (error) in xfs_refcount_merge_extents()
850 return error; in xfs_refcount_merge_extents()
851 error = xfs_refcount_find_right_extents(cur, &right, &cright, domain, in xfs_refcount_merge_extents()
853 if (error) in xfs_refcount_merge_extents()
854 return error; in xfs_refcount_merge_extents()
882 error = xfs_refcount_merge_left_extent(cur, &left, &cleft, in xfs_refcount_merge_extents()
884 if (error) in xfs_refcount_merge_extents()
885 return error; in xfs_refcount_merge_extents()
960 int error; in xfs_refcount_adjust_extents() local
968 error = xfs_refcount_lookup_ge(cur, XFS_REFC_DOMAIN_SHARED, *agbno, in xfs_refcount_adjust_extents()
970 if (error) in xfs_refcount_adjust_extents()
974 error = xfs_refcount_get_rec(cur, &ext, &found_rec); in xfs_refcount_adjust_extents()
975 if (error) in xfs_refcount_adjust_extents()
1005 error = xfs_refcount_insert(cur, &tmp, in xfs_refcount_adjust_extents()
1007 if (error) in xfs_refcount_adjust_extents()
1011 error = -EFSCORRUPTED; in xfs_refcount_adjust_extents()
1030 error = xfs_refcount_lookup_ge(cur, in xfs_refcount_adjust_extents()
1033 if (error) in xfs_refcount_adjust_extents()
1046 error = -EFSCORRUPTED; in xfs_refcount_adjust_extents()
1061 error = xfs_refcount_update(cur, &ext); in xfs_refcount_adjust_extents()
1062 if (error) in xfs_refcount_adjust_extents()
1065 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_adjust_extents()
1066 if (error) in xfs_refcount_adjust_extents()
1069 error = -EFSCORRUPTED; in xfs_refcount_adjust_extents()
1082 error = xfs_btree_increment(cur, 0, &found_rec); in xfs_refcount_adjust_extents()
1083 if (error) in xfs_refcount_adjust_extents()
1091 return error; in xfs_refcount_adjust_extents()
1094 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_adjust_extents()
1095 return error; in xfs_refcount_adjust_extents()
1110 int error; in xfs_refcount_adjust() local
1124 error = xfs_refcount_split_extent(cur, XFS_REFC_DOMAIN_SHARED, in xfs_refcount_adjust()
1126 if (error) in xfs_refcount_adjust()
1131 error = xfs_refcount_split_extent(cur, XFS_REFC_DOMAIN_SHARED, in xfs_refcount_adjust()
1133 if (error) in xfs_refcount_adjust()
1141 error = xfs_refcount_merge_extents(cur, XFS_REFC_DOMAIN_SHARED, in xfs_refcount_adjust()
1143 if (error) in xfs_refcount_adjust()
1151 error = xfs_refcount_adjust_extents(cur, new_agbno, new_aglen, adj); in xfs_refcount_adjust()
1152 if (error) in xfs_refcount_adjust()
1159 error, _RET_IP_); in xfs_refcount_adjust()
1160 return error; in xfs_refcount_adjust()
1168 int error) in xfs_refcount_finish_one_cleanup() argument
1175 xfs_btree_del_cursor(rcur, error); in xfs_refcount_finish_one_cleanup()
1176 if (error) in xfs_refcount_finish_one_cleanup()
1226 int error = 0; in xfs_refcount_finish_one() local
1241 error = -EIO; in xfs_refcount_finish_one()
1258 error = xfs_alloc_read_agf(pag, tp, XFS_ALLOC_FLAG_FREEING, in xfs_refcount_finish_one()
1260 if (error) in xfs_refcount_finish_one()
1271 error = xfs_refcount_adjust(rcur, bno, blockcount, &new_agbno, in xfs_refcount_finish_one()
1273 if (error) in xfs_refcount_finish_one()
1276 error = xfs_refcount_continue_op(rcur, startblock, in xfs_refcount_finish_one()
1280 error = xfs_refcount_adjust(rcur, bno, blockcount, &new_agbno, in xfs_refcount_finish_one()
1282 if (error) in xfs_refcount_finish_one()
1285 error = xfs_refcount_continue_op(rcur, startblock, in xfs_refcount_finish_one()
1291 error = __xfs_refcount_cow_alloc(rcur, bno, blockcount); in xfs_refcount_finish_one()
1296 error = __xfs_refcount_cow_free(rcur, bno, blockcount); in xfs_refcount_finish_one()
1300 error = -EFSCORRUPTED; in xfs_refcount_finish_one()
1302 if (!error && *new_len > 0) in xfs_refcount_finish_one()
1307 return error; in xfs_refcount_finish_one()
1387 int error; in xfs_refcount_find_shared() local
1397 error = xfs_refcount_lookup_le(cur, XFS_REFC_DOMAIN_SHARED, agbno, in xfs_refcount_find_shared()
1399 if (error) in xfs_refcount_find_shared()
1403 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1404 if (error) in xfs_refcount_find_shared()
1409 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1410 if (error) in xfs_refcount_find_shared()
1413 error = -EFSCORRUPTED; in xfs_refcount_find_shared()
1421 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1422 if (error) in xfs_refcount_find_shared()
1426 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1427 if (error) in xfs_refcount_find_shared()
1430 error = -EFSCORRUPTED; in xfs_refcount_find_shared()
1454 error = xfs_btree_increment(cur, 0, &have); in xfs_refcount_find_shared()
1455 if (error) in xfs_refcount_find_shared()
1459 error = xfs_refcount_get_rec(cur, &tmp, &i); in xfs_refcount_find_shared()
1460 if (error) in xfs_refcount_find_shared()
1463 error = -EFSCORRUPTED; in xfs_refcount_find_shared()
1478 if (error) in xfs_refcount_find_shared()
1480 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_find_shared()
1481 return error; in xfs_refcount_find_shared()
1544 int error; in xfs_refcount_adjust_cow_extents() local
1551 error = xfs_refcount_lookup_ge(cur, XFS_REFC_DOMAIN_COW, agbno, in xfs_refcount_adjust_cow_extents()
1553 if (error) in xfs_refcount_adjust_cow_extents()
1555 error = xfs_refcount_get_rec(cur, &ext, &found_rec); in xfs_refcount_adjust_cow_extents()
1556 if (error) in xfs_refcount_adjust_cow_extents()
1560 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1575 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1587 error = xfs_refcount_insert(cur, &tmp, in xfs_refcount_adjust_cow_extents()
1589 if (error) in xfs_refcount_adjust_cow_extents()
1592 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1599 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1603 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1607 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1614 error = xfs_refcount_delete(cur, &found_rec); in xfs_refcount_adjust_cow_extents()
1615 if (error) in xfs_refcount_adjust_cow_extents()
1618 error = -EFSCORRUPTED; in xfs_refcount_adjust_cow_extents()
1626 return error; in xfs_refcount_adjust_cow_extents()
1629 cur->bc_ag.pag->pag_agno, error, _RET_IP_); in xfs_refcount_adjust_cow_extents()
1630 return error; in xfs_refcount_adjust_cow_extents()
1644 int error; in xfs_refcount_adjust_cow() local
1649 error = xfs_refcount_split_extent(cur, XFS_REFC_DOMAIN_COW, in xfs_refcount_adjust_cow()
1651 if (error) in xfs_refcount_adjust_cow()
1654 error = xfs_refcount_split_extent(cur, XFS_REFC_DOMAIN_COW, in xfs_refcount_adjust_cow()
1656 if (error) in xfs_refcount_adjust_cow()
1662 error = xfs_refcount_merge_extents(cur, XFS_REFC_DOMAIN_COW, &agbno, in xfs_refcount_adjust_cow()
1664 if (error) in xfs_refcount_adjust_cow()
1668 error = xfs_refcount_adjust_cow_extents(cur, agbno, aglen, adj); in xfs_refcount_adjust_cow()
1669 if (error) in xfs_refcount_adjust_cow()
1676 error, _RET_IP_); in xfs_refcount_adjust_cow()
1677 return error; in xfs_refcount_adjust_cow()
1799 int error; in xfs_refcount_recover_cow_leftovers() local
1818 error = xfs_trans_alloc_empty(mp, &tp); in xfs_refcount_recover_cow_leftovers()
1819 if (error) in xfs_refcount_recover_cow_leftovers()
1820 return error; in xfs_refcount_recover_cow_leftovers()
1822 error = xfs_alloc_read_agf(pag, tp, 0, &agbp); in xfs_refcount_recover_cow_leftovers()
1823 if (error) in xfs_refcount_recover_cow_leftovers()
1832 error = xfs_btree_query_range(cur, &low, &high, in xfs_refcount_recover_cow_leftovers()
1834 xfs_btree_del_cursor(cur, error); in xfs_refcount_recover_cow_leftovers()
1837 if (error) in xfs_refcount_recover_cow_leftovers()
1843 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, 0, 0, 0, &tp); in xfs_refcount_recover_cow_leftovers()
1844 if (error) in xfs_refcount_recover_cow_leftovers()
1859 error = xfs_trans_commit(tp); in xfs_refcount_recover_cow_leftovers()
1860 if (error) in xfs_refcount_recover_cow_leftovers()
1867 return error; in xfs_refcount_recover_cow_leftovers()
1876 return error; in xfs_refcount_recover_cow_leftovers()