From: girish Date: Thu, 4 Jun 2009 11:53:34 +0000 (+0000) Subject: b=19686 X-Git-Tag: v1_8_0_140~8 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=05491873b655ec61a5a1d7785585067ac72bc8fd;p=fs%2Flustre-release.git b=19686 i=adilger i=johann use i_fs_version or i_version depending on kernel version --- 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);