Commit b4e9181e authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Elder

xfs: remove unused delta tracking code in xfs_bmapi

This code was introduced four years ago in commit
3e57ecf6 without any review and has
been unused since.  Remove it just as the rest of the code introduced
in that commit to reduce that stack usage and complexity in this central
piece of code.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent cd8b0bb3
...@@ -974,7 +974,7 @@ xfs_aops_discard_page( ...@@ -974,7 +974,7 @@ xfs_aops_discard_page(
*/ */
error = xfs_bmapi(NULL, ip, offset_fsb, 1, error = xfs_bmapi(NULL, ip, offset_fsb, 1,
XFS_BMAPI_ENTIRE, NULL, 0, &imap, XFS_BMAPI_ENTIRE, NULL, 0, &imap,
&nimaps, NULL, NULL); &nimaps, NULL);
if (error) { if (error) {
/* something screwed, just bail */ /* something screwed, just bail */
...@@ -1002,7 +1002,7 @@ xfs_aops_discard_page( ...@@ -1002,7 +1002,7 @@ xfs_aops_discard_page(
*/ */
xfs_bmap_init(&flist, &firstblock); xfs_bmap_init(&flist, &firstblock);
error = xfs_bunmapi(NULL, ip, offset_fsb, 1, 0, 1, &firstblock, error = xfs_bunmapi(NULL, ip, offset_fsb, 1, 0, 1, &firstblock,
&flist, NULL, &done); &flist, &done);
ASSERT(!flist.xbf_count && !flist.xbf_first); ASSERT(!flist.xbf_count && !flist.xbf_first);
if (error) { if (error) {
......
...@@ -414,7 +414,7 @@ xfs_zero_last_block( ...@@ -414,7 +414,7 @@ xfs_zero_last_block(
last_fsb = XFS_B_TO_FSBT(mp, isize); last_fsb = XFS_B_TO_FSBT(mp, isize);
nimaps = 1; nimaps = 1;
error = xfs_bmapi(NULL, ip, last_fsb, 1, 0, NULL, 0, &imap, error = xfs_bmapi(NULL, ip, last_fsb, 1, 0, NULL, 0, &imap,
&nimaps, NULL, NULL); &nimaps, NULL);
if (error) { if (error) {
return error; return error;
} }
...@@ -509,7 +509,7 @@ xfs_zero_eof( ...@@ -509,7 +509,7 @@ xfs_zero_eof(
nimaps = 1; nimaps = 1;
zero_count_fsb = end_zero_fsb - start_zero_fsb + 1; zero_count_fsb = end_zero_fsb - start_zero_fsb + 1;
error = xfs_bmapi(NULL, ip, start_zero_fsb, zero_count_fsb, error = xfs_bmapi(NULL, ip, start_zero_fsb, zero_count_fsb,
0, NULL, 0, &imap, &nimaps, NULL, NULL); 0, NULL, 0, &imap, &nimaps, NULL);
if (error) { if (error) {
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_IOLOCK_EXCL)); ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_IOLOCK_EXCL));
return error; return error;
......
...@@ -385,7 +385,7 @@ xfs_qm_dqalloc( ...@@ -385,7 +385,7 @@ xfs_qm_dqalloc(
XFS_BMAPI_METADATA | XFS_BMAPI_WRITE, XFS_BMAPI_METADATA | XFS_BMAPI_WRITE,
&firstblock, &firstblock,
XFS_QM_DQALLOC_SPACE_RES(mp), XFS_QM_DQALLOC_SPACE_RES(mp),
&map, &nmaps, &flist, NULL))) { &map, &nmaps, &flist))) {
goto error0; goto error0;
} }
ASSERT(map.br_blockcount == XFS_DQUOT_CLUSTER_SIZE_FSB); ASSERT(map.br_blockcount == XFS_DQUOT_CLUSTER_SIZE_FSB);
...@@ -501,7 +501,7 @@ xfs_qm_dqtobp( ...@@ -501,7 +501,7 @@ xfs_qm_dqtobp(
error = xfs_bmapi(NULL, quotip, dqp->q_fileoffset, error = xfs_bmapi(NULL, quotip, dqp->q_fileoffset,
XFS_DQUOT_CLUSTER_SIZE_FSB, XFS_DQUOT_CLUSTER_SIZE_FSB,
XFS_BMAPI_METADATA, XFS_BMAPI_METADATA,
NULL, 0, &map, &nmaps, NULL, NULL); NULL, 0, &map, &nmaps, NULL);
xfs_iunlock(quotip, XFS_ILOCK_SHARED); xfs_iunlock(quotip, XFS_ILOCK_SHARED);
if (error) if (error)
......
...@@ -1490,7 +1490,7 @@ xfs_qm_dqiterate( ...@@ -1490,7 +1490,7 @@ xfs_qm_dqiterate(
maxlblkcnt - lblkno, maxlblkcnt - lblkno,
XFS_BMAPI_METADATA, XFS_BMAPI_METADATA,
NULL, NULL,
0, map, &nmaps, NULL, NULL); 0, map, &nmaps, NULL);
xfs_iunlock(qip, XFS_ILOCK_SHARED); xfs_iunlock(qip, XFS_ILOCK_SHARED);
if (error) if (error)
break; break;
......
...@@ -1977,7 +1977,7 @@ xfs_attr_rmtval_get(xfs_da_args_t *args) ...@@ -1977,7 +1977,7 @@ xfs_attr_rmtval_get(xfs_da_args_t *args)
error = xfs_bmapi(args->trans, args->dp, (xfs_fileoff_t)lblkno, error = xfs_bmapi(args->trans, args->dp, (xfs_fileoff_t)lblkno,
args->rmtblkcnt, args->rmtblkcnt,
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
NULL, 0, map, &nmap, NULL, NULL); NULL, 0, map, &nmap, NULL);
if (error) if (error)
return(error); return(error);
ASSERT(nmap >= 1); ASSERT(nmap >= 1);
...@@ -2056,7 +2056,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) ...@@ -2056,7 +2056,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA | XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA |
XFS_BMAPI_WRITE, XFS_BMAPI_WRITE,
args->firstblock, args->total, &map, &nmap, args->firstblock, args->total, &map, &nmap,
args->flist, NULL); args->flist);
if (!error) { if (!error) {
error = xfs_bmap_finish(&args->trans, args->flist, error = xfs_bmap_finish(&args->trans, args->flist,
&committed); &committed);
...@@ -2107,7 +2107,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) ...@@ -2107,7 +2107,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)
args->rmtblkcnt, args->rmtblkcnt,
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
args->firstblock, 0, &map, &nmap, args->firstblock, 0, &map, &nmap,
NULL, NULL); NULL);
if (error) { if (error) {
return(error); return(error);
} }
...@@ -2172,7 +2172,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args) ...@@ -2172,7 +2172,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
args->rmtblkcnt, args->rmtblkcnt,
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
args->firstblock, 0, &map, &nmap, args->firstblock, 0, &map, &nmap,
args->flist, NULL); args->flist);
if (error) { if (error) {
return(error); return(error);
} }
...@@ -2210,7 +2210,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args) ...@@ -2210,7 +2210,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
1, args->firstblock, args->flist, 1, args->firstblock, args->flist,
NULL, &done); &done);
if (!error) { if (!error) {
error = xfs_bmap_finish(&args->trans, args->flist, error = xfs_bmap_finish(&args->trans, args->flist,
&committed); &committed);
......
...@@ -2928,7 +2928,7 @@ xfs_attr_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp, ...@@ -2928,7 +2928,7 @@ xfs_attr_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp,
nmap = 1; nmap = 1;
error = xfs_bmapi(*trans, dp, (xfs_fileoff_t)tblkno, tblkcnt, error = xfs_bmapi(*trans, dp, (xfs_fileoff_t)tblkno, tblkcnt,
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
NULL, 0, &map, &nmap, NULL, NULL); NULL, 0, &map, &nmap, NULL);
if (error) { if (error) {
return(error); return(error);
} }
......
This diff is collapsed.
...@@ -27,20 +27,6 @@ struct xfs_trans; ...@@ -27,20 +27,6 @@ struct xfs_trans;
extern kmem_zone_t *xfs_bmap_free_item_zone; extern kmem_zone_t *xfs_bmap_free_item_zone;
/*
* DELTA: describe a change to the in-core extent list.
*
* Internally the use of xed_blockount is somewhat funky.
* xed_blockcount contains an offset much of the time because this
* makes merging changes easier. (xfs_fileoff_t and xfs_filblks_t are
* the same underlying type).
*/
typedef struct xfs_extdelta
{
xfs_fileoff_t xed_startoff; /* offset of range */
xfs_filblks_t xed_blockcount; /* blocks in range */
} xfs_extdelta_t;
/* /*
* List of extents to be free "later". * List of extents to be free "later".
* The list is kept sorted on xbf_startblock. * The list is kept sorted on xbf_startblock.
...@@ -305,9 +291,7 @@ xfs_bmapi( ...@@ -305,9 +291,7 @@ xfs_bmapi(
xfs_extlen_t total, /* total blocks needed */ xfs_extlen_t total, /* total blocks needed */
struct xfs_bmbt_irec *mval, /* output: map values */ struct xfs_bmbt_irec *mval, /* output: map values */
int *nmap, /* i/o: mval size/count */ int *nmap, /* i/o: mval size/count */
xfs_bmap_free_t *flist, /* i/o: list extents to free */ xfs_bmap_free_t *flist); /* i/o: list extents to free */
xfs_extdelta_t *delta); /* o: change made to incore
extents */
/* /*
* Map file blocks to filesystem blocks, simple version. * Map file blocks to filesystem blocks, simple version.
...@@ -341,8 +325,6 @@ xfs_bunmapi( ...@@ -341,8 +325,6 @@ xfs_bunmapi(
xfs_fsblock_t *firstblock, /* first allocated block xfs_fsblock_t *firstblock, /* first allocated block
controls a.g. for allocs */ controls a.g. for allocs */
xfs_bmap_free_t *flist, /* i/o: list extents to free */ xfs_bmap_free_t *flist, /* i/o: list extents to free */
xfs_extdelta_t *delta, /* o: change made to incore
extents */
int *done); /* set if not done yet */ int *done); /* set if not done yet */
/* /*
......
...@@ -1596,7 +1596,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno) ...@@ -1596,7 +1596,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno)
xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA| xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|
XFS_BMAPI_CONTIG, XFS_BMAPI_CONTIG,
args->firstblock, args->total, &map, &nmap, args->firstblock, args->total, &map, &nmap,
args->flist, NULL))) { args->flist))) {
return error; return error;
} }
ASSERT(nmap <= 1); ASSERT(nmap <= 1);
...@@ -1617,8 +1617,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno) ...@@ -1617,8 +1617,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno)
xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE| xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE|
XFS_BMAPI_METADATA, XFS_BMAPI_METADATA,
args->firstblock, args->total, args->firstblock, args->total,
&mapp[mapi], &nmap, args->flist, &mapp[mapi], &nmap, args->flist))) {
NULL))) {
kmem_free(mapp); kmem_free(mapp);
return error; return error;
} }
...@@ -1879,7 +1878,7 @@ xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno, ...@@ -1879,7 +1878,7 @@ xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
*/ */
if ((error = xfs_bunmapi(tp, dp, dead_blkno, count, if ((error = xfs_bunmapi(tp, dp, dead_blkno, count,
xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA, xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA,
0, args->firstblock, args->flist, NULL, 0, args->firstblock, args->flist,
&done)) == ENOSPC) { &done)) == ENOSPC) {
if (w != XFS_DATA_FORK) if (w != XFS_DATA_FORK)
break; break;
...@@ -1984,7 +1983,7 @@ xfs_da_do_buf( ...@@ -1984,7 +1983,7 @@ xfs_da_do_buf(
nfsb, nfsb,
XFS_BMAPI_METADATA | XFS_BMAPI_METADATA |
xfs_bmapi_aflag(whichfork), xfs_bmapi_aflag(whichfork),
NULL, 0, mapp, &nmap, NULL, NULL))) NULL, 0, mapp, &nmap, NULL)))
goto exit0; goto exit0;
} }
} else { } else {
......
...@@ -547,7 +547,7 @@ xfs_dir2_grow_inode( ...@@ -547,7 +547,7 @@ xfs_dir2_grow_inode(
if ((error = xfs_bmapi(tp, dp, bno, count, if ((error = xfs_bmapi(tp, dp, bno, count,
XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|XFS_BMAPI_CONTIG, XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|XFS_BMAPI_CONTIG,
args->firstblock, args->total, &map, &nmap, args->firstblock, args->total, &map, &nmap,
args->flist, NULL))) args->flist)))
return error; return error;
ASSERT(nmap <= 1); ASSERT(nmap <= 1);
if (nmap == 1) { if (nmap == 1) {
...@@ -579,8 +579,7 @@ xfs_dir2_grow_inode( ...@@ -579,8 +579,7 @@ xfs_dir2_grow_inode(
if ((error = xfs_bmapi(tp, dp, b, c, if ((error = xfs_bmapi(tp, dp, b, c,
XFS_BMAPI_WRITE|XFS_BMAPI_METADATA, XFS_BMAPI_WRITE|XFS_BMAPI_METADATA,
args->firstblock, args->total, args->firstblock, args->total,
&mapp[mapi], &nmap, args->flist, &mapp[mapi], &nmap, args->flist))) {
NULL))) {
kmem_free(mapp); kmem_free(mapp);
return error; return error;
} }
...@@ -713,7 +712,7 @@ xfs_dir2_shrink_inode( ...@@ -713,7 +712,7 @@ xfs_dir2_shrink_inode(
*/ */
if ((error = xfs_bunmapi(tp, dp, da, mp->m_dirblkfsbs, if ((error = xfs_bunmapi(tp, dp, da, mp->m_dirblkfsbs,
XFS_BMAPI_METADATA, 0, args->firstblock, args->flist, XFS_BMAPI_METADATA, 0, args->firstblock, args->flist,
NULL, &done))) { &done))) {
/* /*
* ENOSPC actually can happen if we're in a removename with * ENOSPC actually can happen if we're in a removename with
* no space reservation, and the resulting block removal * no space reservation, and the resulting block removal
......
...@@ -873,7 +873,7 @@ xfs_dir2_leaf_getdents( ...@@ -873,7 +873,7 @@ xfs_dir2_leaf_getdents(
xfs_dir2_byte_to_da(mp, xfs_dir2_byte_to_da(mp,
XFS_DIR2_LEAF_OFFSET) - map_off, XFS_DIR2_LEAF_OFFSET) - map_off,
XFS_BMAPI_METADATA, NULL, 0, XFS_BMAPI_METADATA, NULL, 0,
&map[map_valid], &nmap, NULL, NULL); &map[map_valid], &nmap, NULL);
/* /*
* Don't know if we should ignore this or * Don't know if we should ignore this or
* try to return an error. * try to return an error.
......
...@@ -1222,7 +1222,7 @@ xfs_isize_check( ...@@ -1222,7 +1222,7 @@ xfs_isize_check(
(xfs_ufsize_t)XFS_MAXIOFFSET(mp)) - (xfs_ufsize_t)XFS_MAXIOFFSET(mp)) -
map_first), map_first),
XFS_BMAPI_ENTIRE, NULL, 0, imaps, &nimaps, XFS_BMAPI_ENTIRE, NULL, 0, imaps, &nimaps,
NULL, NULL)) NULL))
return; return;
ASSERT(nimaps == 1); ASSERT(nimaps == 1);
ASSERT(imaps[0].br_startblock == HOLESTARTBLOCK); ASSERT(imaps[0].br_startblock == HOLESTARTBLOCK);
...@@ -1588,7 +1588,7 @@ xfs_itruncate_finish( ...@@ -1588,7 +1588,7 @@ xfs_itruncate_finish(
xfs_bmapi_aflag(fork), xfs_bmapi_aflag(fork),
XFS_ITRUNC_MAX_EXTENTS, XFS_ITRUNC_MAX_EXTENTS,
&first_block, &free_list, &first_block, &free_list,
NULL, &done); &done);
if (error) { if (error) {
/* /*
* If the bunmapi call encounters an error, * If the bunmapi call encounters an error,
......
...@@ -118,7 +118,7 @@ xfs_iomap( ...@@ -118,7 +118,7 @@ xfs_iomap(
error = xfs_bmapi(NULL, ip, offset_fsb, error = xfs_bmapi(NULL, ip, offset_fsb,
(xfs_filblks_t)(end_fsb - offset_fsb), (xfs_filblks_t)(end_fsb - offset_fsb),
bmapi_flags, NULL, 0, imap, bmapi_flags, NULL, 0, imap,
nimaps, NULL, NULL); nimaps, NULL);
if (error) if (error)
goto out; goto out;
...@@ -341,7 +341,7 @@ xfs_iomap_write_direct( ...@@ -341,7 +341,7 @@ xfs_iomap_write_direct(
xfs_bmap_init(&free_list, &firstfsb); xfs_bmap_init(&free_list, &firstfsb);
nimaps = 1; nimaps = 1;
error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, bmapi_flag, error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, bmapi_flag,
&firstfsb, 0, &imap, &nimaps, &free_list, NULL); &firstfsb, 0, &imap, &nimaps, &free_list);
if (error) if (error)
goto error0; goto error0;
...@@ -419,7 +419,7 @@ xfs_iomap_eof_want_preallocate( ...@@ -419,7 +419,7 @@ xfs_iomap_eof_want_preallocate(
imaps = nimaps; imaps = nimaps;
firstblock = NULLFSBLOCK; firstblock = NULLFSBLOCK;
error = xfs_bmapi(NULL, ip, start_fsb, count_fsb, 0, error = xfs_bmapi(NULL, ip, start_fsb, count_fsb, 0,
&firstblock, 0, imap, &imaps, NULL, NULL); &firstblock, 0, imap, &imaps, NULL);
if (error) if (error)
return error; return error;
for (n = 0; n < imaps; n++) { for (n = 0; n < imaps; n++) {
...@@ -494,7 +494,7 @@ xfs_iomap_write_delay( ...@@ -494,7 +494,7 @@ xfs_iomap_write_delay(
(xfs_filblks_t)(last_fsb - offset_fsb), (xfs_filblks_t)(last_fsb - offset_fsb),
XFS_BMAPI_DELAY | XFS_BMAPI_WRITE | XFS_BMAPI_DELAY | XFS_BMAPI_WRITE |
XFS_BMAPI_ENTIRE, &firstblock, 1, imap, XFS_BMAPI_ENTIRE, &firstblock, 1, imap,
&nimaps, NULL, NULL); &nimaps, NULL);
if (error && (error != ENOSPC)) if (error && (error != ENOSPC))
return XFS_ERROR(error); return XFS_ERROR(error);
...@@ -650,7 +650,7 @@ xfs_iomap_write_allocate( ...@@ -650,7 +650,7 @@ xfs_iomap_write_allocate(
/* Go get the actual blocks */ /* Go get the actual blocks */
error = xfs_bmapi(tp, ip, map_start_fsb, count_fsb, error = xfs_bmapi(tp, ip, map_start_fsb, count_fsb,
XFS_BMAPI_WRITE, &first_block, 1, XFS_BMAPI_WRITE, &first_block, 1,
&imap, &nimaps, &free_list, NULL); &imap, &nimaps, &free_list);
if (error) if (error)
goto trans_cancel; goto trans_cancel;
...@@ -768,7 +768,7 @@ xfs_iomap_write_unwritten( ...@@ -768,7 +768,7 @@ xfs_iomap_write_unwritten(
nimaps = 1; nimaps = 1;
error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb, XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb,
1, &imap, &nimaps, &free_list, NULL); 1, &imap, &nimaps, &free_list);
if (error) if (error)
goto error_on_bmapi_transaction; goto error_on_bmapi_transaction;
......
...@@ -122,7 +122,7 @@ xfs_growfs_rt_alloc( ...@@ -122,7 +122,7 @@ xfs_growfs_rt_alloc(
cancelflags |= XFS_TRANS_ABORT; cancelflags |= XFS_TRANS_ABORT;
error = xfs_bmapi(tp, ip, oblocks, nblocks - oblocks, error = xfs_bmapi(tp, ip, oblocks, nblocks - oblocks,
XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, &firstblock, XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, &firstblock,
resblks, &map, &nmap, &flist, NULL); resblks, &map, &nmap, &flist);
if (!error && nmap < 1) if (!error && nmap < 1)
error = XFS_ERROR(ENOSPC); error = XFS_ERROR(ENOSPC);
if (error) if (error)
......
...@@ -492,7 +492,7 @@ xfs_readlink_bmap( ...@@ -492,7 +492,7 @@ xfs_readlink_bmap(
int error = 0; int error = 0;
error = xfs_bmapi(NULL, ip, 0, XFS_B_TO_FSB(mp, pathlen), 0, NULL, 0, error = xfs_bmapi(NULL, ip, 0, XFS_B_TO_FSB(mp, pathlen), 0, NULL, 0,
mval, &nmaps, NULL, NULL); mval, &nmaps, NULL);
if (error) if (error)
goto out; goto out;
...@@ -596,7 +596,7 @@ xfs_free_eofblocks( ...@@ -596,7 +596,7 @@ xfs_free_eofblocks(
nimaps = 1; nimaps = 1;
xfs_ilock(ip, XFS_ILOCK_SHARED); xfs_ilock(ip, XFS_ILOCK_SHARED);
error = xfs_bmapi(NULL, ip, end_fsb, map_len, 0, error = xfs_bmapi(NULL, ip, end_fsb, map_len, 0,
NULL, 0, &imap, &nimaps, NULL, NULL); NULL, 0, &imap, &nimaps, NULL);
xfs_iunlock(ip, XFS_ILOCK_SHARED); xfs_iunlock(ip, XFS_ILOCK_SHARED);
if (!error && (nimaps != 0) && if (!error && (nimaps != 0) &&
...@@ -733,7 +733,7 @@ xfs_inactive_symlink_rmt( ...@@ -733,7 +733,7 @@ xfs_inactive_symlink_rmt(
nmaps = ARRAY_SIZE(mval); nmaps = ARRAY_SIZE(mval);
if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size), if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size),
XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps, XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps,
&free_list, NULL))) &free_list)))
goto error0; goto error0;
/* /*
* Invalidate the block(s). * Invalidate the block(s).
...@@ -748,7 +748,7 @@ xfs_inactive_symlink_rmt( ...@@ -748,7 +748,7 @@ xfs_inactive_symlink_rmt(
* Unmap the dead block(s) to the free_list. * Unmap the dead block(s) to the free_list.
*/ */
if ((error = xfs_bunmapi(tp, ip, 0, size, XFS_BMAPI_METADATA, nmaps, if ((error = xfs_bunmapi(tp, ip, 0, size, XFS_BMAPI_METADATA, nmaps,
&first_block, &free_list, NULL, &done))) &first_block, &free_list, &done)))
goto error1; goto error1;
ASSERT(done); ASSERT(done);
/* /*
...@@ -2095,7 +2095,7 @@ xfs_symlink( ...@@ -2095,7 +2095,7 @@ xfs_symlink(
error = xfs_bmapi(tp, ip, first_fsb, fs_blocks, error = xfs_bmapi(tp, ip, first_fsb, fs_blocks,
XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, XFS_BMAPI_WRITE | XFS_BMAPI_METADATA,
&first_block, resblks, mval, &nmaps, &first_block, resblks, mval, &nmaps,
&free_list, NULL); &free_list);
if (error) { if (error) {
goto error1; goto error1;
} }
...@@ -2347,7 +2347,7 @@ xfs_alloc_file_space( ...@@ -2347,7 +2347,7 @@ xfs_alloc_file_space(
error = xfs_bmapi(tp, ip, startoffset_fsb, error = xfs_bmapi(tp, ip, startoffset_fsb,
allocatesize_fsb, bmapi_flag, allocatesize_fsb, bmapi_flag,
&firstfsb, 0, imapp, &nimaps, &firstfsb, 0, imapp, &nimaps,
&free_list, NULL); &free_list);
if (error) { if (error) {
goto error0; goto error0;
} }
...@@ -2436,7 +2436,7 @@ xfs_zero_remaining_bytes( ...@@ -2436,7 +2436,7 @@ xfs_zero_remaining_bytes(
offset_fsb = XFS_B_TO_FSBT(mp, offset); offset_fsb = XFS_B_TO_FSBT(mp, offset);
nimap = 1; nimap = 1;
error = xfs_bmapi(NULL, ip, offset_fsb, 1, 0, error = xfs_bmapi(NULL, ip, offset_fsb, 1, 0,
NULL, 0, &imap, &nimap, NULL, NULL); NULL, 0, &imap, &nimap, NULL);
if (error || nimap < 1) if (error || nimap < 1)
break; break;
ASSERT(imap.br_blockcount >= 1); ASSERT(imap.br_blockcount >= 1);
...@@ -2556,7 +2556,7 @@ xfs_free_file_space( ...@@ -2556,7 +2556,7 @@ xfs_free_file_space(
if (rt && !xfs_sb_version_hasextflgbit(&mp->m_sb)) { if (rt && !xfs_sb_version_hasextflgbit(&mp->m_sb)) {
nimap = 1; nimap = 1;
error = xfs_bmapi(NULL, ip, startoffset_fsb, error = xfs_bmapi(NULL, ip, startoffset_fsb,
1, 0, NULL, 0, &imap, &nimap, NULL, NULL); 1, 0, NULL, 0, &imap, &nimap, NULL);
if (error) if (error)
goto out_unlock_iolock; goto out_unlock_iolock;
ASSERT(nimap == 0 || nimap == 1); ASSERT(nimap == 0 || nimap == 1);
...@@ -2571,7 +2571,7 @@ xfs_free_file_space( ...@@ -2571,7 +2571,7 @@ xfs_free_file_space(
} }
nimap = 1; nimap = 1;
error = xfs_bmapi(NULL, ip, endoffset_fsb - 1, error = xfs_bmapi(NULL, ip, endoffset_fsb - 1,
1, 0, NULL, 0, &imap, &nimap, NULL, NULL); 1, 0, NULL, 0, &imap, &nimap, NULL);
if (error) if (error)
goto out_unlock_iolock; goto out_unlock_iolock;
ASSERT(nimap == 0 || nimap == 1); ASSERT(nimap == 0 || nimap == 1);
...@@ -2647,7 +2647,7 @@ xfs_free_file_space( ...@@ -2647,7 +2647,7 @@ xfs_free_file_space(
xfs_bmap_init(&free_list, &firstfsb); xfs_bmap_init(&free_list, &firstfsb);
error = xfs_bunmapi(tp, ip, startoffset_fsb, error = xfs_bunmapi(tp, ip, startoffset_fsb,
endoffset_fsb - startoffset_fsb, endoffset_fsb - startoffset_fsb,
0, 2, &firstfsb, &free_list, NULL, &done); 0, 2, &firstfsb, &free_list, &done);
if (error) { if (error) {
goto error0; goto error0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment