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()
790 error = xfs_bmapi_read(ip, del.br_startoff, del.br_blockcount, &data, in xfs_reflink_end_cow_extent()
792 if (error) in xfs_reflink_end_cow_extent()
820 error = xfs_bunmapi(NULL, ip, data.br_startoff, in xfs_reflink_end_cow_extent()
822 if (error) in xfs_reflink_end_cow_extent()
840 error = xfs_trans_commit(tp); in xfs_reflink_end_cow_extent()
842 if (error) in xfs_reflink_end_cow_extent()
843 return error; in xfs_reflink_end_cow_extent()
852 return error; in xfs_reflink_end_cow_extent()
866 int error = 0; in xfs_reflink_end_cow() local
905 while (end_fsb > offset_fsb && !error) in xfs_reflink_end_cow()
906 error = xfs_reflink_end_cow_extent(ip, &offset_fsb, end_fsb); in xfs_reflink_end_cow()
908 if (error) in xfs_reflink_end_cow()
909 trace_xfs_reflink_end_cow_error(ip, error, _RET_IP_); in xfs_reflink_end_cow()
910 return error; in xfs_reflink_end_cow()
925 int error = 0; in xfs_reflink_recover_cow() local
931 error = xfs_refcount_recover_cow_leftovers(mp, pag); in xfs_reflink_recover_cow()
932 if (error) { in xfs_reflink_recover_cow()
938 return error; in xfs_reflink_recover_cow()
1026 int error; in xfs_reflink_set_inode_flag() local
1032 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp); in xfs_reflink_set_inode_flag()
1033 if (error) in xfs_reflink_set_inode_flag()
1064 error = xfs_trans_commit(tp); in xfs_reflink_set_inode_flag()
1065 if (error) in xfs_reflink_set_inode_flag()
1067 return error; in xfs_reflink_set_inode_flag()
1070 trace_xfs_reflink_set_inode_flag_error(dest, error, _RET_IP_); in xfs_reflink_set_inode_flag()
1071 return error; in xfs_reflink_set_inode_flag()
1086 int error; in xfs_reflink_update_dest() local
1091 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_ichange, 0, 0, 0, &tp); in xfs_reflink_update_dest()
1092 if (error) in xfs_reflink_update_dest()
1111 error = xfs_trans_commit(tp); in xfs_reflink_update_dest()
1112 if (error) in xfs_reflink_update_dest()
1114 return error; in xfs_reflink_update_dest()
1117 trace_xfs_reflink_update_inode_size_error(dest, error, _RET_IP_); in xfs_reflink_update_dest()
1118 return error; in xfs_reflink_update_dest()
1133 int error = 0; in xfs_reflink_ag_has_free_space() local
1141 error = -ENOSPC; in xfs_reflink_ag_has_free_space()
1143 return error; in xfs_reflink_ag_has_free_space()
1167 int error; in xfs_reflink_remap_extent() local
1191 error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_write, in xfs_reflink_remap_extent()
1193 if (error == -EDQUOT || error == -ENOSPC) { in xfs_reflink_remap_extent()
1195 error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_write, in xfs_reflink_remap_extent()
1198 if (error) in xfs_reflink_remap_extent()
1207 error = xfs_bmapi_read(ip, dmap->br_startoff, dmap->br_blockcount, in xfs_reflink_remap_extent()
1209 if (error) in xfs_reflink_remap_extent()
1230 error = -EFSCORRUPTED; in xfs_reflink_remap_extent()
1241 error = xfs_reflink_ag_has_free_space(mp, in xfs_reflink_remap_extent()
1243 if (error) in xfs_reflink_remap_extent()
1270 error = xfs_trans_reserve_quota_nblks(tp, ip, in xfs_reflink_remap_extent()
1272 if (error) in xfs_reflink_remap_extent()
1282 error = xfs_iext_count_may_overflow(ip, XFS_DATA_FORK, iext_delta); in xfs_reflink_remap_extent()
1283 if (error == -EFBIG) in xfs_reflink_remap_extent()
1284 error = xfs_iext_count_upgrade(tp, ip, iext_delta); in xfs_reflink_remap_extent()
1285 if (error) in xfs_reflink_remap_extent()
1305 error = xfs_bunmapi(NULL, ip, smap.br_startoff, in xfs_reflink_remap_extent()
1307 if (error) in xfs_reflink_remap_extent()
1335 error = xfs_trans_commit(tp); in xfs_reflink_remap_extent()
1343 if (error) in xfs_reflink_remap_extent()
1344 trace_xfs_reflink_remap_extent_error(ip, error, _RET_IP_); in xfs_reflink_remap_extent()
1345 return error; in xfs_reflink_remap_extent()
1366 int error = 0; in xfs_reflink_remap_blocks() local
1379 error = xfs_bmapi_read(src, srcoff, len, &imap, &nimaps, 0); in xfs_reflink_remap_blocks()
1381 if (error) in xfs_reflink_remap_blocks()
1393 error = -EFSCORRUPTED; in xfs_reflink_remap_blocks()
1401 error = xfs_reflink_remap_extent(dest, &imap, new_isize); in xfs_reflink_remap_blocks()
1402 if (error) in xfs_reflink_remap_blocks()
1406 error = -EINTR; in xfs_reflink_remap_blocks()
1417 if (error) in xfs_reflink_remap_blocks()
1418 trace_xfs_reflink_remap_blocks_error(dest, error, _RET_IP_); in xfs_reflink_remap_blocks()
1421 return error; in xfs_reflink_remap_blocks()
1561 int error; in xfs_reflink_inode_has_shared_extents() local
1564 error = xfs_iread_extents(tp, ip, XFS_DATA_FORK); in xfs_reflink_inode_has_shared_extents()
1565 if (error) in xfs_reflink_inode_has_shared_extents()
1566 return error; in xfs_reflink_inode_has_shared_extents()
1584 error = xfs_reflink_find_shared(pag, tp, agbno, aglen, in xfs_reflink_inode_has_shared_extents()
1587 if (error) in xfs_reflink_inode_has_shared_extents()
1588 return error; in xfs_reflink_inode_has_shared_extents()
1614 int error = 0; in xfs_reflink_clear_inode_flag() local
1618 error = xfs_reflink_inode_has_shared_extents(*tpp, ip, &needs_flag); in xfs_reflink_clear_inode_flag()
1619 if (error || needs_flag) in xfs_reflink_clear_inode_flag()
1620 return error; in xfs_reflink_clear_inode_flag()
1626 error = xfs_reflink_cancel_cow_blocks(ip, tpp, 0, XFS_MAX_FILEOFF, in xfs_reflink_clear_inode_flag()
1628 if (error) in xfs_reflink_clear_inode_flag()
1629 return error; in xfs_reflink_clear_inode_flag()
1637 return error; in xfs_reflink_clear_inode_flag()
1650 int error = 0; in xfs_reflink_try_clear_inode_flag() local
1653 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, 0, 0, 0, &tp); in xfs_reflink_try_clear_inode_flag()
1654 if (error) in xfs_reflink_try_clear_inode_flag()
1655 return error; in xfs_reflink_try_clear_inode_flag()
1660 error = xfs_reflink_clear_inode_flag(ip, &tp); in xfs_reflink_try_clear_inode_flag()
1661 if (error) in xfs_reflink_try_clear_inode_flag()
1664 error = xfs_trans_commit(tp); in xfs_reflink_try_clear_inode_flag()
1665 if (error) in xfs_reflink_try_clear_inode_flag()
1674 return error; in xfs_reflink_try_clear_inode_flag()
1688 int error; in xfs_reflink_unshare() local
1698 error = dax_file_unshare(inode, offset, len, in xfs_reflink_unshare()
1701 error = iomap_file_unshare(inode, offset, len, in xfs_reflink_unshare()
1703 if (error) in xfs_reflink_unshare()
1706 error = filemap_write_and_wait_range(inode->i_mapping, offset, in xfs_reflink_unshare()
1708 if (error) in xfs_reflink_unshare()
1712 error = xfs_reflink_try_clear_inode_flag(ip); in xfs_reflink_unshare()
1713 if (error) in xfs_reflink_unshare()
1718 trace_xfs_reflink_unshare_error(ip, error, _RET_IP_); in xfs_reflink_unshare()
1719 return error; in xfs_reflink_unshare()