aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2018-02-26 22:43:18 -0600
committerEric Sandeen <sandeen@redhat.com>2018-02-26 22:43:18 -0600
commitd5105a897ca973d43e82d54bda4ea40692a94769 (patch)
tree3357cfa05471b67fadec02d35d726294c3bc253e
parente91df8449abbbb2087c64428c8e4af25c445ca0e (diff)
downloadxfsprogs-dev-d5105a897ca973d43e82d54bda4ea40692a94769.tar.gz
xfs: convert to new i_version API
Source kernel commit: f0e28280629e0ec7921f3179409a179b1ea41f24 Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Darrick J. Wong <darrick.wong@oracle.com> Acked-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--libxfs/libxfs_priv.h5
-rw-r--r--libxfs/xfs_inode_buf.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index bc1ce226ae..82627668fb 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -219,6 +219,11 @@ static inline bool WARN_ON_ONCE(bool expr) {
#define PAGE_SIZE getpagesize()
+#define inode_peek_iversion(inode) (inode)->i_version
+#define inode_set_iversion_queried(inode, version) do { \
+ (inode)->i_version = (version); \
+} while (0)
+
static inline int __do_div(unsigned long long *n, unsigned base)
{
int __res;
diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
index 4e0af8dfc5..ecbd517854 100644
--- a/libxfs/xfs_inode_buf.c
+++ b/libxfs/xfs_inode_buf.c
@@ -261,7 +261,8 @@ xfs_inode_from_disk(
to->di_flags = be16_to_cpu(from->di_flags);
if (to->di_version == 3) {
- inode->i_version = be64_to_cpu(from->di_changecount);
+ inode_set_iversion_queried(inode,
+ be64_to_cpu(from->di_changecount));
to->di_crtime.t_sec = be32_to_cpu(from->di_crtime.t_sec);
to->di_crtime.t_nsec = be32_to_cpu(from->di_crtime.t_nsec);
to->di_flags2 = be64_to_cpu(from->di_flags2);
@@ -311,7 +312,7 @@ xfs_inode_to_disk(
to->di_flags = cpu_to_be16(from->di_flags);
if (from->di_version == 3) {
- to->di_changecount = cpu_to_be64(inode->i_version);
+ to->di_changecount = cpu_to_be64(inode_peek_iversion(inode));
to->di_crtime.t_sec = cpu_to_be32(from->di_crtime.t_sec);
to->di_crtime.t_nsec = cpu_to_be32(from->di_crtime.t_nsec);
to->di_flags2 = cpu_to_be64(from->di_flags2);