diff options
author | Ziyang Zhang <ZiyangZhang@linux.alibaba.com> | 2022-12-12 13:56:44 +0800 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2022-12-13 17:14:37 +0800 |
commit | be957968f6fade15d0a7a6058ae270141263bd64 (patch) | |
tree | 14a9bdb16020f1404a4be6766a87647979884dbd /common/xfs | |
parent | 87ab8bdf20db7308e7ecc2ddcdce530ec1f08f1f (diff) |
common/xfs: Add a helper to export inode core size
Some xfs test cases need the number of bytes reserved for only the inode
record, excluding the immediate fork areas. Now the value is hard-coded
and it is not a good chioce. Add a helper in common/xfs to export the
inode core size.
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Ziyang Zhang <ZiyangZhang@linux.alibaba.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common/xfs')
-rw-r--r-- | common/xfs | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1495,3 +1495,18 @@ _require_xfsrestore_xflag() $XFSRESTORE_PROG -h 2>&1 | grep -q -e '-x' || \ _notrun 'xfsrestore does not support -x flag.' } + +# Number of bytes reserved for only the inode record, excluding the +# immediate fork areas. +_xfs_get_inode_core_bytes() +{ + local dir="$1" + + if _xfs_has_feature "$dir" crc; then + # v5 filesystems + echo 176 + else + # v4 filesystems + echo 96 + fi +} |