Lines Matching refs:error
140 int error; in xfs_reflink_find_shared() local
142 error = xfs_alloc_read_agf(pag, tp, 0, &agbp); in xfs_reflink_find_shared()
143 if (error) in xfs_reflink_find_shared()
144 return error; in xfs_reflink_find_shared()
148 error = xfs_refcount_find_shared(cur, agbno, aglen, fbno, flen, in xfs_reflink_find_shared()
151 xfs_btree_del_cursor(cur, error); in xfs_reflink_find_shared()
154 return error; in xfs_reflink_find_shared()
179 int error = 0; in xfs_reflink_trim_around_shared() local
193 error = xfs_reflink_find_shared(pag, NULL, agbno, aglen, &fbno, &flen, in xfs_reflink_trim_around_shared()
196 if (error) in xfs_reflink_trim_around_shared()
197 return error; in xfs_reflink_trim_around_shared()
254 int error = 0; in xfs_reflink_convert_cow_locked() local
272 error = xfs_bmap_add_extent_unwritten_real(NULL, ip, in xfs_reflink_convert_cow_locked()
275 if (error) in xfs_reflink_convert_cow_locked()
276 return error; in xfs_reflink_convert_cow_locked()
279 return error; in xfs_reflink_convert_cow_locked()
293 int error; in xfs_reflink_convert_cow() local
298 error = xfs_reflink_convert_cow_locked(ip, offset_fsb, count_fsb); in xfs_reflink_convert_cow()
300 return error; in xfs_reflink_convert_cow()
355 int error; in xfs_reflink_convert_unwritten() local
372 error = xfs_reflink_convert_cow_locked(ip, offset_fsb, count_fsb); in xfs_reflink_convert_unwritten()
373 if (!error) in xfs_reflink_convert_unwritten()
376 return error; in xfs_reflink_convert_unwritten()
393 int error; in xfs_reflink_fill_cow_hole() local
403 error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_write, resblks, 0, in xfs_reflink_fill_cow_hole()
405 if (error) in xfs_reflink_fill_cow_hole()
406 return error; in xfs_reflink_fill_cow_hole()
410 error = xfs_find_trim_cow_extent(ip, imap, cmap, shared, &found); in xfs_reflink_fill_cow_hole()
411 if (error || !*shared) in xfs_reflink_fill_cow_hole()
421 error = xfs_bmapi_write(tp, ip, imap->br_startoff, imap->br_blockcount, in xfs_reflink_fill_cow_hole()
424 if (error) in xfs_reflink_fill_cow_hole()
428 error = xfs_trans_commit(tp); in xfs_reflink_fill_cow_hole()
429 if (error) in xfs_reflink_fill_cow_hole()
430 return error; in xfs_reflink_fill_cow_hole()
444 return error; in xfs_reflink_fill_cow_hole()
459 int error; in xfs_reflink_fill_delalloc() local
466 error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_write, 0, 0, in xfs_reflink_fill_delalloc()
468 if (error) in xfs_reflink_fill_delalloc()
469 return error; in xfs_reflink_fill_delalloc()
473 error = xfs_find_trim_cow_extent(ip, imap, cmap, shared, in xfs_reflink_fill_delalloc()
475 if (error || !*shared) in xfs_reflink_fill_delalloc()
490 error = xfs_bmapi_write(tp, ip, cmap->br_startoff, in xfs_reflink_fill_delalloc()
494 if (error) in xfs_reflink_fill_delalloc()
498 error = xfs_trans_commit(tp); in xfs_reflink_fill_delalloc()
499 if (error) in xfs_reflink_fill_delalloc()
500 return error; in xfs_reflink_fill_delalloc()
514 return error; in xfs_reflink_fill_delalloc()
527 int error; in xfs_reflink_allocate_cow() local
536 error = xfs_find_trim_cow_extent(ip, imap, cmap, shared, &found); in xfs_reflink_allocate_cow()
537 if (error || !*shared) in xfs_reflink_allocate_cow()
538 return error; in xfs_reflink_allocate_cow()
587 int error = 0; in xfs_reflink_cancel_cow_blocks() local
608 error = xfs_bmap_del_extent_delay(ip, XFS_COW_FORK, in xfs_reflink_cancel_cow_blocks()
610 if (error) in xfs_reflink_cancel_cow_blocks()
619 error = xfs_free_extent_later(*tpp, del.br_startblock, in xfs_reflink_cancel_cow_blocks()
622 if (error) in xfs_reflink_cancel_cow_blocks()
626 error = xfs_defer_finish(tpp); in xfs_reflink_cancel_cow_blocks()
627 if (error) in xfs_reflink_cancel_cow_blocks()
634 error = xfs_quota_unreserve_blkres(ip, in xfs_reflink_cancel_cow_blocks()
636 if (error) in xfs_reflink_cancel_cow_blocks()
650 return error; in xfs_reflink_cancel_cow_blocks()
669 int error; in xfs_reflink_cancel_cow_range() local
681 error = xfs_trans_alloc(ip->i_mount, &M_RES(ip->i_mount)->tr_write, in xfs_reflink_cancel_cow_range()
683 if (error) in xfs_reflink_cancel_cow_range()
690 error = xfs_reflink_cancel_cow_blocks(ip, &tp, offset_fsb, end_fsb, in xfs_reflink_cancel_cow_range()
692 if (error) in xfs_reflink_cancel_cow_range()
695 error = xfs_trans_commit(tp); in xfs_reflink_cancel_cow_range()
698 return error; in xfs_reflink_cancel_cow_range()
704 trace_xfs_reflink_cancel_cow_range_error(ip, error, _RET_IP_); in xfs_reflink_cancel_cow_range()
705 return error; in xfs_reflink_cancel_cow_range()
731 int error; in xfs_reflink_end_cow_extent() local
740 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, 0, in xfs_reflink_end_cow_extent()
742 if (error) in xfs_reflink_end_cow_extent()
743 return error; in xfs_reflink_end_cow_extent()
753 error = xfs_iext_count_may_overflow(ip, XFS_DATA_FORK, in xfs_reflink_end_cow_extent()
755 if (error == -EFBIG) in xfs_reflink_end_cow_extent()
756 error = xfs_iext_count_upgrade(tp, ip, in xfs_reflink_end_cow_extent()
758 if (error) in xfs_reflink_end_cow_extent()
791 error = xfs_bmapi_read(ip, del.br_startoff, del.br_blockcount, &data, in xfs_reflink_end_cow_extent()
793 if (error) in xfs_reflink_end_cow_extent()
821 error = xfs_bunmapi(NULL, ip, data.br_startoff, in xfs_reflink_end_cow_extent()
823 if (error) in xfs_reflink_end_cow_extent()
841 error = xfs_trans_commit(tp); in xfs_reflink_end_cow_extent()
843 if (error) in xfs_reflink_end_cow_extent()
844 return error; in xfs_reflink_end_cow_extent()
853 return error; in xfs_reflink_end_cow_extent()
867 int error = 0; in xfs_reflink_end_cow() local
906 while (end_fsb > offset_fsb && !error) in xfs_reflink_end_cow()
907 error = xfs_reflink_end_cow_extent(ip, &offset_fsb, end_fsb); in xfs_reflink_end_cow()
909 if (error) in xfs_reflink_end_cow()
910 trace_xfs_reflink_end_cow_error(ip, error, _RET_IP_); in xfs_reflink_end_cow()
911 return error; in xfs_reflink_end_cow()
926 int error = 0; in xfs_reflink_recover_cow() local
932 error = xfs_refcount_recover_cow_leftovers(mp, pag); in xfs_reflink_recover_cow()
933 if (error) { in xfs_reflink_recover_cow()
939 return error; in xfs_reflink_recover_cow()
1027 int error; in xfs_reflink_set_inode_flag() local
1033 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp); in xfs_reflink_set_inode_flag()
1034 if (error) in xfs_reflink_set_inode_flag()
1065 error = xfs_trans_commit(tp); in xfs_reflink_set_inode_flag()
1066 if (error) in xfs_reflink_set_inode_flag()
1068 return error; in xfs_reflink_set_inode_flag()
1071 trace_xfs_reflink_set_inode_flag_error(dest, error, _RET_IP_); in xfs_reflink_set_inode_flag()
1072 return error; in xfs_reflink_set_inode_flag()
1087 int error; in xfs_reflink_update_dest() local
1092 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp); in xfs_reflink_update_dest()
1093 if (error) in xfs_reflink_update_dest()
1112 error = xfs_trans_commit(tp); in xfs_reflink_update_dest()
1113 if (error) in xfs_reflink_update_dest()
1115 return error; in xfs_reflink_update_dest()
1118 trace_xfs_reflink_update_inode_size_error(dest, error, _RET_IP_); in xfs_reflink_update_dest()
1119 return error; in xfs_reflink_update_dest()
1134 int error = 0; in xfs_reflink_ag_has_free_space() local
1142 error = -ENOSPC; in xfs_reflink_ag_has_free_space()
1144 return error; in xfs_reflink_ag_has_free_space()
1168 int error; in xfs_reflink_remap_extent() local
1192 error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_write, in xfs_reflink_remap_extent()
1194 if (error == -EDQUOT || error == -ENOSPC) { in xfs_reflink_remap_extent()
1196 error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_write, in xfs_reflink_remap_extent()
1199 if (error) in xfs_reflink_remap_extent()
1208 error = xfs_bmapi_read(ip, dmap->br_startoff, dmap->br_blockcount, in xfs_reflink_remap_extent()
1210 if (error) in xfs_reflink_remap_extent()
1231 error = -EFSCORRUPTED; in xfs_reflink_remap_extent()
1242 error = xfs_reflink_ag_has_free_space(mp, in xfs_reflink_remap_extent()
1244 if (error) in xfs_reflink_remap_extent()
1271 error = xfs_trans_reserve_quota_nblks(tp, ip, in xfs_reflink_remap_extent()
1273 if (error) in xfs_reflink_remap_extent()
1283 error = xfs_iext_count_may_overflow(ip, XFS_DATA_FORK, iext_delta); in xfs_reflink_remap_extent()
1284 if (error == -EFBIG) in xfs_reflink_remap_extent()
1285 error = xfs_iext_count_upgrade(tp, ip, iext_delta); in xfs_reflink_remap_extent()
1286 if (error) in xfs_reflink_remap_extent()
1306 error = xfs_bunmapi(NULL, ip, smap.br_startoff, in xfs_reflink_remap_extent()
1308 if (error) in xfs_reflink_remap_extent()
1336 error = xfs_trans_commit(tp); in xfs_reflink_remap_extent()
1344 if (error) in xfs_reflink_remap_extent()
1345 trace_xfs_reflink_remap_extent_error(ip, error, _RET_IP_); in xfs_reflink_remap_extent()
1346 return error; in xfs_reflink_remap_extent()
1367 int error = 0; in xfs_reflink_remap_blocks() local
1380 error = xfs_bmapi_read(src, srcoff, len, &imap, &nimaps, 0); in xfs_reflink_remap_blocks()
1382 if (error) in xfs_reflink_remap_blocks()
1394 error = -EFSCORRUPTED; in xfs_reflink_remap_blocks()
1402 error = xfs_reflink_remap_extent(dest, &imap, new_isize); in xfs_reflink_remap_blocks()
1403 if (error) in xfs_reflink_remap_blocks()
1407 error = -EINTR; in xfs_reflink_remap_blocks()
1418 if (error) in xfs_reflink_remap_blocks()
1419 trace_xfs_reflink_remap_blocks_error(dest, error, _RET_IP_); in xfs_reflink_remap_blocks()
1422 return error; in xfs_reflink_remap_blocks()
1566 int error; in xfs_reflink_inode_has_shared_extents() local
1569 error = xfs_iread_extents(tp, ip, XFS_DATA_FORK); in xfs_reflink_inode_has_shared_extents()
1570 if (error) in xfs_reflink_inode_has_shared_extents()
1571 return error; in xfs_reflink_inode_has_shared_extents()
1589 error = xfs_reflink_find_shared(pag, tp, agbno, aglen, in xfs_reflink_inode_has_shared_extents()
1592 if (error) in xfs_reflink_inode_has_shared_extents()
1593 return error; in xfs_reflink_inode_has_shared_extents()
1619 int error = 0; in xfs_reflink_clear_inode_flag() local
1623 error = xfs_reflink_inode_has_shared_extents(*tpp, ip, &needs_flag); in xfs_reflink_clear_inode_flag()
1624 if (error || needs_flag) in xfs_reflink_clear_inode_flag()
1625 return error; in xfs_reflink_clear_inode_flag()
1631 error = xfs_reflink_cancel_cow_blocks(ip, tpp, 0, XFS_MAX_FILEOFF, in xfs_reflink_clear_inode_flag()
1633 if (error) in xfs_reflink_clear_inode_flag()
1634 return error; in xfs_reflink_clear_inode_flag()
1642 return error; in xfs_reflink_clear_inode_flag()
1655 int error = 0; in xfs_reflink_try_clear_inode_flag() local
1658 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, 0, 0, 0, &tp); in xfs_reflink_try_clear_inode_flag()
1659 if (error) in xfs_reflink_try_clear_inode_flag()
1660 return error; in xfs_reflink_try_clear_inode_flag()
1665 error = xfs_reflink_clear_inode_flag(ip, &tp); in xfs_reflink_try_clear_inode_flag()
1666 if (error) in xfs_reflink_try_clear_inode_flag()
1669 error = xfs_trans_commit(tp); in xfs_reflink_try_clear_inode_flag()
1670 if (error) in xfs_reflink_try_clear_inode_flag()
1679 return error; in xfs_reflink_try_clear_inode_flag()
1693 int error; in xfs_reflink_unshare() local
1703 error = dax_file_unshare(inode, offset, len, in xfs_reflink_unshare()
1706 error = iomap_file_unshare(inode, offset, len, in xfs_reflink_unshare()
1708 if (error) in xfs_reflink_unshare()
1711 error = filemap_write_and_wait_range(inode->i_mapping, offset, in xfs_reflink_unshare()
1713 if (error) in xfs_reflink_unshare()
1717 error = xfs_reflink_try_clear_inode_flag(ip); in xfs_reflink_unshare()
1718 if (error) in xfs_reflink_unshare()
1723 trace_xfs_reflink_unshare_error(ip, error, _RET_IP_); in xfs_reflink_unshare()
1724 return error; in xfs_reflink_unshare()