]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[XFS] (mostly) remove xfs_inval_cached_pages Since the last round of
authorChristoph Hellwig <hch@sgi.com>
Tue, 21 Jun 2005 05:47:39 +0000 (15:47 +1000)
committerNathan Scott <nathans@sgi.com>
Tue, 21 Jun 2005 05:47:39 +0000 (15:47 +1000)
direct I/O locking changes it is just a wrapper around
VOP_FLUSHINVAL_PAGES, so it's not nessecary anymore.  Keep a simplified
version for kernels < 2.4.22, as these don't have the changed direct I/O
locking.

SGI-PV: 938064
SGI-Modid: xfs-linux:xfs-kern:194420a

Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/linux-2.6/xfs_lrw.c
fs/xfs/linux-2.6/xfs_lrw.h
fs/xfs/xfs_dfrag.c
fs/xfs/xfs_vnodeops.c

index aa9daaea6c34b2d98697b899e73ee10e4222e1bb..46b61a859af425fffa76d4bdc41a62614d84ec29 100644 (file)
@@ -209,30 +209,6 @@ unlock:
        return (-status);
 }
 
-/*
- * xfs_inval_cached_pages
- * 
- * This routine is responsible for keeping direct I/O and buffered I/O
- * somewhat coherent.  From here we make sure that we're at least
- * temporarily holding the inode I/O lock exclusively and then call
- * the page cache to flush and invalidate any cached pages.  If there
- * are no cached pages this routine will be very quick.
- */
-void
-xfs_inval_cached_pages(
-       vnode_t         *vp,
-       xfs_iocore_t    *io,
-       xfs_off_t       offset,
-       int             write,
-       int             relock)
-{
-       if (VN_CACHED(vp)) {
-               xfs_inval_cached_trace(io, offset, -1, ctooff(offtoct(offset)), -1);
-               VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(offset)), -1, FI_REMAPF_LOCKED);
-       }
-
-}
-
 ssize_t                        /* bytes read, or (-)  error */
 xfs_read(
        bhv_desc_t              *bdp,
index d723e35254a0b977b169e2bf65b6de34e27599b5..f197a720e394db5b1bca538a3f826882cc3b7f46 100644 (file)
@@ -94,8 +94,6 @@ extern int xfs_bdstrat_cb(struct xfs_buf *);
 
 extern int xfs_zero_eof(struct vnode *, struct xfs_iocore *, xfs_off_t,
                                xfs_fsize_t, xfs_fsize_t);
-extern void xfs_inval_cached_pages(struct vnode        *, struct xfs_iocore *,
-                               xfs_off_t, int, int);
 extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *,
                                const struct iovec *, unsigned int,
                                loff_t *, int, struct cred *);
index 63abdc2ac7f4ba0da434c45e32f08a8e6be5209a..681be5c93af500f63fc2cd4e744682023b6c7497 100644 (file)
@@ -180,9 +180,10 @@ xfs_swapext(
                goto error0;
        }
 
-       if (VN_CACHED(tvp) != 0)
-               xfs_inval_cached_pages(XFS_ITOV(tip), &(tip->i_iocore),
-                                               (xfs_off_t)0, 0, 0);
+       if (VN_CACHED(tvp) != 0) {
+               xfs_inval_cached_trace(&tip->i_iocore, 0, -1, 0, -1);
+               VOP_FLUSHINVAL_PAGES(tvp, 0, -1, FI_REMAPF_LOCKED);
+       }
 
        /* Verify O_DIRECT for ftmp */
        if (VN_CACHED(tvp) != 0) {
index 96dc18b73cf00b59587e16ba8571fdacc36ebe8c..d64ebcfa0b6ceb15bee47d77004b5d78442267a5 100644 (file)
@@ -4329,6 +4329,7 @@ xfs_free_file_space(
        xfs_off_t               len,
        int                     attr_flags)
 {
+       vnode_t                 *vp;
        int                     committed;
        int                     done;
        xfs_off_t               end_dmi_offset;
@@ -4349,9 +4350,11 @@ xfs_free_file_space(
        xfs_trans_t             *tp;
        int                     need_iolock = 1;
 
-       vn_trace_entry(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address);
+       vp = XFS_ITOV(ip);
        mp = ip->i_mount;
 
+       vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
+
        if ((error = XFS_QM_DQATTACH(mp, ip, 0)))
                return error;
 
@@ -4368,7 +4371,7 @@ xfs_free_file_space(
            DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) {
                if (end_dmi_offset > ip->i_d.di_size)
                        end_dmi_offset = ip->i_d.di_size;
-               error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOV(ip),
+               error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, vp,
                                offset, end_dmi_offset - offset,
                                AT_DELAY_FLAG(attr_flags), NULL);
                if (error)
@@ -4387,7 +4390,14 @@ xfs_free_file_space(
        ioffset = offset & ~(rounding - 1);
        if (ilen & (rounding - 1))
                ilen = (ilen + rounding) & ~(rounding - 1);
-       xfs_inval_cached_pages(XFS_ITOV(ip), &(ip->i_iocore), ioffset, 0, 0);
+
+       if (VN_CACHED(vp) != 0) {
+               xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1,
+                               ctooff(offtoct(ioffset)), -1);
+               VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(ioffset)),
+                               -1, FI_REMAPF_LOCKED);
+       }
+
        /*
         * Need to zero the stuff we're not freeing, on disk.
         * If its a realtime file & can't use unwritten extents then we