diff options
author | David Chinner <david@fromorbit.com> | 2008-08-13 01:45:15 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-08-13 01:45:15 -0400 |
commit | 016516462575d28fab3354f762cad16c86c09116 (patch) | |
tree | ef644fe09f5eb963df28ad7e7bda3d547cae46d1 /fs/xfs/linux-2.6/xfs_iops.c | |
parent | 3790689fa3c771bba6bafb7dee3e8389dd0b55bc (diff) |
[XFS] Avoid directly referencing the VFS inode.
In several places we directly convert from the XFS inode
to the linux (VFS) inode by a simple deference of ip->i_vnode.
We should not do this - a helper function should be used to
extract the VFS inode from the XFS inode.
Introduce the function VFS_I() to extract the VFS inode
from the XFS inode. The name was chosen to match XFS_I() which
is used to extract the XFS inode from the VFS inode.
SGI-PV: 981498
SGI-Modid: xfs-linux-melb:xfs-kern:31720a
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/xfs/linux-2.6/xfs_iops.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index e88f51028086..fec5ff5a2f17 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -62,7 +62,7 @@ void | |||
62 | xfs_synchronize_atime( | 62 | xfs_synchronize_atime( |
63 | xfs_inode_t *ip) | 63 | xfs_inode_t *ip) |
64 | { | 64 | { |
65 | struct inode *inode = ip->i_vnode; | 65 | struct inode *inode = VFS_I(ip); |
66 | 66 | ||
67 | if (inode) { | 67 | if (inode) { |
68 | ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; | 68 | ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; |
@@ -79,7 +79,7 @@ void | |||
79 | xfs_mark_inode_dirty_sync( | 79 | xfs_mark_inode_dirty_sync( |
80 | xfs_inode_t *ip) | 80 | xfs_inode_t *ip) |
81 | { | 81 | { |
82 | struct inode *inode = ip->i_vnode; | 82 | struct inode *inode = VFS_I(ip); |
83 | 83 | ||
84 | if (inode) | 84 | if (inode) |
85 | mark_inode_dirty_sync(inode); | 85 | mark_inode_dirty_sync(inode); |
@@ -299,7 +299,7 @@ xfs_vn_mknod( | |||
299 | if (unlikely(error)) | 299 | if (unlikely(error)) |
300 | goto out_free_acl; | 300 | goto out_free_acl; |
301 | 301 | ||
302 | inode = ip->i_vnode; | 302 | inode = VFS_I(ip); |
303 | 303 | ||
304 | error = xfs_init_security(inode, dir); | 304 | error = xfs_init_security(inode, dir); |
305 | if (unlikely(error)) | 305 | if (unlikely(error)) |
@@ -366,7 +366,7 @@ xfs_vn_lookup( | |||
366 | return NULL; | 366 | return NULL; |
367 | } | 367 | } |
368 | 368 | ||
369 | return d_splice_alias(cip->i_vnode, dentry); | 369 | return d_splice_alias(VFS_I(cip), dentry); |
370 | } | 370 | } |
371 | 371 | ||
372 | STATIC struct dentry * | 372 | STATIC struct dentry * |
@@ -399,12 +399,12 @@ xfs_vn_ci_lookup( | |||
399 | 399 | ||
400 | /* if exact match, just splice and exit */ | 400 | /* if exact match, just splice and exit */ |
401 | if (!ci_name.name) | 401 | if (!ci_name.name) |
402 | return d_splice_alias(ip->i_vnode, dentry); | 402 | return d_splice_alias(VFS_I(ip), dentry); |
403 | 403 | ||
404 | /* else case-insensitive match... */ | 404 | /* else case-insensitive match... */ |
405 | dname.name = ci_name.name; | 405 | dname.name = ci_name.name; |
406 | dname.len = ci_name.len; | 406 | dname.len = ci_name.len; |
407 | dentry = d_add_ci(ip->i_vnode, dentry, &dname); | 407 | dentry = d_add_ci(VFS_I(ip), dentry, &dname); |
408 | kmem_free(ci_name.name); | 408 | kmem_free(ci_name.name); |
409 | return dentry; | 409 | return dentry; |
410 | } | 410 | } |
@@ -478,7 +478,7 @@ xfs_vn_symlink( | |||
478 | if (unlikely(error)) | 478 | if (unlikely(error)) |
479 | goto out; | 479 | goto out; |
480 | 480 | ||
481 | inode = cip->i_vnode; | 481 | inode = VFS_I(cip); |
482 | 482 | ||
483 | error = xfs_init_security(inode, dir); | 483 | error = xfs_init_security(inode, dir); |
484 | if (unlikely(error)) | 484 | if (unlikely(error)) |