summaryrefslogtreecommitdiff
path: root/common/xfs
diff options
context:
space:
mode:
authorZiyang Zhang <ZiyangZhang@linux.alibaba.com>2022-12-12 13:56:44 +0800
committerZorro Lang <zlang@kernel.org>2022-12-13 17:14:37 +0800
commitbe957968f6fade15d0a7a6058ae270141263bd64 (patch)
tree14a9bdb16020f1404a4be6766a87647979884dbd /common/xfs
parent87ab8bdf20db7308e7ecc2ddcdce530ec1f08f1f (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/xfs15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/xfs b/common/xfs
index f466d2c4..04ae121d 100644
--- a/common/xfs
+++ b/common/xfs
@@ -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
+}