aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_bmap_util.c')
-rw-r--r--fs/xfs/xfs_bmap_util.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 5d263dfdb3bc..1ee8c5539fa4 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1042,7 +1042,7 @@ out_trans_cancel:
1042 goto out_unlock; 1042 goto out_unlock;
1043} 1043}
1044 1044
1045static int 1045int
1046xfs_flush_unmap_range( 1046xfs_flush_unmap_range(
1047 struct xfs_inode *ip, 1047 struct xfs_inode *ip,
1048 xfs_off_t offset, 1048 xfs_off_t offset,
@@ -1126,9 +1126,9 @@ xfs_free_file_space(
1126 * page could be mmap'd and iomap_zero_range doesn't do that for us. 1126 * page could be mmap'd and iomap_zero_range doesn't do that for us.
1127 * Writeback of the eof page will do this, albeit clumsily. 1127 * Writeback of the eof page will do this, albeit clumsily.
1128 */ 1128 */
1129 if (offset + len >= XFS_ISIZE(ip) && ((offset + len) & PAGE_MASK)) { 1129 if (offset + len >= XFS_ISIZE(ip) && offset_in_page(offset + len) > 0) {
1130 error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, 1130 error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping,
1131 (offset + len) & ~PAGE_MASK, LLONG_MAX); 1131 round_down(offset + len, PAGE_SIZE), LLONG_MAX);
1132 } 1132 }
1133 1133
1134 return error; 1134 return error;
@@ -1195,13 +1195,7 @@ xfs_prepare_shift(
1195 * Writeback and invalidate cache for the remainder of the file as we're 1195 * Writeback and invalidate cache for the remainder of the file as we're
1196 * about to shift down every extent from offset to EOF. 1196 * about to shift down every extent from offset to EOF.
1197 */ 1197 */
1198 error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, offset, -1); 1198 error = xfs_flush_unmap_range(ip, offset, XFS_ISIZE(ip));
1199 if (error)
1200 return error;
1201 error = invalidate_inode_pages2_range(VFS_I(ip)->i_mapping,
1202 offset >> PAGE_SHIFT, -1);
1203 if (error)
1204 return error;
1205 1199
1206 /* 1200 /*
1207 * Clean out anything hanging around in the cow fork now that 1201 * Clean out anything hanging around in the cow fork now that