diff options
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 24 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_dfrag.c | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 16 |
4 files changed, 17 insertions, 32 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index aa9daaea6c34..46b61a859af4 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -209,30 +209,6 @@ unlock: | |||
209 | return (-status); | 209 | return (-status); |
210 | } | 210 | } |
211 | 211 | ||
212 | /* | ||
213 | * xfs_inval_cached_pages | ||
214 | * | ||
215 | * This routine is responsible for keeping direct I/O and buffered I/O | ||
216 | * somewhat coherent. From here we make sure that we're at least | ||
217 | * temporarily holding the inode I/O lock exclusively and then call | ||
218 | * the page cache to flush and invalidate any cached pages. If there | ||
219 | * are no cached pages this routine will be very quick. | ||
220 | */ | ||
221 | void | ||
222 | xfs_inval_cached_pages( | ||
223 | vnode_t *vp, | ||
224 | xfs_iocore_t *io, | ||
225 | xfs_off_t offset, | ||
226 | int write, | ||
227 | int relock) | ||
228 | { | ||
229 | if (VN_CACHED(vp)) { | ||
230 | xfs_inval_cached_trace(io, offset, -1, ctooff(offtoct(offset)), -1); | ||
231 | VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(offset)), -1, FI_REMAPF_LOCKED); | ||
232 | } | ||
233 | |||
234 | } | ||
235 | |||
236 | ssize_t /* bytes read, or (-) error */ | 212 | ssize_t /* bytes read, or (-) error */ |
237 | xfs_read( | 213 | xfs_read( |
238 | bhv_desc_t *bdp, | 214 | bhv_desc_t *bdp, |
diff --git a/fs/xfs/linux-2.6/xfs_lrw.h b/fs/xfs/linux-2.6/xfs_lrw.h index d723e35254a0..f197a720e394 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.h +++ b/fs/xfs/linux-2.6/xfs_lrw.h | |||
@@ -94,8 +94,6 @@ extern int xfs_bdstrat_cb(struct xfs_buf *); | |||
94 | 94 | ||
95 | extern int xfs_zero_eof(struct vnode *, struct xfs_iocore *, xfs_off_t, | 95 | extern int xfs_zero_eof(struct vnode *, struct xfs_iocore *, xfs_off_t, |
96 | xfs_fsize_t, xfs_fsize_t); | 96 | xfs_fsize_t, xfs_fsize_t); |
97 | extern void xfs_inval_cached_pages(struct vnode *, struct xfs_iocore *, | ||
98 | xfs_off_t, int, int); | ||
99 | extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *, | 97 | extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *, |
100 | const struct iovec *, unsigned int, | 98 | const struct iovec *, unsigned int, |
101 | loff_t *, int, struct cred *); | 99 | loff_t *, int, struct cred *); |
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index 63abdc2ac7f4..681be5c93af5 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c | |||
@@ -180,9 +180,10 @@ xfs_swapext( | |||
180 | goto error0; | 180 | goto error0; |
181 | } | 181 | } |
182 | 182 | ||
183 | if (VN_CACHED(tvp) != 0) | 183 | if (VN_CACHED(tvp) != 0) { |
184 | xfs_inval_cached_pages(XFS_ITOV(tip), &(tip->i_iocore), | 184 | xfs_inval_cached_trace(&tip->i_iocore, 0, -1, 0, -1); |
185 | (xfs_off_t)0, 0, 0); | 185 | VOP_FLUSHINVAL_PAGES(tvp, 0, -1, FI_REMAPF_LOCKED); |
186 | } | ||
186 | 187 | ||
187 | /* Verify O_DIRECT for ftmp */ | 188 | /* Verify O_DIRECT for ftmp */ |
188 | if (VN_CACHED(tvp) != 0) { | 189 | if (VN_CACHED(tvp) != 0) { |
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 |