From: deshmukh Date: Wed, 2 Sep 2009 11:01:35 +0000 (+0000) Subject: b=19686 X-Git-Tag: v1_9_260~38 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f2a51f68373a4afb82228a1a470e46ad91ff39f6 b=19686 i=adilger,johann Use i_{fs}_version depending on kernel version. Ported the patch on HEAD. --- diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index a1da0b8..33d417e 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -163,14 +163,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); } /* @@ -178,11 +197,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);