Lines Matching defs:error

105 STATIC int				/* error */
115 STATIC int /* error */
152 * This either works (return 0) or gets an EFSCORRUPTED error.
326 int error; /* error return value */
367 error = xfs_btree_read_bufl(mp, NULL, bno, &bp,
370 if (error)
386 error = -EFSCORRUPTED;
453 error = xfs_btree_read_bufl(mp, NULL, bno, &bp,
456 if (error)
533 STATIC int /* error */
547 int error; /* error return value */
568 error = xfs_btree_read_bufl(mp, tp, cbno, &cbp, XFS_BMAP_BTREE_REF,
570 if (error)
571 return error;
573 if ((error = xfs_btree_check_block(cur, cblock, 0, cbp)))
574 return error;
577 error = xfs_free_extent_later(cur->bc_tp, cbno, 1, &oinfo,
579 if (error)
580 return error;
598 STATIC int /* error */
613 int error; /* error return value */
657 error = xfs_alloc_vextent_start_ag(&args,
659 if (error)
666 error = -ENOSPC;
673 error = xfs_trans_get_buf(tp, mp->m_ddev_targp,
676 if (error)
727 return error;
757 STATIC int /* error */
769 int error = 0;
792 error = 0;
806 error = xfs_alloc_vextent_start_ag(&args,
808 if (error)
814 error = xfs_trans_get_buf(tp, args.mp->m_ddev_targp,
817 if (error)
852 return error;
858 STATIC int /* error */
866 int error; /* error return value */
876 error = xfs_bmbt_lookup_first(cur, &stat);
877 if (error)
881 error = -EFSCORRUPTED;
884 if ((error = xfs_btree_new_iroot(cur, flags, &stat)))
896 return error;
902 STATIC int /* error */
909 int error; /* error return value */
915 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0, flags,
919 xfs_btree_del_cursor(cur, error);
921 return error;
935 STATIC int /* error */
1002 int /* error code */
1013 int error; /* error return value */
1022 error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_addafork, blks, 0,
1024 if (error)
1025 return error;
1030 error = xfs_bmap_set_attrforkoff(ip, size, &version);
1031 if (error)
1038 error = xfs_bmap_add_attrfork_local(tp, ip, &logflags);
1041 error = xfs_bmap_add_attrfork_extents(tp, ip, &logflags);
1044 error = xfs_bmap_add_attrfork_btree(tp, ip, &logflags);
1047 error = 0;
1052 if (error)
1072 error = xfs_trans_commit(tp);
1074 return error;
1079 return error;
1187 int error;
1197 error = xfs_btree_visit_blocks(cur, xfs_iread_bmbt_block,
1199 xfs_btree_del_cursor(cur, error);
1200 if (error)
1204 error = -EFSCORRUPTED;
1217 return error;
1226 int /* error */
1239 int error;
1248 error = xfs_iread_extents(tp, ip, whichfork);
1249 if (error)
1250 return error;
1274 int /* error */
1284 int error;
1298 error = xfs_iread_extents(tp, ip, whichfork);
1299 if (error)
1300 return error;
1317 int error;
1319 error = xfs_iread_extents(tp, ip, whichfork);
1320 if (error)
1321 return error;
1347 int error;
1350 error = xfs_bmap_last_extent(NULL, bma->ip, whichfork, &rec,
1352 if (error)
1353 return error;
1384 int error;
1394 error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, &is_empty);
1395 if (error || is_empty)
1396 return error;
1409 STATIC int /* error */
1417 int error; /* error return value */
1503 error = 0;
1527 error = xfs_bmbt_lookup_eq(bma->cur, &RIGHT, &i);
1528 if (error)
1531 error = -EFSCORRUPTED;
1534 error = xfs_btree_delete(bma->cur, &i);
1535 if (error)
1538 error = -EFSCORRUPTED;
1541 error = xfs_btree_decrement(bma->cur, 0, &i);
1542 if (error)
1545 error = -EFSCORRUPTED;
1548 error = xfs_bmbt_update(bma->cur, &LEFT);
1549 if (error)
1570 error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
1571 if (error)
1574 error = -EFSCORRUPTED;
1577 error = xfs_bmbt_update(bma->cur, &LEFT);
1578 if (error)
1603 error = xfs_bmbt_lookup_eq(bma->cur, &RIGHT, &i);
1604 if (error)
1607 error = -EFSCORRUPTED;
1610 error = xfs_bmbt_update(bma->cur, &PREV);
1611 if (error)
1631 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1632 if (error)
1635 error = -EFSCORRUPTED;
1638 error = xfs_btree_insert(bma->cur, &i);
1639 if (error)
1642 error = -EFSCORRUPTED;
1672 error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
1673 if (error)
1676 error = -EFSCORRUPTED;
1679 error = xfs_bmbt_update(bma->cur, &LEFT);
1680 if (error)
1697 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1698 if (error)
1701 error = -EFSCORRUPTED;
1704 error = xfs_btree_insert(bma->cur, &i);
1705 if (error)
1708 error = -EFSCORRUPTED;
1714 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip,
1717 if (error)
1748 error = xfs_bmbt_lookup_eq(bma->cur, &old, &i);
1749 if (error)
1752 error = -EFSCORRUPTED;
1755 error = xfs_bmbt_update(bma->cur, &RIGHT);
1756 if (error)
1784 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1785 if (error)
1788 error = -EFSCORRUPTED;
1791 error = xfs_btree_insert(bma->cur, &i);
1792 if (error)
1795 error = -EFSCORRUPTED;
1801 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip,
1804 if (error)
1870 error = xfs_bmbt_lookup_eq(bma->cur, new, &i);
1871 if (error)
1874 error = -EFSCORRUPTED;
1877 error = xfs_btree_insert(bma->cur, &i);
1878 if (error)
1881 error = -EFSCORRUPTED;
1887 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip,
1890 if (error)
1920 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip,
1924 if (error)
1939 error = xfs_mod_fdblocks(mp, (int64_t)(da_old - da_new),
1947 return error;
1956 int /* error */
1967 int error; /* error return value */
1994 error = 0;
2073 error = xfs_bmbt_lookup_eq(cur, &RIGHT, &i);
2074 if (error)
2077 error = -EFSCORRUPTED;
2080 if ((error = xfs_btree_delete(cur, &i)))
2083 error = -EFSCORRUPTED;
2086 if ((error = xfs_btree_decrement(cur, 0, &i)))
2089 error = -EFSCORRUPTED;
2092 if ((error = xfs_btree_delete(cur, &i)))
2095 error = -EFSCORRUPTED;
2098 if ((error = xfs_btree_decrement(cur, 0, &i)))
2101 error = -EFSCORRUPTED;
2104 error = xfs_bmbt_update(cur, &LEFT);
2105 if (error)
2125 error = xfs_bmbt_lookup_eq(cur, &PREV, &i);
2126 if (error)
2129 error = -EFSCORRUPTED;
2132 if ((error = xfs_btree_delete(cur, &i)))
2135 error = -EFSCORRUPTED;
2138 if ((error = xfs_btree_decrement(cur, 0, &i)))
2141 error = -EFSCORRUPTED;
2144 error = xfs_bmbt_update(cur, &LEFT);
2145 if (error)
2168 error = xfs_bmbt_lookup_eq(cur, &RIGHT, &i);
2169 if (error)
2172 error = -EFSCORRUPTED;
2175 if ((error = xfs_btree_delete(cur, &i)))
2178 error = -EFSCORRUPTED;
2181 if ((error = xfs_btree_decrement(cur, 0, &i)))
2184 error = -EFSCORRUPTED;
2187 error = xfs_bmbt_update(cur, &PREV);
2188 if (error)
2206 error = xfs_bmbt_lookup_eq(cur, new, &i);
2207 if (error)
2210 error = -EFSCORRUPTED;
2213 error = xfs_bmbt_update(cur, &PREV);
2214 if (error)
2239 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2240 if (error)
2243 error = -EFSCORRUPTED;
2246 error = xfs_bmbt_update(cur, &PREV);
2247 if (error)
2249 error = xfs_btree_decrement(cur, 0, &i);
2250 if (error)
2252 error = xfs_bmbt_update(cur, &LEFT);
2253 if (error)
2276 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2277 if (error)
2280 error = -EFSCORRUPTED;
2283 error = xfs_bmbt_update(cur, &PREV);
2284 if (error)
2287 if ((error = xfs_btree_insert(cur, &i)))
2290 error = -EFSCORRUPTED;
2316 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2317 if (error)
2320 error = -EFSCORRUPTED;
2323 error = xfs_bmbt_update(cur, &PREV);
2324 if (error)
2326 error = xfs_btree_increment(cur, 0, &i);
2327 if (error)
2329 error = xfs_bmbt_update(cur, &RIGHT);
2330 if (error)
2352 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2353 if (error)
2356 error = -EFSCORRUPTED;
2359 error = xfs_bmbt_update(cur, &PREV);
2360 if (error)
2362 error = xfs_bmbt_lookup_eq(cur, new, &i);
2363 if (error)
2366 error = -EFSCORRUPTED;
2369 if ((error = xfs_btree_insert(cur, &i)))
2372 error = -EFSCORRUPTED;
2404 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2405 if (error)
2408 error = -EFSCORRUPTED;
2412 error = xfs_bmbt_update(cur, &r[1]);
2413 if (error)
2417 if ((error = xfs_btree_insert(cur, &i)))
2420 error = -EFSCORRUPTED;
2428 error = xfs_bmbt_lookup_eq(cur, new, &i);
2429 if (error)
2432 error = -EFSCORRUPTED;
2436 if ((error = xfs_btree_insert(cur, &i)))
2439 error = -EFSCORRUPTED;
2466 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
2469 if (error)
2482 return error;
2631 STATIC int /* error */
2645 int error; /* error return value */
2698 error = 0;
2720 error = xfs_bmbt_lookup_eq(cur, &right, &i);
2721 if (error)
2724 error = -EFSCORRUPTED;
2727 error = xfs_btree_delete(cur, &i);
2728 if (error)
2731 error = -EFSCORRUPTED;
2734 error = xfs_btree_decrement(cur, 0, &i);
2735 if (error)
2738 error = -EFSCORRUPTED;
2741 error = xfs_bmbt_update(cur, &left);
2742 if (error)
2763 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2764 if (error)
2767 error = -EFSCORRUPTED;
2770 error = xfs_bmbt_update(cur, &left);
2771 if (error)
2793 error = xfs_bmbt_lookup_eq(cur, &old, &i);
2794 if (error)
2797 error = -EFSCORRUPTED;
2800 error = xfs_bmbt_update(cur, &right);
2801 if (error)
2819 error = xfs_bmbt_lookup_eq(cur, new, &i);
2820 if (error)
2823 error = -EFSCORRUPTED;
2826 error = xfs_btree_insert(cur, &i);
2827 if (error)
2830 error = -EFSCORRUPTED;
2846 error = xfs_bmap_extents_to_btree(tp, ip, curp, 0,
2850 if (error)
2861 return error;
3185 int error = 0;
3188 error = xfs_alloc_read_agf(pag, tp, XFS_ALLOC_FLAG_TRYLOCK,
3190 if (error)
3191 return error;
3236 int error = 0;
3251 error = xfs_bmap_longest_free_extent(pag, args->tp, blen);
3252 if (error && error != -EAGAIN)
3254 error = 0;
3262 return error;
3395 int error;
3434 error = xfs_alloc_vextent_first_ag(&args, ap->blkno);
3435 if (error)
3436 return error;
3472 int error;
3501 error = xfs_alloc_vextent_exact_bno(args, ap->blkno);
3506 if (error)
3507 return error;
3531 error = xfs_alloc_vextent_near_bno(args, ap->blkno);
3534 error = xfs_alloc_vextent_start_ag(args, ap->blkno);
3538 if (error)
3539 return error;
3570 int error;
3574 error = xfs_alloc_vextent_start_ag(args, ap->blkno);
3575 if (error || args->fsbno != NULLFSBLOCK)
3576 return error;
3581 error = xfs_alloc_vextent_first_ag(args, 0);
3582 if (error)
3583 return error;
3595 int error = 0;
3598 error = xfs_filestream_select_ag(ap, args, &blen);
3599 if (error)
3600 return error;
3616 error = xfs_bmap_btalloc_at_eof(ap, args, blen, stripe_align,
3619 if (!error && args->fsbno == NULLFSBLOCK)
3620 error = xfs_alloc_vextent_near_bno(args, ap->blkno);
3626 * we've either succeeded, had a fatal error or we are out of space and
3632 if (error || args->fsbno != NULLFSBLOCK)
3633 return error;
3645 int error;
3655 error = xfs_bmap_btalloc_select_lengths(ap, args, &blen);
3656 if (error)
3657 return error;
3666 error = xfs_bmap_btalloc_at_eof(ap, args, blen, stripe_align,
3668 if (error || args->fsbno != NULLFSBLOCK)
3669 return error;
3672 error = xfs_alloc_vextent_start_ag(args, ap->blkno);
3673 if (error || args->fsbno != NULLFSBLOCK)
3674 return error;
3698 int error;
3712 error = xfs_bmap_btalloc_filestreams(ap, &args, stripe_align);
3714 error = xfs_bmap_btalloc_best_length(ap, &args, stripe_align);
3715 if (error)
3716 return error;
3880 int error;
3900 error = xfs_iread_extents(NULL, ip, whichfork);
3901 if (error)
3902 return error;
3971 int error;
3992 error = xfs_bmap_extsize_align(mp, got, &prev, extsz, 0, eof,
3994 ASSERT(!error);
4002 error = xfs_quota_reserve_blkres(ip, alen);
4003 if (error)
4004 return error;
4013 error = xfs_mod_fdblocks(mp, -((int64_t)alen), false);
4014 if (error)
4017 error = xfs_mod_fdblocks(mp, -((int64_t)indlen), false);
4018 if (error)
4049 return error;
4058 int error;
4073 error = xfs_bmap_isaeof(bma, whichfork);
4074 if (error)
4075 return error;
4097 int error;
4125 error = xfs_bmap_exact_minlen_extent_alloc(bma);
4127 error = xfs_bmap_btalloc(bma);
4129 error = xfs_bmap_alloc_userdata(bma);
4131 if (error || bma->blkno == NULLFSBLOCK)
4132 return error;
4135 error = xfs_zero_extent(bma->ip, bma->blkno, bma->length);
4136 if (error)
4137 return error;
4161 error = xfs_bmap_add_extent_delay_real(bma, whichfork);
4163 error = xfs_bmap_add_extent_hole_real(bma->tp, bma->ip,
4168 if (error)
4169 return error;
4196 int error;
4225 error = xfs_zero_extent(bma->ip, mval->br_startblock,
4227 if (error)
4228 return error;
4231 error = xfs_bmap_add_extent_unwritten_real(bma->tp, bma->ip, whichfork,
4246 if (error)
4247 return error;
4281 * Log whatever the flags say, even if error. Otherwise we might miss detecting
4282 * a case where the data is changed, there's an error, and it's not logged so we
4290 int error)
4304 xfs_btree_del_cursor(bma->cur, error);
4334 int error; /* error return */
4382 error = xfs_iread_extents(tp, ip, whichfork);
4383 if (error)
4438 error = xfs_bmapi_allocate(&bma);
4439 if (error)
4458 error = xfs_bmapi_convert_unwritten(&bma, mval, len, flags);
4459 if (error == -EAGAIN)
4461 if (error)
4482 error = xfs_bmap_btree_to_extents(tp, ip, bma.cur, &bma.logflags,
4484 if (error)
4494 xfs_bmapi_finish(&bma, whichfork, error);
4495 return error;
4518 int error;
4527 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, 0, 0,
4529 if (error)
4530 return error;
4535 error = xfs_iext_count_may_overflow(ip, whichfork,
4537 if (error == -EFBIG)
4538 error = xfs_iext_count_upgrade(tp, ip,
4540 if (error)
4551 error = -EAGAIN;
4594 error = xfs_bmapi_allocate(&bma);
4595 if (error)
4598 error = -ENOSPC;
4601 error = -EFSCORRUPTED;
4616 error = xfs_bmap_btree_to_extents(tp, ip, bma.cur, &bma.logflags,
4618 if (error)
4622 error = xfs_trans_commit(tp);
4624 return error;
4627 xfs_bmapi_finish(&bma, whichfork, error);
4631 return error;
4649 int logflags = 0, error;
4668 error = xfs_iread_extents(tp, ip, whichfork);
4669 if (error)
4670 return error;
4694 error = xfs_bmap_add_extent_hole_real(tp, ip, whichfork, &icur,
4696 if (error)
4699 error = xfs_bmap_btree_to_extents(tp, ip, cur, &logflags, whichfork);
4710 xfs_btree_del_cursor(cur, error);
4711 return error;
4814 int error = 0;
4842 error = xfs_quota_unreserve_blkres(ip, del->br_blockcount);
4843 if (error)
4844 return error;
4924 return error;
5002 STATIC int /* error */
5016 int error; /* error return value */
5042 error = 0;
5061 error = xfs_rtfree_blocks(tp, del->br_startblock,
5063 if (error)
5077 error = xfs_bmbt_lookup_eq(cur, &got, &i);
5078 if (error)
5081 error = -EFSCORRUPTED;
5105 if ((error = xfs_btree_delete(cur, &i)))
5108 error = -EFSCORRUPTED;
5124 error = xfs_bmbt_update(cur, &got);
5125 if (error)
5138 error = xfs_bmbt_update(cur, &got);
5139 if (error)
5159 error = xfs_bmbt_update(cur, &got);
5160 if (error)
5162 error = xfs_btree_increment(cur, 0, &i);
5163 if (error)
5166 error = xfs_btree_insert(cur, &i);
5167 if (error && error != -ENOSPC)
5172 * our state and return the error.
5174 if (error == -ENOSPC) {
5179 error = xfs_bmbt_lookup_eq(cur, &got, &i);
5180 if (error)
5183 error = -EFSCORRUPTED;
5190 error = xfs_bmbt_update(cur, &old);
5191 if (error)
5199 error = -ENOSPC;
5203 error = -EFSCORRUPTED;
5225 error = __xfs_free_extent_later(tp, del->br_startblock,
5230 if (error)
5248 return error;
5257 int /* error */
5268 int error; /* error return value */
5299 error = xfs_iread_extents(tp, ip, whichfork);
5300 if (error)
5301 return error;
5415 error = xfs_bmap_add_extent_unwritten_real(tp, ip,
5418 if (error)
5474 error = xfs_bmap_add_extent_unwritten_real(tp,
5477 if (error)
5483 error = xfs_bmap_add_extent_unwritten_real(tp,
5486 if (error)
5494 error = xfs_bmap_del_extent_delay(ip, whichfork, &icur,
5497 error = xfs_bmap_del_extent_real(ip, tp, &icur, cur,
5503 if (error)
5531 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
5535 error = xfs_bmap_btree_to_extents(tp, ip, cur, &logflags,
5551 * Log inode even in the error case, if the transaction
5557 if (!error)
5559 xfs_btree_del_cursor(cur, error);
5561 return error;
5575 int error;
5577 error = __xfs_bunmapi(tp, ip, bno, &len, flags, nexts);
5579 return error;
5633 int error, i;
5657 error = xfs_bmbt_lookup_eq(cur, got, &i);
5658 if (error)
5659 return error;
5663 error = xfs_btree_delete(cur, &i);
5664 if (error)
5665 return error;
5670 error = xfs_bmbt_lookup_eq(cur, left, &i);
5671 if (error)
5672 return error;
5676 error = xfs_bmbt_update(cur, &new);
5677 if (error)
5678 return error;
5681 error = xfs_bmap_btree_to_extents(tp, ip, cur, logflags, whichfork);
5682 if (error)
5683 return error;
5712 int error, i;
5719 error = xfs_bmbt_lookup_eq(cur, &prev, &i);
5720 if (error)
5721 return error;
5725 error = xfs_bmbt_update(cur, got);
5726 if (error)
5727 return error;
5756 int error = 0;
5769 error = xfs_iread_extents(tp, ip, whichfork);
5770 if (error)
5771 return error;
5783 error = -EFSCORRUPTED;
5790 error = -EINVAL;
5795 error = xfs_bmse_merge(tp, ip, whichfork,
5798 if (error)
5804 error = -EINVAL;
5809 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got,
5811 if (error)
5823 xfs_btree_del_cursor(cur, error);
5826 return error;
5838 int error = 0;
5846 error = xfs_bmap_last_extent(NULL, ip, XFS_DATA_FORK, &got, &is_empty);
5847 if (!error && !is_empty && got.br_startoff >= off &&
5849 error = -EINVAL;
5852 return error;
5871 int error = 0;
5884 error = xfs_iread_extents(tp, ip, whichfork);
5885 if (error)
5886 return error;
5907 error = -EFSCORRUPTED;
5912 error = -EFSCORRUPTED;
5919 error = -EINVAL;
5933 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got,
5935 if (error)
5947 xfs_btree_del_cursor(cur, error);
5950 return error;
5973 int error = 0;
5986 error = xfs_iread_extents(tp, ip, whichfork);
5987 if (error)
5988 return error;
6006 error = xfs_bmbt_lookup_eq(cur, &got, &i);
6007 if (error)
6010 error = -EFSCORRUPTED;
6021 error = xfs_bmbt_update(cur, &got);
6022 if (error)
6033 error = xfs_bmbt_lookup_eq(cur, &new, &i);
6034 if (error)
6037 error = -EFSCORRUPTED;
6040 error = xfs_btree_insert(cur, &i);
6041 if (error)
6044 error = -EFSCORRUPTED;
6056 error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0,
6064 xfs_btree_del_cursor(cur, error);
6069 return error;
6149 int error = 0;
6170 error = xfs_bmapi_remap(tp, bi->bi_owner, bmap->br_startoff,
6175 error = __xfs_bunmapi(tp, bi->bi_owner, bmap->br_startoff,
6180 error = -EFSCORRUPTED;
6183 return error;