diff options
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r-- | fs/xfs/xfs_iomap.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 2edd6769e5d3..d0f5be63cddb 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -226,13 +226,12 @@ xfs_iomap( | |||
226 | xfs_iomap_enter_trace(XFS_IOMAP_READ_ENTER, io, offset, count); | 226 | xfs_iomap_enter_trace(XFS_IOMAP_READ_ENTER, io, offset, count); |
227 | lockmode = XFS_LCK_MAP_SHARED(mp, io); | 227 | lockmode = XFS_LCK_MAP_SHARED(mp, io); |
228 | bmapi_flags = XFS_BMAPI_ENTIRE; | 228 | bmapi_flags = XFS_BMAPI_ENTIRE; |
229 | if (flags & BMAPI_IGNSTATE) | ||
230 | bmapi_flags |= XFS_BMAPI_IGSTATE; | ||
231 | break; | 229 | break; |
232 | case BMAPI_WRITE: | 230 | case BMAPI_WRITE: |
233 | xfs_iomap_enter_trace(XFS_IOMAP_WRITE_ENTER, io, offset, count); | 231 | xfs_iomap_enter_trace(XFS_IOMAP_WRITE_ENTER, io, offset, count); |
234 | lockmode = XFS_ILOCK_EXCL|XFS_EXTSIZE_WR; | 232 | lockmode = XFS_ILOCK_EXCL|XFS_EXTSIZE_WR; |
235 | bmapi_flags = 0; | 233 | if (flags & BMAPI_IGNSTATE) |
234 | bmapi_flags |= XFS_BMAPI_IGSTATE|XFS_BMAPI_ENTIRE; | ||
236 | XFS_ILOCK(mp, io, lockmode); | 235 | XFS_ILOCK(mp, io, lockmode); |
237 | break; | 236 | break; |
238 | case BMAPI_ALLOCATE: | 237 | case BMAPI_ALLOCATE: |
@@ -391,9 +390,9 @@ xfs_iomap_write_direct( | |||
391 | xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS], *imapp; | 390 | xfs_bmbt_irec_t imap[XFS_WRITE_IMAPS], *imapp; |
392 | xfs_bmap_free_t free_list; | 391 | xfs_bmap_free_t free_list; |
393 | int aeof; | 392 | int aeof; |
394 | xfs_filblks_t datablocks, qblocks, resblks; | 393 | xfs_filblks_t qblocks, resblks; |
395 | int committed; | 394 | int committed; |
396 | int numrtextents; | 395 | int resrtextents; |
397 | 396 | ||
398 | /* | 397 | /* |
399 | * Make sure that the dquots are there. This doesn't hold | 398 | * Make sure that the dquots are there. This doesn't hold |
@@ -434,14 +433,14 @@ xfs_iomap_write_direct( | |||
434 | 433 | ||
435 | if (!(extsz = ip->i_d.di_extsize)) | 434 | if (!(extsz = ip->i_d.di_extsize)) |
436 | extsz = mp->m_sb.sb_rextsize; | 435 | extsz = mp->m_sb.sb_rextsize; |
437 | numrtextents = qblocks = (count_fsb + extsz - 1); | 436 | resrtextents = qblocks = (count_fsb + extsz - 1); |
438 | do_div(numrtextents, mp->m_sb.sb_rextsize); | 437 | do_div(resrtextents, mp->m_sb.sb_rextsize); |
438 | resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0); | ||
439 | quota_flag = XFS_QMOPT_RES_RTBLKS; | 439 | quota_flag = XFS_QMOPT_RES_RTBLKS; |
440 | datablocks = 0; | ||
441 | } else { | 440 | } else { |
442 | datablocks = qblocks = count_fsb; | 441 | resrtextents = 0; |
442 | resblks = qblocks = XFS_DIOSTRAT_SPACE_RES(mp, count_fsb); | ||
443 | quota_flag = XFS_QMOPT_RES_REGBLKS; | 443 | quota_flag = XFS_QMOPT_RES_REGBLKS; |
444 | numrtextents = 0; | ||
445 | } | 444 | } |
446 | 445 | ||
447 | /* | 446 | /* |
@@ -449,9 +448,8 @@ xfs_iomap_write_direct( | |||
449 | */ | 448 | */ |
450 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 449 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
451 | tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); | 450 | tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); |
452 | resblks = XFS_DIOSTRAT_SPACE_RES(mp, datablocks); | ||
453 | error = xfs_trans_reserve(tp, resblks, | 451 | error = xfs_trans_reserve(tp, resblks, |
454 | XFS_WRITE_LOG_RES(mp), numrtextents, | 452 | XFS_WRITE_LOG_RES(mp), resrtextents, |
455 | XFS_TRANS_PERM_LOG_RES, | 453 | XFS_TRANS_PERM_LOG_RES, |
456 | XFS_WRITE_LOG_COUNT); | 454 | XFS_WRITE_LOG_COUNT); |
457 | 455 | ||