[XFS] kill the v_flag member in struct bhv_vnode
[deliverable/linux.git] / fs / xfs / xfs_vnodeops.c
index 2b30fa690b4aaaa6346553caf968afce76ef1c3b..f2c037a9564efa8e072fa5baa80d1ec90e520ce5 100644 (file)
@@ -230,7 +230,7 @@ xfs_setattr(
 
        vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
 
-       if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
+       if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
                return XFS_ERROR(EROFS);
 
        /*
@@ -592,7 +592,7 @@ xfs_setattr(
                if (!code &&
                    (ip->i_size != ip->i_d.di_size) &&
                    (vap->va_size > ip->i_d.di_size)) {
-                       code = bhv_vop_flush_pages(XFS_ITOV(ip),
+                       code = xfs_flush_pages(ip,
                                        ip->i_d.di_size, vap->va_size,
                                        XFS_B_ASYNC, FI_NONE);
                }
@@ -660,7 +660,7 @@ xfs_setattr(
                         * vnode and flush it when the file is closed, and
                         * do not wait the usual (long) time for writeout.
                         */
-                       VTRUNCATE(vp);
+                       xfs_iflags_set(ip, XFS_ITRUNCATED);
                }
                /*
                 * Have to do this even if the file's size doesn't change.
@@ -864,10 +864,6 @@ xfs_setattr(
         * racing calls to vop_vnode_change.
         */
        mandlock_after = MANDLOCK(vp, ip->i_d.di_mode);
-       if (mandlock_before != mandlock_after) {
-               bhv_vop_vnode_change(vp, VCHANGE_FLAGS_ENF_LOCKING,
-                                mandlock_after);
-       }
 
        xfs_iunlock(ip, lock_flags);
 
@@ -1519,10 +1515,12 @@ xfs_release(
                return 0;
 
        /* If this is a read-only mount, don't do this (would generate I/O) */
-       if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
+       if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
                return 0;
 
        if (!XFS_FORCED_SHUTDOWN(mp)) {
+               int truncated;
+
                /*
                 * If we are using filestreams, and we have an unlinked
                 * file that we are processing the last close on, then nothing
@@ -1543,8 +1541,14 @@ xfs_release(
                 * significantly reducing the time window where we'd otherwise
                 * be exposed to that problem.
                 */
-               if (VUNTRUNCATE(vp) && VN_DIRTY(vp) && ip->i_delayed_blks > 0)
-                       bhv_vop_flush_pages(vp, 0, -1, XFS_B_ASYNC, FI_NONE);
+               spin_lock(&ip->i_flags_lock);
+               truncated = __xfs_iflags_test(ip, XFS_ITRUNCATED);
+               if (truncated)
+                       ip->i_flags &= ~XFS_ITRUNCATED;
+               spin_unlock(&ip->i_flags_lock);
+
+               if (truncated && VN_DIRTY(vp) && ip->i_delayed_blks > 0)
+                       xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE);
        }
 
 #ifdef HAVE_REFCACHE
@@ -1625,7 +1629,7 @@ xfs_inactive(
        error = 0;
 
        /* If this is a read-only mount, don't do this (would generate I/O) */
-       if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
+       if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
                goto out;
 
        if (ip->i_d.di_nlink != 0) {
@@ -2008,12 +2012,6 @@ xfs_create(
        XFS_QM_DQRELE(mp, udqp);
        XFS_QM_DQRELE(mp, gdqp);
 
-       /*
-        * Propagate the fact that the vnode changed after the
-        * xfs_inode locks have been released.
-        */
-       bhv_vop_vnode_change(vp, VCHANGE_FLAGS_TRUNCATED, 3);
-
        *vpp = vp;
 
        /* Fallthrough to std_return with error = 0  */
@@ -2512,11 +2510,6 @@ xfs_remove(
 
        vn_trace_exit(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address);
 
-       /*
-        * Let interposed file systems know about removed links.
-        */
-       bhv_vop_link_removed(XFS_ITOV(ip), dir_vp, link_zero);
-
        IRELE(ip);
 
 /*     Fall through to std_return with error = 0 */
@@ -3146,11 +3139,6 @@ xfs_rmdir(
        }
 
 
-       /*
-        * Let interposed file systems know about removed links.
-        */
-       bhv_vop_link_removed(XFS_ITOV(cdp), dir_vp, last_cdp_link);
-
        IRELE(cdp);
 
        /* Fall through to std_return with error = 0 or the errno
@@ -3732,7 +3720,8 @@ xfs_reclaim(
                XFS_MOUNT_ILOCK(mp);
                spin_lock(&ip->i_flags_lock);
                __xfs_iflags_set(ip, XFS_IRECLAIMABLE);
-               vn_bhv_remove(VN_BHV_HEAD(vp), XFS_ITOBHV(ip));
+               vn_to_inode(vp)->i_private = NULL;
+               ip->i_vnode = NULL;
                spin_unlock(&ip->i_flags_lock);
                list_add_tail(&ip->i_reclaim, &mp->m_del_inodes);
                XFS_MOUNT_IUNLOCK(mp);
@@ -4214,7 +4203,8 @@ xfs_free_file_space(
        if (VN_CACHED(vp) != 0) {
                xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1,
                                ctooff(offtoct(ioffset)), -1);
-               error = bhv_vop_flushinval_pages(vp, ctooff(offtoct(ioffset)),
+               error = xfs_flushinval_pages(ip,
+                               ctooff(offtoct(ioffset)),
                                -1, FI_REMAPF_LOCKED);
                if (error)
                        goto out_unlock_iolock;
This page took 0.027972 seconds and 5 git commands to generate.