[XFS] XFS: Kill xfs_vtoi()
authorDavid Chinner <david@fromorbit.com>
Wed, 13 Aug 2008 06:01:45 +0000 (16:01 +1000)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Wed, 13 Aug 2008 06:01:45 +0000 (16:01 +1000)
xfs_vtoi() is redundant and only unsed in small sections of code.
Replace them with widely used XFS_I() inline and kill xfs_vtoi().

SGI-PV: 981498

SGI-Modid: xfs-linux-melb:xfs-kern:31725a

Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
fs/xfs/linux-2.6/xfs_aops.c
fs/xfs/linux-2.6/xfs_vnode.h
fs/xfs/xfs_acl.c
fs/xfs/xfs_inode.h

index fa47e43b8b41a525843c57cb4591ed9ffd334141..f42f80a3b1faca317f3e08b021c532f19e0512cc 100644 (file)
@@ -73,7 +73,6 @@ xfs_page_trace(
        unsigned long   pgoff)
 {
        xfs_inode_t     *ip;
-       bhv_vnode_t     *vp = vn_from_inode(inode);
        loff_t          isize = i_size_read(inode);
        loff_t          offset = page_offset(page);
        int             delalloc = -1, unmapped = -1, unwritten = -1;
@@ -81,7 +80,7 @@ xfs_page_trace(
        if (page_has_buffers(page))
                xfs_count_page_state(page, &delalloc, &unmapped, &unwritten);
 
-       ip = xfs_vtoi(vp);
+       ip = XFS_I(inode);
        if (!ip->i_rwtrace)
                return;
 
index 41ca2cec5d310da74c6b285c8cec9783e3b9e797..c3afecf8c5bf4a953bb5810749b4dc6461bd772e 100644 (file)
@@ -89,9 +89,9 @@ extern bhv_vnode_t    *vn_hold(bhv_vnode_t *);
 #if defined(XFS_INODE_TRACE)
 #define VN_HOLD(vp)            \
        ((void)vn_hold(vp),     \
-         xfs_itrace_hold(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address))
+         xfs_itrace_hold(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address))
 #define VN_RELE(vp)            \
-         (xfs_itrace_rele(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address), \
+         (xfs_itrace_rele(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address), \
           iput(vn_to_inode(vp)))
 #else
 #define VN_HOLD(vp)            ((void)vn_hold(vp))
index 3e4648ad9cfcbda429ed52587d42a1d989fb21f5..fdeca54540a513661ee1ab92943acdd1c8ffb5d1 100644 (file)
@@ -239,7 +239,7 @@ xfs_acl_vget(
                        goto out;
                }
                if (kind == _ACL_TYPE_ACCESS)
-                       xfs_acl_sync_mode(xfs_vtoi(vp)->i_d.di_mode, xfs_acl);
+                       xfs_acl_sync_mode(XFS_I(vp)->i_d.di_mode, xfs_acl);
                error = -posix_acl_xfs_to_xattr(xfs_acl, ext_acl, size);
        }
 out:
@@ -259,7 +259,7 @@ xfs_acl_vremove(
        VN_HOLD(vp);
        error = xfs_acl_allow_set(vp, kind);
        if (!error) {
-               error = xfs_attr_remove(xfs_vtoi(vp),
+               error = xfs_attr_remove(XFS_I(vp),
                                                kind == _ACL_TYPE_DEFAULT?
                                                SGI_ACL_DEFAULT: SGI_ACL_FILE,
                                                ATTR_ROOT);
@@ -372,7 +372,7 @@ xfs_acl_allow_set(
                return ENOTDIR;
        if (vp->i_sb->s_flags & MS_RDONLY)
                return EROFS;
-       if (xfs_vtoi(vp)->i_d.di_uid != current->fsuid && !capable(CAP_FOWNER))
+       if (XFS_I(vp)->i_d.di_uid != current->fsuid && !capable(CAP_FOWNER))
                return EPERM;
        return 0;
 }
@@ -576,7 +576,7 @@ xfs_acl_get_attr(
 
        ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1);
        flags |= ATTR_ROOT;
-       *error = xfs_attr_get(xfs_vtoi(vp),
+       *error = xfs_attr_get(XFS_I(vp),
                                        kind == _ACL_TYPE_ACCESS ?
                                        SGI_ACL_FILE : SGI_ACL_DEFAULT,
                                        (char *)aclp, &len, flags);
@@ -615,7 +615,7 @@ xfs_acl_set_attr(
                INT_SET(newace->ae_perm, ARCH_CONVERT, ace->ae_perm);
        }
        INT_SET(newacl->acl_cnt, ARCH_CONVERT, aclp->acl_cnt);
-       *error = xfs_attr_set(xfs_vtoi(vp),
+       *error = xfs_attr_set(XFS_I(vp),
                                kind == _ACL_TYPE_ACCESS ?
                                SGI_ACL_FILE: SGI_ACL_DEFAULT,
                                (char *)newacl, len, ATTR_ROOT);
@@ -639,7 +639,7 @@ xfs_acl_vtoacl(
                if (error)
                        access_acl->acl_cnt = XFS_ACL_NOT_PRESENT;
                else /* We have a good ACL and the file mode, synchronize. */
-                       xfs_acl_sync_mode(xfs_vtoi(vp)->i_d.di_mode, access_acl);
+                       xfs_acl_sync_mode(XFS_I(vp)->i_d.di_mode, access_acl);
        }
 
        if (default_acl) {
@@ -734,7 +734,7 @@ xfs_acl_setmode(
         * mode.  The m:: bits take precedence over the g:: bits.
         */
        iattr.ia_valid = ATTR_MODE;
-       iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode;
+       iattr.ia_mode = XFS_I(vp)->i_d.di_mode;
        iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO);
        ap = acl->acl_entry;
        for (i = 0; i < acl->acl_cnt; ++i) {
@@ -764,7 +764,7 @@ xfs_acl_setmode(
        if (gap && nomask)
                iattr.ia_mode |= gap->ae_perm << 3;
 
-       return xfs_setattr(xfs_vtoi(vp), &iattr, 0, sys_cred);
+       return xfs_setattr(XFS_I(vp), &iattr, 0, sys_cred);
 }
 
 /*
index 4e1e55e9077914edff328915cc38063e58025773..4088951230aa77da41c29bf9b8dbe919d8a9cb59 100644 (file)
@@ -269,11 +269,6 @@ static inline struct xfs_inode *XFS_I(struct inode *inode)
        return (struct xfs_inode *)inode->i_private;
 }
 
-static inline struct xfs_inode *xfs_vtoi(bhv_vnode_t *vp)
-{
-       return XFS_I((struct inode *)vp);
-}
-
 /* convert from xfs inode to vfs inode */
 static inline struct inode *VFS_I(struct xfs_inode *ip)
 {