aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Chinner <david@fromorbit.com>2008-08-13 02:01:45 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-08-13 02:01:45 -0400
commite6064d30c3407db7f8c19d5538ec847b29e47e30 (patch)
tree0717b05a9a937e707c99309be8264b22546e4a44 /fs
parente4f7529108d01bf66af8ebecd6be2b98d8db30ce (diff)
[XFS] XFS: Kill xfs_vtoi()
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h4
-rw-r--r--fs/xfs/xfs_acl.c16
-rw-r--r--fs/xfs/xfs_inode.h5
4 files changed, 11 insertions, 17 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index fa47e43b8b41..f42f80a3b1fa 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -73,7 +73,6 @@ xfs_page_trace(
73 unsigned long pgoff) 73 unsigned long pgoff)
74{ 74{
75 xfs_inode_t *ip; 75 xfs_inode_t *ip;
76 bhv_vnode_t *vp = vn_from_inode(inode);
77 loff_t isize = i_size_read(inode); 76 loff_t isize = i_size_read(inode);
78 loff_t offset = page_offset(page); 77 loff_t offset = page_offset(page);
79 int delalloc = -1, unmapped = -1, unwritten = -1; 78 int delalloc = -1, unmapped = -1, unwritten = -1;
@@ -81,7 +80,7 @@ xfs_page_trace(
81 if (page_has_buffers(page)) 80 if (page_has_buffers(page))
82 xfs_count_page_state(page, &delalloc, &unmapped, &unwritten); 81 xfs_count_page_state(page, &delalloc, &unmapped, &unwritten);
83 82
84 ip = xfs_vtoi(vp); 83 ip = XFS_I(inode);
85 if (!ip->i_rwtrace) 84 if (!ip->i_rwtrace)
86 return; 85 return;
87 86
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 41ca2cec5d31..c3afecf8c5bf 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -89,9 +89,9 @@ extern bhv_vnode_t *vn_hold(bhv_vnode_t *);
89#if defined(XFS_INODE_TRACE) 89#if defined(XFS_INODE_TRACE)
90#define VN_HOLD(vp) \ 90#define VN_HOLD(vp) \
91 ((void)vn_hold(vp), \ 91 ((void)vn_hold(vp), \
92 xfs_itrace_hold(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address)) 92 xfs_itrace_hold(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address))
93#define VN_RELE(vp) \ 93#define VN_RELE(vp) \
94 (xfs_itrace_rele(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address), \ 94 (xfs_itrace_rele(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address), \
95 iput(vn_to_inode(vp))) 95 iput(vn_to_inode(vp)))
96#else 96#else
97#define VN_HOLD(vp) ((void)vn_hold(vp)) 97#define VN_HOLD(vp) ((void)vn_hold(vp))
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 3e4648ad9cfc..fdeca54540a5 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -239,7 +239,7 @@ xfs_acl_vget(
239 goto out; 239 goto out;
240 } 240 }
241 if (kind == _ACL_TYPE_ACCESS) 241 if (kind == _ACL_TYPE_ACCESS)
242 xfs_acl_sync_mode(xfs_vtoi(vp)->i_d.di_mode, xfs_acl); 242 xfs_acl_sync_mode(XFS_I(vp)->i_d.di_mode, xfs_acl);
243 error = -posix_acl_xfs_to_xattr(xfs_acl, ext_acl, size); 243 error = -posix_acl_xfs_to_xattr(xfs_acl, ext_acl, size);
244 } 244 }
245out: 245out:
@@ -259,7 +259,7 @@ xfs_acl_vremove(
259 VN_HOLD(vp); 259 VN_HOLD(vp);
260 error = xfs_acl_allow_set(vp, kind); 260 error = xfs_acl_allow_set(vp, kind);
261 if (!error) { 261 if (!error) {
262 error = xfs_attr_remove(xfs_vtoi(vp), 262 error = xfs_attr_remove(XFS_I(vp),
263 kind == _ACL_TYPE_DEFAULT? 263 kind == _ACL_TYPE_DEFAULT?
264 SGI_ACL_DEFAULT: SGI_ACL_FILE, 264 SGI_ACL_DEFAULT: SGI_ACL_FILE,
265 ATTR_ROOT); 265 ATTR_ROOT);
@@ -372,7 +372,7 @@ xfs_acl_allow_set(
372 return ENOTDIR; 372 return ENOTDIR;
373 if (vp->i_sb->s_flags & MS_RDONLY) 373 if (vp->i_sb->s_flags & MS_RDONLY)
374 return EROFS; 374 return EROFS;
375 if (xfs_vtoi(vp)->i_d.di_uid != current->fsuid && !capable(CAP_FOWNER)) 375 if (XFS_I(vp)->i_d.di_uid != current->fsuid && !capable(CAP_FOWNER))
376 return EPERM; 376 return EPERM;
377 return 0; 377 return 0;
378} 378}
@@ -576,7 +576,7 @@ xfs_acl_get_attr(
576 576
577 ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1); 577 ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1);
578 flags |= ATTR_ROOT; 578 flags |= ATTR_ROOT;
579 *error = xfs_attr_get(xfs_vtoi(vp), 579 *error = xfs_attr_get(XFS_I(vp),
580 kind == _ACL_TYPE_ACCESS ? 580 kind == _ACL_TYPE_ACCESS ?
581 SGI_ACL_FILE : SGI_ACL_DEFAULT, 581 SGI_ACL_FILE : SGI_ACL_DEFAULT,
582 (char *)aclp, &len, flags); 582 (char *)aclp, &len, flags);
@@ -615,7 +615,7 @@ xfs_acl_set_attr(
615 INT_SET(newace->ae_perm, ARCH_CONVERT, ace->ae_perm); 615 INT_SET(newace->ae_perm, ARCH_CONVERT, ace->ae_perm);
616 } 616 }
617 INT_SET(newacl->acl_cnt, ARCH_CONVERT, aclp->acl_cnt); 617 INT_SET(newacl->acl_cnt, ARCH_CONVERT, aclp->acl_cnt);
618 *error = xfs_attr_set(xfs_vtoi(vp), 618 *error = xfs_attr_set(XFS_I(vp),
619 kind == _ACL_TYPE_ACCESS ? 619 kind == _ACL_TYPE_ACCESS ?
620 SGI_ACL_FILE: SGI_ACL_DEFAULT, 620 SGI_ACL_FILE: SGI_ACL_DEFAULT,
621 (char *)newacl, len, ATTR_ROOT); 621 (char *)newacl, len, ATTR_ROOT);
@@ -639,7 +639,7 @@ xfs_acl_vtoacl(
639 if (error) 639 if (error)
640 access_acl->acl_cnt = XFS_ACL_NOT_PRESENT; 640 access_acl->acl_cnt = XFS_ACL_NOT_PRESENT;
641 else /* We have a good ACL and the file mode, synchronize. */ 641 else /* We have a good ACL and the file mode, synchronize. */
642 xfs_acl_sync_mode(xfs_vtoi(vp)->i_d.di_mode, access_acl); 642 xfs_acl_sync_mode(XFS_I(vp)->i_d.di_mode, access_acl);
643 } 643 }
644 644
645 if (default_acl) { 645 if (default_acl) {
@@ -734,7 +734,7 @@ xfs_acl_setmode(
734 * mode. The m:: bits take precedence over the g:: bits. 734 * mode. The m:: bits take precedence over the g:: bits.
735 */ 735 */
736 iattr.ia_valid = ATTR_MODE; 736 iattr.ia_valid = ATTR_MODE;
737 iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode; 737 iattr.ia_mode = XFS_I(vp)->i_d.di_mode;
738 iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); 738 iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO);
739 ap = acl->acl_entry; 739 ap = acl->acl_entry;
740 for (i = 0; i < acl->acl_cnt; ++i) { 740 for (i = 0; i < acl->acl_cnt; ++i) {
@@ -764,7 +764,7 @@ xfs_acl_setmode(
764 if (gap && nomask) 764 if (gap && nomask)
765 iattr.ia_mode |= gap->ae_perm << 3; 765 iattr.ia_mode |= gap->ae_perm << 3;
766 766
767 return xfs_setattr(xfs_vtoi(vp), &iattr, 0, sys_cred); 767 return xfs_setattr(XFS_I(vp), &iattr, 0, sys_cred);
768} 768}
769 769
770/* 770/*
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 4e1e55e90779..4088951230aa 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -269,11 +269,6 @@ static inline struct xfs_inode *XFS_I(struct inode *inode)
269 return (struct xfs_inode *)inode->i_private; 269 return (struct xfs_inode *)inode->i_private;
270} 270}
271 271
272static inline struct xfs_inode *xfs_vtoi(bhv_vnode_t *vp)
273{
274 return XFS_I((struct inode *)vp);
275}
276
277/* convert from xfs inode to vfs inode */ 272/* convert from xfs inode to vfs inode */
278static inline struct inode *VFS_I(struct xfs_inode *ip) 273static inline struct inode *VFS_I(struct xfs_inode *ip)
279{ 274{