Lines Matching refs:error
128 int error; in xfs_alloc_get_rec() local
130 error = xfs_btree_get_rec(cur, &rec, stat); in xfs_alloc_get_rec()
131 if (!error && *stat == 1) { in xfs_alloc_get_rec()
135 return error; in xfs_alloc_get_rec()
328 int error; /* error code */ in xfs_alloc_fixup_trees() local
343 if ((error = xfs_alloc_get_rec(cnt_cur, &nfbno1, &nflen1, &i))) in xfs_alloc_fixup_trees()
344 return error; in xfs_alloc_fixup_trees()
349 if ((error = xfs_alloc_lookup_eq(cnt_cur, fbno, flen, &i))) in xfs_alloc_fixup_trees()
350 return error; in xfs_alloc_fixup_trees()
358 if ((error = xfs_alloc_get_rec(bno_cur, &nfbno1, &nflen1, &i))) in xfs_alloc_fixup_trees()
359 return error; in xfs_alloc_fixup_trees()
364 if ((error = xfs_alloc_lookup_eq(bno_cur, fbno, flen, &i))) in xfs_alloc_fixup_trees()
365 return error; in xfs_alloc_fixup_trees()
406 if ((error = xfs_btree_delete(cnt_cur, &i))) in xfs_alloc_fixup_trees()
407 return error; in xfs_alloc_fixup_trees()
413 if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno1, nflen1, &i))) in xfs_alloc_fixup_trees()
414 return error; in xfs_alloc_fixup_trees()
416 if ((error = xfs_btree_insert(cnt_cur, &i))) in xfs_alloc_fixup_trees()
417 return error; in xfs_alloc_fixup_trees()
421 if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno2, nflen2, &i))) in xfs_alloc_fixup_trees()
422 return error; in xfs_alloc_fixup_trees()
424 if ((error = xfs_btree_insert(cnt_cur, &i))) in xfs_alloc_fixup_trees()
425 return error; in xfs_alloc_fixup_trees()
435 if ((error = xfs_btree_delete(bno_cur, &i))) in xfs_alloc_fixup_trees()
436 return error; in xfs_alloc_fixup_trees()
442 if ((error = xfs_alloc_update(bno_cur, nfbno1, nflen1))) in xfs_alloc_fixup_trees()
443 return error; in xfs_alloc_fixup_trees()
449 if ((error = xfs_alloc_lookup_eq(bno_cur, nfbno2, nflen2, &i))) in xfs_alloc_fixup_trees()
450 return error; in xfs_alloc_fixup_trees()
452 if ((error = xfs_btree_insert(bno_cur, &i))) in xfs_alloc_fixup_trees()
453 return error; in xfs_alloc_fixup_trees()
554 int error; in xfs_alloc_read_agfl() local
557 error = xfs_trans_read_buf( in xfs_alloc_read_agfl()
561 if (error) in xfs_alloc_read_agfl()
562 return error; in xfs_alloc_read_agfl()
605 int error=0; in xfs_alloc_ag_vextent() local
618 error = xfs_alloc_ag_vextent_size(args); in xfs_alloc_ag_vextent()
621 error = xfs_alloc_ag_vextent_near(args); in xfs_alloc_ag_vextent()
624 error = xfs_alloc_ag_vextent_exact(args); in xfs_alloc_ag_vextent()
631 if (error || args->agbno == NULLAGBLOCK) in xfs_alloc_ag_vextent()
632 return error; in xfs_alloc_ag_vextent()
640 error = xfs_alloc_update_counters(args->tp, args->pag, in xfs_alloc_ag_vextent()
643 if (error) in xfs_alloc_ag_vextent()
644 return error; in xfs_alloc_ag_vextent()
659 return error; in xfs_alloc_ag_vextent()
674 int error; in xfs_alloc_ag_vextent_exact() local
695 error = xfs_alloc_lookup_le(bno_cur, args->agbno, args->minlen, &i); in xfs_alloc_ag_vextent_exact()
696 if (error) in xfs_alloc_ag_vextent_exact()
704 error = xfs_alloc_get_rec(bno_cur, &fbno, &flen, &i); in xfs_alloc_ag_vextent_exact()
705 if (error) in xfs_alloc_ag_vextent_exact()
749 error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, args->agbno, in xfs_alloc_ag_vextent_exact()
751 if (error) { in xfs_alloc_ag_vextent_exact()
773 return error; in xfs_alloc_ag_vextent_exact()
794 int error; in xfs_alloc_find_best_extent() local
805 error = xfs_alloc_get_rec(*scur, sbno, slen, &i); in xfs_alloc_find_best_extent()
806 if (error) in xfs_alloc_find_best_extent()
847 error = xfs_btree_increment(*scur, 0, &i); in xfs_alloc_find_best_extent()
849 error = xfs_btree_decrement(*scur, 0, &i); in xfs_alloc_find_best_extent()
850 if (error) in xfs_alloc_find_best_extent()
866 return error; in xfs_alloc_find_best_extent()
888 int error; /* error code */ in xfs_alloc_ag_vextent_near() local
935 if ((error = xfs_alloc_lookup_ge(cnt_cur, 0, args->maxlen, &i))) in xfs_alloc_ag_vextent_near()
942 if ((error = xfs_alloc_ag_vextent_small(args, cnt_cur, <bno, in xfs_alloc_ag_vextent_near()
983 if ((error = xfs_alloc_get_rec(cnt_cur, <bno, in xfs_alloc_ag_vextent_near()
989 if ((error = xfs_btree_increment(cnt_cur, 0, &i))) in xfs_alloc_ag_vextent_near()
998 !error && j && (blen < args->maxlen || bdiff > 0); in xfs_alloc_ag_vextent_near()
999 error = xfs_btree_increment(cnt_cur, 0, &j)) { in xfs_alloc_ag_vextent_near()
1004 if ((error = xfs_alloc_get_rec(cnt_cur, <bno, <len, &i))) in xfs_alloc_ag_vextent_near()
1039 if ((error = xfs_alloc_get_rec(cnt_cur, <bno, <len, &i))) in xfs_alloc_ag_vextent_near()
1064 if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur_lt, ltbno, in xfs_alloc_ag_vextent_near()
1093 if ((error = xfs_alloc_lookup_le(bno_cur_lt, args->agbno, args->maxlen, &i))) in xfs_alloc_ag_vextent_near()
1106 else if ((error = xfs_btree_dup_cursor(bno_cur_lt, &bno_cur_gt))) in xfs_alloc_ag_vextent_near()
1112 if ((error = xfs_btree_increment(bno_cur_gt, 0, &i))) in xfs_alloc_ag_vextent_near()
1128 if ((error = xfs_alloc_get_rec(bno_cur_lt, <bno, <len, &i))) in xfs_alloc_ag_vextent_near()
1135 if ((error = xfs_btree_decrement(bno_cur_lt, 0, &i))) in xfs_alloc_ag_vextent_near()
1144 if ((error = xfs_alloc_get_rec(bno_cur_gt, >bno, >len, &i))) in xfs_alloc_ag_vextent_near()
1151 if ((error = xfs_btree_increment(bno_cur_gt, 0, &i))) in xfs_alloc_ag_vextent_near()
1175 error = xfs_alloc_find_best_extent(args, in xfs_alloc_ag_vextent_near()
1192 error = xfs_alloc_find_best_extent(args, in xfs_alloc_ag_vextent_near()
1199 if (error) in xfs_alloc_ag_vextent_near()
1256 if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur_lt, ltbno, ltlen, in xfs_alloc_ag_vextent_near()
1277 return error; in xfs_alloc_ag_vextent_near()
1292 int error; /* error result */ in xfs_alloc_ag_vextent_size() local
1311 if ((error = xfs_alloc_lookup_ge(cnt_cur, 0, in xfs_alloc_ag_vextent_size()
1324 error = xfs_alloc_ag_vextent_small(args, cnt_cur, in xfs_alloc_ag_vextent_size()
1326 if (error) in xfs_alloc_ag_vextent_size()
1343 error = xfs_alloc_get_rec(cnt_cur, &fbno, &flen, &i); in xfs_alloc_ag_vextent_size()
1344 if (error) in xfs_alloc_ag_vextent_size()
1354 error = xfs_btree_increment(cnt_cur, 0, &i); in xfs_alloc_ag_vextent_size()
1355 if (error) in xfs_alloc_ag_vextent_size()
1398 if ((error = xfs_btree_decrement(cnt_cur, 0, &i))) in xfs_alloc_ag_vextent_size()
1402 if ((error = xfs_alloc_get_rec(cnt_cur, &fbno, &flen, in xfs_alloc_ag_vextent_size()
1423 if ((error = xfs_alloc_lookup_eq(cnt_cur, bestfbno, bestflen, in xfs_alloc_ag_vextent_size()
1457 if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, in xfs_alloc_ag_vextent_size()
1478 return error; in xfs_alloc_ag_vextent_size()
1500 int error; in xfs_alloc_ag_vextent_small() local
1505 if ((error = xfs_btree_decrement(ccur, 0, &i))) in xfs_alloc_ag_vextent_small()
1508 if ((error = xfs_alloc_get_rec(ccur, &fbno, &flen, &i))) in xfs_alloc_ag_vextent_small()
1520 error = xfs_alloc_get_freelist(args->tp, args->agbp, &fbno, 0); in xfs_alloc_ag_vextent_small()
1521 if (error) in xfs_alloc_ag_vextent_small()
1574 return error; in xfs_alloc_ag_vextent_small()
1591 int error; /* error return value */ in xfs_free_ag_extent() local
1614 if ((error = xfs_alloc_lookup_le(bno_cur, bno, len, &haveleft))) in xfs_free_ag_extent()
1620 if ((error = xfs_alloc_get_rec(bno_cur, <bno, <len, &i))) in xfs_free_ag_extent()
1642 if ((error = xfs_btree_increment(bno_cur, 0, &haveright))) in xfs_free_ag_extent()
1648 if ((error = xfs_alloc_get_rec(bno_cur, >bno, >len, &i))) in xfs_free_ag_extent()
1677 if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) in xfs_free_ag_extent()
1680 if ((error = xfs_btree_delete(cnt_cur, &i))) in xfs_free_ag_extent()
1686 if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) in xfs_free_ag_extent()
1689 if ((error = xfs_btree_delete(cnt_cur, &i))) in xfs_free_ag_extent()
1695 if ((error = xfs_btree_delete(bno_cur, &i))) in xfs_free_ag_extent()
1701 if ((error = xfs_btree_decrement(bno_cur, 0, &i))) in xfs_free_ag_extent()
1713 if ((error = xfs_alloc_get_rec(bno_cur, &xxbno, &xxlen, in xfs_free_ag_extent()
1726 if ((error = xfs_alloc_update(bno_cur, nbno, nlen))) in xfs_free_ag_extent()
1737 if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) in xfs_free_ag_extent()
1740 if ((error = xfs_btree_delete(cnt_cur, &i))) in xfs_free_ag_extent()
1747 if ((error = xfs_btree_decrement(bno_cur, 0, &i))) in xfs_free_ag_extent()
1752 if ((error = xfs_alloc_update(bno_cur, nbno, nlen))) in xfs_free_ag_extent()
1763 if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) in xfs_free_ag_extent()
1766 if ((error = xfs_btree_delete(cnt_cur, &i))) in xfs_free_ag_extent()
1775 if ((error = xfs_alloc_update(bno_cur, nbno, nlen))) in xfs_free_ag_extent()
1785 if ((error = xfs_btree_insert(bno_cur, &i))) in xfs_free_ag_extent()
1794 if ((error = xfs_alloc_lookup_eq(cnt_cur, nbno, nlen, &i))) in xfs_free_ag_extent()
1797 if ((error = xfs_btree_insert(cnt_cur, &i))) in xfs_free_ag_extent()
1807 error = xfs_alloc_update_counters(tp, pag, agbp, len); in xfs_free_ag_extent()
1809 if (error) in xfs_free_ag_extent()
1827 return error; in xfs_free_ag_extent()
1943 int error = 0; in xfs_alloc_fix_freelist() local
1946 error = xfs_alloc_read_agf(mp, tp, args->agno, flags, &agbp); in xfs_alloc_fix_freelist()
1947 if (error) in xfs_alloc_fix_freelist()
1976 error = xfs_alloc_read_agf(mp, tp, args->agno, flags, &agbp); in xfs_alloc_fix_freelist()
1977 if (error) in xfs_alloc_fix_freelist()
2010 error = xfs_alloc_get_freelist(tp, agbp, &bno, 0); in xfs_alloc_fix_freelist()
2011 if (error) in xfs_alloc_fix_freelist()
2013 error = xfs_free_ag_extent(tp, agbp, args->agno, bno, 1, 1); in xfs_alloc_fix_freelist()
2014 if (error) in xfs_alloc_fix_freelist()
2028 error = xfs_alloc_read_agfl(mp, tp, targs.agno, &agflbp); in xfs_alloc_fix_freelist()
2029 if (error) in xfs_alloc_fix_freelist()
2038 error = xfs_alloc_ag_vextent(&targs); in xfs_alloc_fix_freelist()
2039 if (error) in xfs_alloc_fix_freelist()
2056 error = xfs_alloc_put_freelist(tp, agbp, in xfs_alloc_fix_freelist()
2058 if (error) in xfs_alloc_fix_freelist()
2073 return error; in xfs_alloc_fix_freelist()
2091 int error; in xfs_alloc_get_freelist() local
2107 error = xfs_alloc_read_agfl(mp, tp, be32_to_cpu(agf->agf_seqno), in xfs_alloc_get_freelist()
2109 if (error) in xfs_alloc_get_freelist()
2110 return error; in xfs_alloc_get_freelist()
2189 int error; in xfs_alloc_pagf_init() local
2191 if ((error = xfs_alloc_read_agf(mp, tp, agno, flags, &bp))) in xfs_alloc_pagf_init()
2192 return error; in xfs_alloc_pagf_init()
2211 int error; in xfs_alloc_put_freelist() local
2221 if (!agflbp && (error = xfs_alloc_read_agfl(mp, tp, in xfs_alloc_put_freelist()
2223 return error; in xfs_alloc_put_freelist()
2359 int error; in xfs_read_agf() local
2364 error = xfs_trans_read_buf( in xfs_read_agf()
2368 if (error) in xfs_read_agf()
2369 return error; in xfs_read_agf()
2391 int error; in xfs_alloc_read_agf() local
2396 error = xfs_read_agf(mp, tp, agno, in xfs_alloc_read_agf()
2399 if (error) in xfs_alloc_read_agf()
2400 return error; in xfs_alloc_read_agf()
2447 int error; in xfs_alloc_vextent() local
2495 error = xfs_alloc_fix_freelist(args, 0); in xfs_alloc_vextent()
2497 if (error) { in xfs_alloc_vextent()
2506 if ((error = xfs_alloc_ag_vextent(args))) in xfs_alloc_vextent()
2562 error = xfs_alloc_fix_freelist(args, flags); in xfs_alloc_vextent()
2564 if (error) { in xfs_alloc_vextent()
2572 if ((error = xfs_alloc_ag_vextent(args))) in xfs_alloc_vextent()
2648 error = xfs_zero_extent(args->ip, args->fsbno, args->len); in xfs_alloc_vextent()
2649 if (error) in xfs_alloc_vextent()
2658 return error; in xfs_alloc_vextent()
2673 int error; in xfs_free_extent() local
2695 error = xfs_alloc_fix_freelist(&args, XFS_ALLOC_FLAG_FREEING); in xfs_free_extent()
2696 if (error) in xfs_free_extent()
2702 error = -EFSCORRUPTED; in xfs_free_extent()
2706 error = xfs_free_ag_extent(tp, args.agbp, args.agno, args.agbno, len, 0); in xfs_free_extent()
2707 if (!error) in xfs_free_extent()
2711 return error; in xfs_free_extent()