aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_iops.c
diff options
context:
space:
mode:
authorDavid Chinner <david@fromorbit.com>2008-10-30 02:36:14 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 02:36:14 -0400
commitbf904248a2adb3f3be4eb4fb1837ce3bb28cca76 (patch)
tree288306924f640f19d881166a3b50fa59b6e9e7e7 /fs/xfs/linux-2.6/xfs_iops.c
parent8290c35f87304a6b73d4fd17b03580b4f7425de8 (diff)
[XFS] Combine the XFS and Linux inodes
To avoid issues with different lifecycles of XFS and Linux inodes, embedd the linux inode inside the XFS inode. This means that the linux inode has the same lifecycle as the XFS inode, even when it has been released by the OS. XFS inodes don't live much longer than this (a short stint in reclaim at most), so there isn't significant memory usage penalties here. Version 3 o kill xfs_icount() Version 2 o remove unused commented out code from xfs_iget(). o kill useless cast in VFS_I() SGI-PV: 988141 SGI-Modid: xfs-linux-melb:xfs-kern:32323a Signed-off-by: David Chinner <david@fromorbit.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_iops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 3bfb3c0f8e29..37bb1012aff1 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -64,14 +64,14 @@ xfs_synchronize_atime(
64{ 64{
65 struct inode *inode = VFS_I(ip); 65 struct inode *inode = VFS_I(ip);
66 66
67 if (inode) { 67 if (!(inode->i_state & I_CLEAR)) {
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;
69 ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec; 69 ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec;
70 } 70 }
71} 71}
72 72
73/* 73/*
74 * If the linux inode exists, mark it dirty. 74 * If the linux inode is valid, mark it dirty.
75 * Used when commiting a dirty inode into a transaction so that 75 * Used when commiting a dirty inode into a transaction so that
76 * the inode will get written back by the linux code 76 * the inode will get written back by the linux code
77 */ 77 */
@@ -81,7 +81,7 @@ xfs_mark_inode_dirty_sync(
81{ 81{
82 struct inode *inode = VFS_I(ip); 82 struct inode *inode = VFS_I(ip);
83 83
84 if (inode) 84 if (!(inode->i_state & (I_WILL_FREE|I_FREEING|I_CLEAR)))
85 mark_inode_dirty_sync(inode); 85 mark_inode_dirty_sync(inode);
86} 86}
87 87
@@ -766,12 +766,21 @@ xfs_diflags_to_iflags(
766 * When reading existing inodes from disk this is called directly 766 * When reading existing inodes from disk this is called directly
767 * from xfs_iget, when creating a new inode it is called from 767 * from xfs_iget, when creating a new inode it is called from
768 * xfs_ialloc after setting up the inode. 768 * xfs_ialloc after setting up the inode.
769 *
770 * We are always called with an uninitialised linux inode here.
771 * We need to initialise the necessary fields and take a reference
772 * on it.
769 */ 773 */
770void 774void
771xfs_setup_inode( 775xfs_setup_inode(
772 struct xfs_inode *ip) 776 struct xfs_inode *ip)
773{ 777{
774 struct inode *inode = ip->i_vnode; 778 struct inode *inode = &ip->i_vnode;
779
780 inode->i_ino = ip->i_ino;
781 inode->i_state = I_NEW|I_LOCK;
782 inode_add_to_lists(ip->i_mount->m_super, inode);
783 ASSERT(atomic_read(&inode->i_count) == 1);
775 784
776 inode->i_mode = ip->i_d.di_mode; 785 inode->i_mode = ip->i_d.di_mode;
777 inode->i_nlink = ip->i_d.di_nlink; 786 inode->i_nlink = ip->i_d.di_nlink;