diff options
author | Christoph Hellwig <hch@lst.de> | 2021-03-29 11:11:43 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-04-07 14:37:05 -0700 |
commit | ee7b83fd365e32beaa405d60b8c42f42ec5f42c2 (patch) | |
tree | aa696b58d9c472abd855f6ed445fd3d3fd21c921 /fs/xfs/libxfs | |
parent | b231b1221b39bdf7ec4e45b05656bcba7d6a2153 (diff) | |
download | lwn-ee7b83fd365e32beaa405d60b8c42f42ec5f42c2.tar.gz lwn-ee7b83fd365e32beaa405d60b8c42f42ec5f42c2.zip |
xfs: use a union for i_cowextsize and i_flushiter
The i_cowextsize field is only used for v3 inodes, and the i_flushiter
field is only used for v1/v2 inodes. Use a union to pack the inode a
littler better after adding a few missing guards around their usage.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs')
-rw-r--r-- | fs/xfs/libxfs/xfs_inode_buf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 3c7eb01c66ac..88ec7be551a8 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -193,7 +193,8 @@ xfs_inode_from_disk( * inode. If the inode is unused, mode is zero and we shouldn't mess * with the uninitialized part of it. */ - ip->i_flushiter = be16_to_cpu(from->di_flushiter); + if (!xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) + ip->i_flushiter = be16_to_cpu(from->di_flushiter); inode->i_generation = be32_to_cpu(from->di_gen); inode->i_mode = be16_to_cpu(from->di_mode); if (!inode->i_mode) |