aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_iomap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 113c647a9f6f..4bdd796e7ae9 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -366,13 +366,13 @@ xfs_iomap_write_direct(
366 xfs_filblks_t count_fsb; 366 xfs_filblks_t count_fsb;
367 xfs_fsize_t isize; 367 xfs_fsize_t isize;
368 xfs_fsblock_t firstfsb; 368 xfs_fsblock_t firstfsb;
369 int nimaps, maps; 369 int nimaps;
370 int error; 370 int error;
371 int bmapi_flag; 371 int bmapi_flag;
372 int quota_flag; 372 int quota_flag;
373 int rt; 373 int rt;
374 xfs_trans_t *tp; 374 xfs_trans_t *tp;
375 xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS], *imapp; 375 xfs_bmbt_irec_t imap;
376 xfs_bmap_free_t free_list; 376 xfs_bmap_free_t free_list;
377 int aeof; 377 int aeof;
378 xfs_filblks_t qblocks, resblks; 378 xfs_filblks_t qblocks, resblks;
@@ -387,9 +387,6 @@ xfs_iomap_write_direct(
387 if (error) 387 if (error)
388 return XFS_ERROR(error); 388 return XFS_ERROR(error);
389 389
390 maps = min(XFS_WRITE_IMAPS, *nmaps);
391 nimaps = maps;
392
393 isize = ip->i_d.di_size; 390 isize = ip->i_d.di_size;
394 aeof = (offset + count) > isize; 391 aeof = (offset + count) > isize;
395 392
@@ -464,9 +461,8 @@ xfs_iomap_write_direct(
464 */ 461 */
465 XFS_BMAP_INIT(&free_list, &firstfsb); 462 XFS_BMAP_INIT(&free_list, &firstfsb);
466 nimaps = 1; 463 nimaps = 1;
467 imapp = &imap[0];
468 error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, 464 error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
469 bmapi_flag, &firstfsb, 0, imapp, &nimaps, &free_list); 465 bmapi_flag, &firstfsb, 0, &imap, &nimaps, &free_list);
470 if (error) 466 if (error)
471 goto error0; 467 goto error0;
472 468
@@ -488,7 +484,7 @@ xfs_iomap_write_direct(
488 goto error_out; 484 goto error_out;
489 } 485 }
490 486
491 *ret_imap = imap[0]; 487 *ret_imap = imap;
492 *nmaps = 1; 488 *nmaps = 1;
493 if ( !(io->io_flags & XFS_IOCORE_RT) && !ret_imap->br_startblock) { 489 if ( !(io->io_flags & XFS_IOCORE_RT) && !ret_imap->br_startblock) {
494 cmn_err(CE_PANIC,"Access to block zero: fs <%s> inode: %lld " 490 cmn_err(CE_PANIC,"Access to block zero: fs <%s> inode: %lld "