From 9986aae4f1fcf6cb392cb5ec8b2a405221911e54 Mon Sep 17 00:00:00 2001 From: girish Date: Thu, 4 Jun 2009 11:53:39 +0000 Subject: [PATCH] b=19686 i=adilger i=johann use i_fs_version or i_version depending on kernel version --- lustre/lvfs/fsfilt_ext3.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index 0268ce4..f6a9092 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -171,14 +171,33 @@ static char *fsfilt_ext3_uuid(struct super_block *sb) } #ifdef HAVE_DISK_INODE_VERSION + +static __u64 get_i_version(struct inode *inode) +{ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) && defined(HAVE_EXT4_LDISKFS) + return inode->i_version; +#else + return EXT3_I(inode)->i_fs_version; +#endif +} + +static void set_i_version(struct inode *inode, __u64 new_version) +{ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) && defined(HAVE_EXT4_LDISKFS) + inode->i_version = new_version; +#else + (EXT3_I(inode))->i_fs_version = new_version; +#endif +} + /* * Get the 64-bit version for an inode. */ static __u64 fsfilt_ext3_get_version(struct inode *inode) { CDEBUG(D_INFO, "Get version "LPX64" for inode %lu\n", - EXT3_I(inode)->i_fs_version, inode->i_ino); - return EXT3_I(inode)->i_fs_version; + get_i_version(inode), inode->i_ino); + return get_i_version(inode); } /* @@ -186,11 +205,11 @@ static __u64 fsfilt_ext3_get_version(struct inode *inode) */ static __u64 fsfilt_ext3_set_version(struct inode *inode, __u64 new_version) { - __u64 old_version = EXT3_I(inode)->i_fs_version; + __u64 old_version = get_i_version(inode); CDEBUG(D_INFO, "Set version "LPX64" (old "LPX64") for inode %lu\n", new_version, old_version, inode->i_ino); - (EXT3_I(inode))->i_fs_version = new_version; + set_i_version(inode, new_version); /* version is set after all inode operations are finished, so we should * mark it dirty here */ inode->i_sb->s_op->dirty_inode(inode); -- 1.8.3.1