summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_util.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-05-22 00:17:27 +0100
committerMark Brown <broonie@linaro.org>2014-05-22 00:17:27 +0100
commitbfbc344732badffe94f096f929e4a105b3b92d1f (patch)
treef4fc6c06108495bd2c33ecff68c065514e66a8cc /fs/xfs/xfs_bmap_util.c
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff)
parentc6466950e917890be3050171f6745ccb9d91d35f (diff)
Merge tag 'mfd-regulator-v3.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into regulator-bcm590xxx
Immutable branch between MFD and Regulator due for v3.16 merge-window.
Diffstat (limited to 'fs/xfs/xfs_bmap_util.c')
-rw-r--r--fs/xfs/xfs_bmap_util.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 01f6a646caa..296160b8e78 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1418,6 +1418,8 @@ xfs_zero_file_space(
xfs_off_t end_boundary;
int error;
+ trace_xfs_zero_file_space(ip);
+
granularity = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE);
/*
@@ -1432,9 +1434,18 @@ xfs_zero_file_space(
ASSERT(end_boundary <= offset + len);
if (start_boundary < end_boundary - 1) {
- /* punch out the page cache over the conversion range */
+ /*
+ * punch out delayed allocation blocks and the page cache over
+ * the conversion range
+ */
+ xfs_ilock(ip, XFS_ILOCK_EXCL);
+ error = xfs_bmap_punch_delalloc_range(ip,
+ XFS_B_TO_FSBT(mp, start_boundary),
+ XFS_B_TO_FSB(mp, end_boundary - start_boundary));
+ xfs_iunlock(ip, XFS_ILOCK_EXCL);
truncate_pagecache_range(VFS_I(ip), start_boundary,
end_boundary - 1);
+
/* convert the blocks */
error = xfs_alloc_file_space(ip, start_boundary,
end_boundary - start_boundary - 1,