[XFS] kill v_vfsp member from struct bhv_vnode
authorChristoph Hellwig <hch@infradead.org>
Wed, 29 Aug 2007 01:44:18 +0000 (11:44 +1000)
committerTim Shimmin <tes@chook.melbourne.sgi.com>
Tue, 16 Oct 2007 01:23:43 +0000 (11:23 +1000)
We can easily get at the vfsp through the super_block but it will soon be
gone anyway.

SGI-PV: 969608
SGI-Modid: xfs-linux-melb:xfs-kern:29494a

Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
fs/xfs/linux-2.6/xfs_file.c
fs/xfs/linux-2.6/xfs_ioctl.c
fs/xfs/linux-2.6/xfs_lrw.c
fs/xfs/linux-2.6/xfs_super.c
fs/xfs/linux-2.6/xfs_vnode.c
fs/xfs/linux-2.6/xfs_vnode.h
fs/xfs/xfs_acl.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_vnodeops.c

index 83707708ebb14d5dce292eb0546d71517e4b0018..1d72dbb1a73d5e644d0a282a8bf272156c88fb77 100644 (file)
@@ -261,7 +261,7 @@ xfs_file_mmap(
        vma->vm_flags |= VM_CAN_NONLINEAR;
 
 #ifdef CONFIG_XFS_DMAPI
-       if (vn_from_inode(filp->f_path.dentry->d_inode)->v_vfsp->vfs_flag & VFS_DMI)
+       if (vfs_from_sb(filp->f_path.dentry->d_inode->i_sb)->vfs_flag & VFS_DMI)
                vma->vm_ops = &xfs_dmapi_file_vm_ops;
 #endif /* CONFIG_XFS_DMAPI */
 
@@ -320,16 +320,14 @@ xfs_vm_mprotect(
        struct vm_area_struct *vma,
        unsigned int    newflags)
 {
-       bhv_vnode_t     *vp = vn_from_inode(vma->vm_file->f_path.dentry->d_inode);
+       struct inode    *inode = vma->vm_file->f_path.dentry->d_inode;
+       bhv_vfs_t       *vfsp = vfs_from_sb(inode->i_sb);
        int             error = 0;
 
-       if (vp->v_vfsp->vfs_flag & VFS_DMI) {
+       if (vfsp->vfs_flag & VFS_DMI) {
                if ((vma->vm_flags & VM_MAYSHARE) &&
-                   (newflags & VM_WRITE) && !(vma->vm_flags & VM_WRITE)) {
-                       xfs_mount_t     *mp = XFS_VFSTOM(vp->v_vfsp);
-
-                       error = XFS_SEND_MMAP(mp, vma, VM_WRITE);
-                   }
+                   (newflags & VM_WRITE) && !(vma->vm_flags & VM_WRITE))
+                       error = XFS_SEND_MMAP(XFS_VFSTOM(vfsp), vma, VM_WRITE);
        }
        return error;
 }
@@ -346,18 +344,17 @@ STATIC int
 xfs_file_open_exec(
        struct inode    *inode)
 {
-       bhv_vnode_t     *vp = vn_from_inode(inode);
+       bhv_vfs_t       *vfsp = vfs_from_sb(inode->i_sb);
 
-       if (unlikely(vp->v_vfsp->vfs_flag & VFS_DMI)) {
-               xfs_mount_t     *mp = XFS_VFSTOM(vp->v_vfsp);
-               xfs_inode_t     *ip = xfs_vtoi(vp);
+       if (unlikely(vfsp->vfs_flag & VFS_DMI)) {
+               if (DM_EVENT_ENABLED(XFS_I(inode), DM_EVENT_READ)) {
+                       bhv_vnode_t *vp = vn_from_inode(inode);
 
-               if (!ip)
-                       return -EINVAL;
-               if (DM_EVENT_ENABLED(ip, DM_EVENT_READ))
-                       return -XFS_SEND_DATA(mp, DM_EVENT_READ, vp,
-                                              0, 0, 0, NULL);
+                       return -XFS_SEND_DATA(XFS_VFSTOM(vfsp), DM_EVENT_READ,
+                                               vp, 0, 0, 0, NULL);
+               }
        }
+
        return 0;
 }
 #endif /* HAVE_FOP_OPEN_EXEC */
index 9bba9f8be1eb886e4d9f335a4927e8118724cf4b..8ff465db909b6100de3130466b23eb4afbb8b352 100644 (file)
@@ -138,7 +138,8 @@ xfs_find_handle(
        vp = vn_from_inode(inode);
 
        /* now we can grab the fsid */
-       memcpy(&handle.ha_fsid, vp->v_vfsp->vfs_altfsid, sizeof(xfs_fsid_t));
+       memcpy(&handle.ha_fsid, XFS_MTOVFS(XFS_I(inode)->i_mount)->vfs_altfsid,
+                       sizeof(xfs_fsid_t));
        hsize = sizeof(xfs_fsid_t);
 
        if (cmd != XFS_IOC_PATH_TO_FSHANDLE) {
index fb04b11bb81599c4ec1b8864fca782f1570c70b0..5b95a7297fd1a0e7c425e2078d38c801af28360e 100644 (file)
@@ -621,7 +621,7 @@ xfs_write(
        io = &xip->i_iocore;
        mp = io->io_mount;
 
-       vfs_wait_for_freeze(vp->v_vfsp, SB_FREEZE_WRITE);
+       vfs_wait_for_freeze(XFS_MTOVFS(mp), SB_FREEZE_WRITE);
 
        if (XFS_FORCED_SHUTDOWN(mp))
                return -EIO;
index 42d6ed1788ff477c79cdf8fc7166fac4382e5cef..650c24ab27e246db74db7a1cd0723572e47fb325 100644 (file)
@@ -210,7 +210,6 @@ xfs_initialize_vnode(
        struct inode            *inode = vn_to_inode(vp);
 
        if (!ip->i_vnode) {
-               vp->v_vfsp = bhvtovfs(bdp);
                ip->i_vnode = vp;
                inode->i_private = ip;
        }
index ad0494c5c0d16de1cb1f6ce4eea36c6d415aa435..342c57879901e325187ad2b0e04fa391515c39b4 100644 (file)
@@ -69,8 +69,10 @@ vn_ioerror(
        char            *f,
        int             l)
 {
+       bhv_vfs_t       *vfsp = vfs_from_sb(vp->v_inode.i_sb);
+
        if (unlikely(error == -ENODEV))
-               bhv_vfs_force_shutdown(vp->v_vfsp, SHUTDOWN_DEVICE_REQ, f, l);
+               bhv_vfs_force_shutdown(vfsp, SHUTDOWN_DEVICE_REQ, f, l);
 }
 
 bhv_vnode_t *
index 5abcbd198d73f90d07078381a4f2c5f578920b40..0f9ba6585c86b04ef9009f7b9a065ba703ef0d05 100644 (file)
@@ -35,11 +35,10 @@ typedef enum bhv_vflags {
 
 /*
  * MP locking protocols:
- *     v_flag, v_vfsp                          VN_LOCK/VN_UNLOCK
+ *     v_flag,                                 VN_LOCK/VN_UNLOCK
  */
 typedef struct bhv_vnode {
        bhv_vflags_t    v_flag;                 /* vnode flags (see above) */
-       bhv_vfs_t       *v_vfsp;                /* ptr to containing VFS */
        bhv_vnumber_t   v_number;               /* in-core vnode number */
        spinlock_t      v_lock;                 /* VN_LOCK/VN_UNLOCK */
        atomic_t        v_iocount;              /* outstanding I/O count */
index 034c5ea80dd14f694c4f65ed9034a9adc93396e0..817d9e93c2c54c4b6753f2dd5ede4348b14b65f0 100644 (file)
@@ -372,6 +372,7 @@ xfs_acl_allow_set(
        bhv_vnode_t     *vp,
        int             kind)
 {
+       xfs_inode_t     *ip = xfs_vtoi(vp);
        bhv_vattr_t     va;
        int             error;
 
@@ -379,10 +380,10 @@ xfs_acl_allow_set(
                return EPERM;
        if (kind == _ACL_TYPE_DEFAULT && !VN_ISDIR(vp))
                return ENOTDIR;
-       if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
+       if (vp->v_inode.i_sb->s_flags & MS_RDONLY)
                return EROFS;
        va.va_mask = XFS_AT_UID;
-       error = xfs_getattr(xfs_vtoi(vp), &va, 0);
+       error = xfs_getattr(ip, &va, 0);
        if (error)
                return error;
        if (va.va_uid != current->fsuid && !capable(CAP_FOWNER))
index c2fc4838a5fa188b33d5df69e92b3b88c524028c..c07553bbcdb470d10e2c575d41768f5cd0ed8a36 100644 (file)
@@ -1154,7 +1154,7 @@ xfs_ialloc(
        if ((prid != 0) && (ip->i_d.di_version == XFS_DINODE_VERSION_1))
                xfs_bump_ino_vers2(tp, ip);
 
-       if (pip && XFS_INHERIT_GID(pip, vp->v_vfsp)) {
+       if (pip && XFS_INHERIT_GID(pip, XFS_MTOVFS(pip->i_mount))) {
                ip->i_d.di_gid = pip->i_d.di_gid;
                if ((pip->i_d.di_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) {
                        ip->i_d.di_mode |= S_ISGID;
index 5eb392d062983555ddb819aa7df8290cbd467e30..7ebbfa0c4f0ffa02cac3640810eb588f3832e3ad 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);
 
        /*
@@ -1515,7 +1515,7 @@ 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)) {
@@ -1621,7 +1621,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) {