diff options
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r-- | fs/xfs/xfs_iomap.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 3826e8f0e28a..991f8a61f7c4 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -308,7 +308,8 @@ phase2: | |||
308 | break; | 308 | break; |
309 | } | 309 | } |
310 | 310 | ||
311 | error = XFS_IOMAP_WRITE_ALLOCATE(mp, io, &imap, &nimaps); | 311 | error = XFS_IOMAP_WRITE_ALLOCATE(mp, io, offset, count, |
312 | &imap, &nimaps); | ||
312 | break; | 313 | break; |
313 | case BMAPI_UNWRITTEN: | 314 | case BMAPI_UNWRITTEN: |
314 | lockmode = 0; | 315 | lockmode = 0; |
@@ -365,7 +366,7 @@ xfs_flush_space( | |||
365 | int | 366 | int |
366 | xfs_iomap_write_direct( | 367 | xfs_iomap_write_direct( |
367 | xfs_inode_t *ip, | 368 | xfs_inode_t *ip, |
368 | loff_t offset, | 369 | xfs_off_t offset, |
369 | size_t count, | 370 | size_t count, |
370 | int flags, | 371 | int flags, |
371 | xfs_bmbt_irec_t *ret_imap, | 372 | xfs_bmbt_irec_t *ret_imap, |
@@ -541,7 +542,7 @@ error_out: | |||
541 | int | 542 | int |
542 | xfs_iomap_write_delay( | 543 | xfs_iomap_write_delay( |
543 | xfs_inode_t *ip, | 544 | xfs_inode_t *ip, |
544 | loff_t offset, | 545 | xfs_off_t offset, |
545 | size_t count, | 546 | size_t count, |
546 | int ioflag, | 547 | int ioflag, |
547 | xfs_bmbt_irec_t *ret_imap, | 548 | xfs_bmbt_irec_t *ret_imap, |
@@ -746,6 +747,8 @@ write_map: | |||
746 | int | 747 | int |
747 | xfs_iomap_write_allocate( | 748 | xfs_iomap_write_allocate( |
748 | xfs_inode_t *ip, | 749 | xfs_inode_t *ip, |
750 | xfs_off_t offset, | ||
751 | size_t count, | ||
749 | xfs_bmbt_irec_t *map, | 752 | xfs_bmbt_irec_t *map, |
750 | int *retmap) | 753 | int *retmap) |
751 | { | 754 | { |
@@ -770,9 +773,9 @@ xfs_iomap_write_allocate( | |||
770 | if ((error = XFS_QM_DQATTACH(mp, ip, 0))) | 773 | if ((error = XFS_QM_DQATTACH(mp, ip, 0))) |
771 | return XFS_ERROR(error); | 774 | return XFS_ERROR(error); |
772 | 775 | ||
773 | offset_fsb = map->br_startoff; | 776 | offset_fsb = XFS_B_TO_FSBT(mp, offset); |
774 | count_fsb = map->br_blockcount; | 777 | count_fsb = map->br_blockcount; |
775 | map_start_fsb = offset_fsb; | 778 | map_start_fsb = map->br_startoff; |
776 | 779 | ||
777 | XFS_STATS_ADD(xs_xstrat_bytes, XFS_FSB_TO_B(mp, count_fsb)); | 780 | XFS_STATS_ADD(xs_xstrat_bytes, XFS_FSB_TO_B(mp, count_fsb)); |
778 | 781 | ||
@@ -868,9 +871,9 @@ xfs_iomap_write_allocate( | |||
868 | imap[i].br_startoff, | 871 | imap[i].br_startoff, |
869 | imap[i].br_blockcount,imap[i].br_state); | 872 | imap[i].br_blockcount,imap[i].br_state); |
870 | } | 873 | } |
871 | if ((map->br_startoff >= imap[i].br_startoff) && | 874 | if ((offset_fsb >= imap[i].br_startoff) && |
872 | (map->br_startoff < (imap[i].br_startoff + | 875 | (offset_fsb < (imap[i].br_startoff + |
873 | imap[i].br_blockcount))) { | 876 | imap[i].br_blockcount))) { |
874 | *map = imap[i]; | 877 | *map = imap[i]; |
875 | *retmap = 1; | 878 | *retmap = 1; |
876 | XFS_STATS_INC(xs_xstrat_quick); | 879 | XFS_STATS_INC(xs_xstrat_quick); |
@@ -883,9 +886,8 @@ xfs_iomap_write_allocate( | |||
883 | * file, just surrounding data, try again. | 886 | * file, just surrounding data, try again. |
884 | */ | 887 | */ |
885 | nimaps--; | 888 | nimaps--; |
886 | offset_fsb = imap[nimaps].br_startoff + | 889 | map_start_fsb = imap[nimaps].br_startoff + |
887 | imap[nimaps].br_blockcount; | 890 | imap[nimaps].br_blockcount; |
888 | map_start_fsb = offset_fsb; | ||
889 | } | 891 | } |
890 | 892 | ||
891 | trans_cancel: | 893 | trans_cancel: |
@@ -899,7 +901,7 @@ error0: | |||
899 | int | 901 | int |
900 | xfs_iomap_write_unwritten( | 902 | xfs_iomap_write_unwritten( |
901 | xfs_inode_t *ip, | 903 | xfs_inode_t *ip, |
902 | loff_t offset, | 904 | xfs_off_t offset, |
903 | size_t count) | 905 | size_t count) |
904 | { | 906 | { |
905 | xfs_mount_t *mp = ip->i_mount; | 907 | xfs_mount_t *mp = ip->i_mount; |