Lines Matching refs:error

105 	int				error;	/* error return value */  in xfs_bmap_finish()  local
119 error = __xfs_trans_roll(tp, NULL, committed); in xfs_bmap_finish()
120 if (error) { in xfs_bmap_finish()
134 (error == -EFSCORRUPTED) ? in xfs_bmap_finish()
141 return error; in xfs_bmap_finish()
153 error = xfs_trans_free_extent(*tp, efd, free->xbfi_startblock, in xfs_bmap_finish()
155 if (error) in xfs_bmap_finish()
156 return error; in xfs_bmap_finish()
169 int error; /* error return value */ in xfs_bmap_rtalloc() local
179 error = xfs_bmap_extsize_align(mp, &ap->got, &ap->prev, in xfs_bmap_rtalloc()
182 if (error) in xfs_bmap_rtalloc()
183 return error; in xfs_bmap_rtalloc()
220 error = xfs_rtpick_extent(mp, ap->tp, ralen, &rtx); in xfs_bmap_rtalloc()
221 if (error) in xfs_bmap_rtalloc()
222 return error; in xfs_bmap_rtalloc()
237 if ((error = xfs_rtallocate_extent(ap->tp, ap->blkno, 1, ap->length, in xfs_bmap_rtalloc()
239 return error; in xfs_bmap_rtalloc()
241 (error = xfs_rtallocate_extent(ap->tp, ap->blkno, 1, in xfs_bmap_rtalloc()
244 return error; in xfs_bmap_rtalloc()
264 error = xfs_zero_extent(ap->ip, ap->blkno, ap->length); in xfs_bmap_rtalloc()
265 if (error) in xfs_bmap_rtalloc()
266 return error; in xfs_bmap_rtalloc()
287 int error; in xfs_bmap_eof() local
289 error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, eof); in xfs_bmap_eof()
290 if (error || *eof) in xfs_bmap_eof()
291 return error; in xfs_bmap_eof()
352 int error; in xfs_bmap_count_tree() local
361 error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp, XFS_BMAP_BTREE_REF, in xfs_bmap_count_tree()
363 if (error) in xfs_bmap_count_tree()
364 return error; in xfs_bmap_count_tree()
372 error = xfs_btree_read_bufl(mp, tp, nextbno, 0, &nbp, in xfs_bmap_count_tree()
375 if (error) in xfs_bmap_count_tree()
376 return error; in xfs_bmap_count_tree()
386 if (unlikely((error = in xfs_bmap_count_tree()
404 error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp, in xfs_bmap_count_tree()
407 if (error) in xfs_bmap_count_tree()
408 return error; in xfs_bmap_count_tree()
523 int error = 0; /* return value */ in xfs_getbmap() local
604 error = filemap_write_and_wait(VFS_I(ip)->i_mapping); in xfs_getbmap()
605 if (error) in xfs_getbmap()
637 error = -ENOMEM; in xfs_getbmap()
647 error = 0; in xfs_getbmap()
655 error = xfs_bmapi_read(ip, XFS_BB_TO_FSBT(mp, bmv->bmv_offset), in xfs_getbmap()
658 if (error) in xfs_getbmap()
734 error = formatter(&arg, &out[i], &full); in xfs_getbmap()
735 if (error || full) in xfs_getbmap()
740 return error; in xfs_getbmap()
758 int error = 0; in xfs_bmap_punch_delalloc_range() local
775 error = xfs_bmapi_read(ip, start_fsb, 1, &imap, &nimaps, in xfs_bmap_punch_delalloc_range()
778 if (error) { in xfs_bmap_punch_delalloc_range()
804 error = xfs_bunmapi(NULL, ip, start_fsb, 1, 0, 1, &firstblock, in xfs_bmap_punch_delalloc_range()
806 if (error) in xfs_bmap_punch_delalloc_range()
815 return error; in xfs_bmap_punch_delalloc_range()
866 int error; in xfs_free_eofblocks() local
885 error = xfs_bmapi_read(ip, end_fsb, map_len, &imap, &nimaps, 0); in xfs_free_eofblocks()
888 if (!error && (nimaps != 0) && in xfs_free_eofblocks()
894 error = xfs_qm_dqattach(ip, 0); in xfs_free_eofblocks()
895 if (error) in xfs_free_eofblocks()
896 return error; in xfs_free_eofblocks()
912 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); in xfs_free_eofblocks()
913 if (error) { in xfs_free_eofblocks()
918 return error; in xfs_free_eofblocks()
930 error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, in xfs_free_eofblocks()
932 if (error) { in xfs_free_eofblocks()
939 error = xfs_trans_commit(tp); in xfs_free_eofblocks()
940 if (!error) in xfs_free_eofblocks()
948 return error; in xfs_free_eofblocks()
973 int error; in xfs_alloc_file_space() local
980 error = xfs_qm_dqattach(ip, 0); in xfs_alloc_file_space()
981 if (error) in xfs_alloc_file_space()
982 return error; in xfs_alloc_file_space()
999 while (allocatesize_fsb && !error) { in xfs_alloc_file_space()
1042 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, in xfs_alloc_file_space()
1047 if (error) { in xfs_alloc_file_space()
1051 ASSERT(error == -ENOSPC || XFS_FORCED_SHUTDOWN(mp)); in xfs_alloc_file_space()
1056 error = xfs_trans_reserve_quota_nblks(tp, ip, qblocks, in xfs_alloc_file_space()
1058 if (error) in xfs_alloc_file_space()
1064 error = xfs_bmapi_write(tp, ip, startoffset_fsb, in xfs_alloc_file_space()
1067 if (error) { in xfs_alloc_file_space()
1074 error = xfs_bmap_finish(&tp, &free_list, &committed); in xfs_alloc_file_space()
1075 if (error) { in xfs_alloc_file_space()
1079 error = xfs_trans_commit(tp); in xfs_alloc_file_space()
1081 if (error) { in xfs_alloc_file_space()
1088 error = -ENOSPC; in xfs_alloc_file_space()
1096 return error; in xfs_alloc_file_space()
1105 return error; in xfs_alloc_file_space()
1132 int error = 0; in xfs_zero_remaining_bytes() local
1152 error = xfs_bmapi_read(ip, offset_fsb, 1, &imap, &nimap, 0); in xfs_zero_remaining_bytes()
1155 if (error || nimap < 1) in xfs_zero_remaining_bytes()
1175 error = dax_zero_page_range(VFS_I(ip), offset, in xfs_zero_remaining_bytes()
1178 if (error) in xfs_zero_remaining_bytes()
1179 return error; in xfs_zero_remaining_bytes()
1183 error = xfs_buf_read_uncached(XFS_IS_REALTIME_INODE(ip) ? in xfs_zero_remaining_bytes()
1188 if (error) in xfs_zero_remaining_bytes()
1189 return error; in xfs_zero_remaining_bytes()
1195 error = xfs_bwrite(bp); in xfs_zero_remaining_bytes()
1197 if (error) in xfs_zero_remaining_bytes()
1198 return error; in xfs_zero_remaining_bytes()
1200 return error; in xfs_zero_remaining_bytes()
1212 int error; in xfs_free_file_space() local
1231 error = xfs_qm_dqattach(ip, 0); in xfs_free_file_space()
1232 if (error) in xfs_free_file_space()
1233 return error; in xfs_free_file_space()
1235 error = 0; in xfs_free_file_space()
1237 return error; in xfs_free_file_space()
1248 error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, ioffset, in xfs_free_file_space()
1250 if (error) in xfs_free_file_space()
1262 error = xfs_bmapi_read(ip, startoffset_fsb, 1, in xfs_free_file_space()
1264 if (error) in xfs_free_file_space()
1277 error = xfs_bmapi_read(ip, endoffset_fsb - 1, 1, in xfs_free_file_space()
1279 if (error) in xfs_free_file_space()
1293 error = xfs_zero_remaining_bytes(ip, offset, offset + len - 1); in xfs_free_file_space()
1299 error = xfs_zero_remaining_bytes(ip, offset, in xfs_free_file_space()
1301 if (!error && in xfs_free_file_space()
1303 error = xfs_zero_remaining_bytes(ip, in xfs_free_file_space()
1312 while (!error && !done) { in xfs_free_file_space()
1320 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, resblks, 0); in xfs_free_file_space()
1325 if (error) { in xfs_free_file_space()
1329 ASSERT(error == -ENOSPC || XFS_FORCED_SHUTDOWN(mp)); in xfs_free_file_space()
1334 error = xfs_trans_reserve_quota(tp, mp, in xfs_free_file_space()
1337 if (error) in xfs_free_file_space()
1346 error = xfs_bunmapi(tp, ip, startoffset_fsb, in xfs_free_file_space()
1349 if (error) { in xfs_free_file_space()
1356 error = xfs_bmap_finish(&tp, &free_list, &committed); in xfs_free_file_space()
1357 if (error) { in xfs_free_file_space()
1361 error = xfs_trans_commit(tp); in xfs_free_file_space()
1366 return error; in xfs_free_file_space()
1388 int error; in xfs_zero_file_space() local
1403 error = xfs_free_file_space(ip, offset, len); in xfs_zero_file_space()
1404 if (error) in xfs_zero_file_space()
1407 error = xfs_alloc_file_space(ip, round_down(offset, blksize), in xfs_zero_file_space()
1412 return error; in xfs_zero_file_space()
1434 int error; in xfs_shift_file_space() local
1463 error = xfs_free_eofblocks(mp, ip, false); in xfs_shift_file_space()
1464 if (error) in xfs_shift_file_space()
1465 return error; in xfs_shift_file_space()
1472 error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, in xfs_shift_file_space()
1474 if (error) in xfs_shift_file_space()
1475 return error; in xfs_shift_file_space()
1476 error = invalidate_inode_pages2_range(VFS_I(ip)->i_mapping, in xfs_shift_file_space()
1478 if (error) in xfs_shift_file_space()
1479 return error; in xfs_shift_file_space()
1487 error = xfs_bmap_split_extent(ip, stop_fsb); in xfs_shift_file_space()
1488 if (error) in xfs_shift_file_space()
1489 return error; in xfs_shift_file_space()
1492 while (!error && !done) { in xfs_shift_file_space()
1500 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, in xfs_shift_file_space()
1502 if (error) { in xfs_shift_file_space()
1508 error = xfs_trans_reserve_quota(tp, mp, ip->i_udquot, in xfs_shift_file_space()
1512 if (error) in xfs_shift_file_space()
1523 error = xfs_bmap_shift_extents(tp, ip, &next_fsb, shift_fsb, in xfs_shift_file_space()
1526 if (error) in xfs_shift_file_space()
1529 error = xfs_bmap_finish(&tp, &free_list, &committed); in xfs_shift_file_space()
1530 if (error) in xfs_shift_file_space()
1533 error = xfs_trans_commit(tp); in xfs_shift_file_space()
1536 return error; in xfs_shift_file_space()
1542 return error; in xfs_shift_file_space()
1563 int error; in xfs_collapse_file_space() local
1568 error = xfs_free_file_space(ip, offset, len); in xfs_collapse_file_space()
1569 if (error) in xfs_collapse_file_space()
1570 return error; in xfs_collapse_file_space()
1693 int error; in xfs_swap_extent_flush() local
1695 error = filemap_write_and_wait(VFS_I(ip)->i_mapping); in xfs_swap_extent_flush()
1696 if (error) in xfs_swap_extent_flush()
1697 return error; in xfs_swap_extent_flush()
1717 int error = 0; in xfs_swap_extents() local
1725 error = -ENOMEM; in xfs_swap_extents()
1741 error = -EINVAL; in xfs_swap_extents()
1747 error = -EINVAL; in xfs_swap_extents()
1751 error = xfs_swap_extent_flush(ip); in xfs_swap_extents()
1752 if (error) in xfs_swap_extents()
1754 error = xfs_swap_extent_flush(tip); in xfs_swap_extents()
1755 if (error) in xfs_swap_extents()
1759 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_ichange, 0, 0); in xfs_swap_extents()
1760 if (error) { in xfs_swap_extents()
1779 error = -EFAULT; in xfs_swap_extents()
1787 error = xfs_swap_extents_check_format(ip, tip); in xfs_swap_extents()
1788 if (error) { in xfs_swap_extents()
1806 error = -EBUSY; in xfs_swap_extents()
1814 error = xfs_bmap_count_blocks(tp, ip, XFS_ATTR_FORK, &aforkblks); in xfs_swap_extents()
1815 if (error) in xfs_swap_extents()
1820 error = xfs_bmap_count_blocks(tp, tip, XFS_ATTR_FORK, in xfs_swap_extents()
1822 if (error) in xfs_swap_extents()
1844 error = xfs_bmbt_change_owner(tp, ip, XFS_DATA_FORK, in xfs_swap_extents()
1846 if (error) in xfs_swap_extents()
1853 error = xfs_bmbt_change_owner(tp, tip, XFS_DATA_FORK, in xfs_swap_extents()
1855 if (error) in xfs_swap_extents()
1944 error = xfs_trans_commit(tp); in xfs_swap_extents()
1950 return error; in xfs_swap_extents()