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/xfs_inode.h | |
parent | b231b1221b39bdf7ec4e45b05656bcba7d6a2153 (diff) | |
download | linux-ee7b83fd365e32beaa405d60b8c42f42ec5f42c2.tar.gz linux-ee7b83fd365e32beaa405d60b8c42f42ec5f42c2.tar.bz2 linux-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/xfs_inode.h')
-rw-r--r-- | fs/xfs/xfs_inode.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index a76ca913f769..7a877db8ac56 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -58,8 +58,11 @@ typedef struct xfs_inode { xfs_rfsblock_t i_nblocks; /* # of direct & btree blocks */ prid_t i_projid; /* owner's project id */ xfs_extlen_t i_extsize; /* basic/minimum extent size */ - xfs_extlen_t i_cowextsize; /* basic cow extent size */ - uint16_t i_flushiter; /* incremented on flush */ + /* cowextsize is only used for v3 inodes, flushiter for v1/2 */ + union { + xfs_extlen_t i_cowextsize; /* basic cow extent size */ + uint16_t i_flushiter; /* incremented on flush */ + }; struct xfs_icdinode i_d; /* most of ondisk inode */ |