Lines Matching refs:error

76 	int			error;		/* error return value */  in xfs_bmap_finish()  local
98 error = xfs_trans_commit(*tp, 0); in xfs_bmap_finish()
105 if (error) in xfs_bmap_finish()
106 return error; in xfs_bmap_finish()
114 error = xfs_trans_reserve(ntp, &tres, 0, 0); in xfs_bmap_finish()
115 if (error) in xfs_bmap_finish()
116 return error; in xfs_bmap_finish()
120 if ((error = xfs_free_extent(ntp, free->xbfi_startblock, in xfs_bmap_finish()
133 (error == -EFSCORRUPTED) ? in xfs_bmap_finish()
136 return error; in xfs_bmap_finish()
150 int error; /* error return value */ in xfs_bmap_rtalloc() local
160 error = xfs_bmap_extsize_align(mp, &ap->got, &ap->prev, in xfs_bmap_rtalloc()
163 if (error) in xfs_bmap_rtalloc()
164 return error; in xfs_bmap_rtalloc()
201 error = xfs_rtpick_extent(mp, ap->tp, ralen, &rtx); in xfs_bmap_rtalloc()
202 if (error) in xfs_bmap_rtalloc()
203 return error; in xfs_bmap_rtalloc()
218 if ((error = xfs_rtallocate_extent(ap->tp, ap->blkno, 1, ap->length, in xfs_bmap_rtalloc()
220 return error; in xfs_bmap_rtalloc()
222 (error = xfs_rtallocate_extent(ap->tp, ap->blkno, 1, in xfs_bmap_rtalloc()
225 return error; in xfs_bmap_rtalloc()
261 int error; in xfs_bmap_eof() local
263 error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, eof); in xfs_bmap_eof()
264 if (error || *eof) in xfs_bmap_eof()
265 return error; in xfs_bmap_eof()
326 int error; in xfs_bmap_count_tree() local
335 error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp, XFS_BMAP_BTREE_REF, in xfs_bmap_count_tree()
337 if (error) in xfs_bmap_count_tree()
338 return error; in xfs_bmap_count_tree()
346 error = xfs_btree_read_bufl(mp, tp, nextbno, 0, &nbp, in xfs_bmap_count_tree()
349 if (error) in xfs_bmap_count_tree()
350 return error; in xfs_bmap_count_tree()
360 if (unlikely((error = in xfs_bmap_count_tree()
378 error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp, in xfs_bmap_count_tree()
381 if (error) in xfs_bmap_count_tree()
382 return error; in xfs_bmap_count_tree()
497 int error = 0; /* return value */ in xfs_getbmap() local
578 error = filemap_write_and_wait(VFS_I(ip)->i_mapping); in xfs_getbmap()
579 if (error) in xfs_getbmap()
611 error = -ENOMEM; in xfs_getbmap()
621 error = 0; in xfs_getbmap()
629 error = xfs_bmapi_read(ip, XFS_BB_TO_FSBT(mp, bmv->bmv_offset), in xfs_getbmap()
632 if (error) in xfs_getbmap()
708 error = formatter(&arg, &out[i], &full); in xfs_getbmap()
709 if (error || full) in xfs_getbmap()
714 return error; in xfs_getbmap()
732 int error = 0; in xfs_bmap_punch_delalloc_range() local
749 error = xfs_bmapi_read(ip, start_fsb, 1, &imap, &nimaps, in xfs_bmap_punch_delalloc_range()
752 if (error) { in xfs_bmap_punch_delalloc_range()
778 error = xfs_bunmapi(NULL, ip, start_fsb, 1, 0, 1, &firstblock, in xfs_bmap_punch_delalloc_range()
780 if (error) in xfs_bmap_punch_delalloc_range()
789 return error; in xfs_bmap_punch_delalloc_range()
840 int error; in xfs_free_eofblocks() local
859 error = xfs_bmapi_read(ip, end_fsb, map_len, &imap, &nimaps, 0); in xfs_free_eofblocks()
862 if (!error && (nimaps != 0) && in xfs_free_eofblocks()
868 error = xfs_qm_dqattach(ip, 0); in xfs_free_eofblocks()
869 if (error) in xfs_free_eofblocks()
870 return error; in xfs_free_eofblocks()
886 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); in xfs_free_eofblocks()
887 if (error) { in xfs_free_eofblocks()
892 return error; in xfs_free_eofblocks()
904 error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, in xfs_free_eofblocks()
906 if (error) { in xfs_free_eofblocks()
915 error = xfs_trans_commit(tp, in xfs_free_eofblocks()
917 if (!error) in xfs_free_eofblocks()
925 return error; in xfs_free_eofblocks()
950 int error; in xfs_alloc_file_space() local
957 error = xfs_qm_dqattach(ip, 0); in xfs_alloc_file_space()
958 if (error) in xfs_alloc_file_space()
959 return error; in xfs_alloc_file_space()
976 while (allocatesize_fsb && !error) { in xfs_alloc_file_space()
1019 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, in xfs_alloc_file_space()
1024 if (error) { in xfs_alloc_file_space()
1028 ASSERT(error == -ENOSPC || XFS_FORCED_SHUTDOWN(mp)); in xfs_alloc_file_space()
1033 error = xfs_trans_reserve_quota_nblks(tp, ip, qblocks, in xfs_alloc_file_space()
1035 if (error) in xfs_alloc_file_space()
1041 error = xfs_bmapi_write(tp, ip, startoffset_fsb, in xfs_alloc_file_space()
1044 if (error) { in xfs_alloc_file_space()
1051 error = xfs_bmap_finish(&tp, &free_list, &committed); in xfs_alloc_file_space()
1052 if (error) { in xfs_alloc_file_space()
1056 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); in xfs_alloc_file_space()
1058 if (error) { in xfs_alloc_file_space()
1065 error = -ENOSPC; in xfs_alloc_file_space()
1073 return error; in xfs_alloc_file_space()
1082 return error; in xfs_alloc_file_space()
1109 int error = 0; in xfs_zero_remaining_bytes() local
1129 error = xfs_bmapi_read(ip, offset_fsb, 1, &imap, &nimap, 0); in xfs_zero_remaining_bytes()
1132 if (error || nimap < 1) in xfs_zero_remaining_bytes()
1145 error = xfs_buf_read_uncached(XFS_IS_REALTIME_INODE(ip) ? in xfs_zero_remaining_bytes()
1150 if (error) in xfs_zero_remaining_bytes()
1151 return error; in xfs_zero_remaining_bytes()
1157 error = xfs_bwrite(bp); in xfs_zero_remaining_bytes()
1159 if (error) in xfs_zero_remaining_bytes()
1160 return error; in xfs_zero_remaining_bytes()
1162 return error; in xfs_zero_remaining_bytes()
1174 int error; in xfs_free_file_space() local
1193 error = xfs_qm_dqattach(ip, 0); in xfs_free_file_space()
1194 if (error) in xfs_free_file_space()
1195 return error; in xfs_free_file_space()
1197 error = 0; in xfs_free_file_space()
1199 return error; in xfs_free_file_space()
1210 error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, ioffset, in xfs_free_file_space()
1212 if (error) in xfs_free_file_space()
1224 error = xfs_bmapi_read(ip, startoffset_fsb, 1, in xfs_free_file_space()
1226 if (error) in xfs_free_file_space()
1239 error = xfs_bmapi_read(ip, endoffset_fsb - 1, 1, in xfs_free_file_space()
1241 if (error) in xfs_free_file_space()
1255 error = xfs_zero_remaining_bytes(ip, offset, offset + len - 1); in xfs_free_file_space()
1261 error = xfs_zero_remaining_bytes(ip, offset, in xfs_free_file_space()
1263 if (!error && in xfs_free_file_space()
1265 error = xfs_zero_remaining_bytes(ip, in xfs_free_file_space()
1274 while (!error && !done) { in xfs_free_file_space()
1282 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, resblks, 0); in xfs_free_file_space()
1287 if (error) { in xfs_free_file_space()
1291 ASSERT(error == -ENOSPC || XFS_FORCED_SHUTDOWN(mp)); in xfs_free_file_space()
1296 error = xfs_trans_reserve_quota(tp, mp, in xfs_free_file_space()
1299 if (error) in xfs_free_file_space()
1308 error = xfs_bunmapi(tp, ip, startoffset_fsb, in xfs_free_file_space()
1311 if (error) { in xfs_free_file_space()
1318 error = xfs_bmap_finish(&tp, &free_list, &committed); in xfs_free_file_space()
1319 if (error) { in xfs_free_file_space()
1323 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); in xfs_free_file_space()
1328 return error; in xfs_free_file_space()
1350 int error; in xfs_zero_file_space() local
1365 error = xfs_free_file_space(ip, offset, len); in xfs_zero_file_space()
1366 if (error) in xfs_zero_file_space()
1369 error = xfs_alloc_file_space(ip, round_down(offset, blksize), in xfs_zero_file_space()
1374 return error; in xfs_zero_file_space()
1396 int error; in xfs_shift_file_space() local
1425 error = xfs_free_eofblocks(mp, ip, false); in xfs_shift_file_space()
1426 if (error) in xfs_shift_file_space()
1427 return error; in xfs_shift_file_space()
1434 error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, in xfs_shift_file_space()
1436 if (error) in xfs_shift_file_space()
1437 return error; in xfs_shift_file_space()
1438 error = invalidate_inode_pages2_range(VFS_I(ip)->i_mapping, in xfs_shift_file_space()
1440 if (error) in xfs_shift_file_space()
1441 return error; in xfs_shift_file_space()
1449 error = xfs_bmap_split_extent(ip, stop_fsb); in xfs_shift_file_space()
1450 if (error) in xfs_shift_file_space()
1451 return error; in xfs_shift_file_space()
1454 while (!error && !done) { in xfs_shift_file_space()
1462 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, in xfs_shift_file_space()
1464 if (error) { in xfs_shift_file_space()
1470 error = xfs_trans_reserve_quota(tp, mp, ip->i_udquot, in xfs_shift_file_space()
1474 if (error) in xfs_shift_file_space()
1485 error = xfs_bmap_shift_extents(tp, ip, &next_fsb, shift_fsb, in xfs_shift_file_space()
1488 if (error) in xfs_shift_file_space()
1491 error = xfs_bmap_finish(&tp, &free_list, &committed); in xfs_shift_file_space()
1492 if (error) in xfs_shift_file_space()
1495 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); in xfs_shift_file_space()
1498 return error; in xfs_shift_file_space()
1502 return error; in xfs_shift_file_space()
1523 int error; in xfs_collapse_file_space() local
1528 error = xfs_free_file_space(ip, offset, len); in xfs_collapse_file_space()
1529 if (error) in xfs_collapse_file_space()
1530 return error; in xfs_collapse_file_space()
1653 int error; in xfs_swap_extent_flush() local
1655 error = filemap_write_and_wait(VFS_I(ip)->i_mapping); in xfs_swap_extent_flush()
1656 if (error) in xfs_swap_extent_flush()
1657 return error; in xfs_swap_extent_flush()
1677 int error = 0; in xfs_swap_extents() local
1685 error = -ENOMEM; in xfs_swap_extents()
1701 error = -EINVAL; in xfs_swap_extents()
1707 error = -EINVAL; in xfs_swap_extents()
1711 error = xfs_swap_extent_flush(ip); in xfs_swap_extents()
1712 if (error) in xfs_swap_extents()
1714 error = xfs_swap_extent_flush(tip); in xfs_swap_extents()
1715 if (error) in xfs_swap_extents()
1719 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ichange, 0, 0); in xfs_swap_extents()
1720 if (error) { in xfs_swap_extents()
1739 error = -EFAULT; in xfs_swap_extents()
1747 error = xfs_swap_extents_check_format(ip, tip); in xfs_swap_extents()
1748 if (error) { in xfs_swap_extents()
1766 error = -EBUSY; in xfs_swap_extents()
1774 error = xfs_bmap_count_blocks(tp, ip, XFS_ATTR_FORK, &aforkblks); in xfs_swap_extents()
1775 if (error) in xfs_swap_extents()
1780 error = xfs_bmap_count_blocks(tp, tip, XFS_ATTR_FORK, in xfs_swap_extents()
1782 if (error) in xfs_swap_extents()
1804 error = xfs_bmbt_change_owner(tp, ip, XFS_DATA_FORK, in xfs_swap_extents()
1806 if (error) in xfs_swap_extents()
1813 error = xfs_bmbt_change_owner(tp, tip, XFS_DATA_FORK, in xfs_swap_extents()
1815 if (error) in xfs_swap_extents()
1904 error = xfs_trans_commit(tp, 0); in xfs_swap_extents()
1910 return error; in xfs_swap_extents()