diff options
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 96dc18b73cf0..d64ebcfa0b6c 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -4329,6 +4329,7 @@ xfs_free_file_space( | |||
4329 | xfs_off_t len, | 4329 | xfs_off_t len, |
4330 | int attr_flags) | 4330 | int attr_flags) |
4331 | { | 4331 | { |
4332 | vnode_t *vp; | ||
4332 | int committed; | 4333 | int committed; |
4333 | int done; | 4334 | int done; |
4334 | xfs_off_t end_dmi_offset; | 4335 | xfs_off_t end_dmi_offset; |
@@ -4349,9 +4350,11 @@ xfs_free_file_space( | |||
4349 | xfs_trans_t *tp; | 4350 | xfs_trans_t *tp; |
4350 | int need_iolock = 1; | 4351 | int need_iolock = 1; |
4351 | 4352 | ||
4352 | vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address); | 4353 | vp = XFS_ITOV(ip); |
4353 | mp = ip->i_mount; | 4354 | mp = ip->i_mount; |
4354 | 4355 | ||
4356 | vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); | ||
4357 | |||
4355 | if ((error = XFS_QM_DQATTACH(mp, ip, 0))) | 4358 | if ((error = XFS_QM_DQATTACH(mp, ip, 0))) |
4356 | return error; | 4359 | return error; |
4357 | 4360 | ||
@@ -4368,7 +4371,7 @@ xfs_free_file_space( | |||
4368 | DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) { | 4371 | DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) { |
4369 | if (end_dmi_offset > ip->i_d.di_size) | 4372 | if (end_dmi_offset > ip->i_d.di_size) |
4370 | end_dmi_offset = ip->i_d.di_size; | 4373 | end_dmi_offset = ip->i_d.di_size; |
4371 | error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOV(ip), | 4374 | error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, vp, |
4372 | offset, end_dmi_offset - offset, | 4375 | offset, end_dmi_offset - offset, |
4373 | AT_DELAY_FLAG(attr_flags), NULL); | 4376 | AT_DELAY_FLAG(attr_flags), NULL); |
4374 | if (error) | 4377 | if (error) |
@@ -4387,7 +4390,14 @@ xfs_free_file_space( | |||
4387 | ioffset = offset & ~(rounding - 1); | 4390 | ioffset = offset & ~(rounding - 1); |
4388 | if (ilen & (rounding - 1)) | 4391 | if (ilen & (rounding - 1)) |
4389 | ilen = (ilen + rounding) & ~(rounding - 1); | 4392 | ilen = (ilen + rounding) & ~(rounding - 1); |
4390 | xfs_inval_cached_pages(XFS_ITOV(ip), &(ip->i_iocore), ioffset, 0, 0); | 4393 | |
4394 | if (VN_CACHED(vp) != 0) { | ||
4395 | xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1, | ||
4396 | ctooff(offtoct(ioffset)), -1); | ||
4397 | VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(ioffset)), | ||
4398 | -1, FI_REMAPF_LOCKED); | ||
4399 | } | ||
4400 | |||
4391 | /* | 4401 | /* |
4392 | * Need to zero the stuff we're not freeing, on disk. | 4402 | * Need to zero the stuff we're not freeing, on disk. |
4393 | * If its a realtime file & can't use unwritten extents then we | 4403 | * If its a realtime file & can't use unwritten extents then we |