This change causes 122 detect whether the patch is installed by greping for lazy count in mkfs output, the xfs_agf_t size is then filtered based on the patch status.
The original intention was to check /lib/modules/$(uname -r)/source/fs/xfs/xfs_ag.h for btreeblks and filter on this, however the kernel source is not a prereq for XFSQA.
Merge of master-melb:xfs-cmds:28014a by kenmcd.
pipe get_structs.c output through _type_size_filter to filter out known changes to xfs type sizes
_supported_os Linux
_require_command /usr/bin/indent
+# filter out known changes to xfs type sizes
+_type_size_filter()
+{
+ # lazy SB adds __be32 agf_btreeblks - pv960372
+ if [ "$($MKFS_XFS_PROG 2>&1 | grep -c lazy-count )" == "0" ]; then
+ perl -ne '
+s/sizeof\( xfs_agf_t \) = 60/sizeof( xfs_agf_t ) = <SIZE>/;
+ print;'
+ else
+ perl -ne '
+s/sizeof\( xfs_agf_t \) = 64/sizeof( xfs_agf_t ) = <SIZE>/;
+ print;'
+ fi
+}
+
cprog=$tmp.get_structs.c
oprog=$tmp.get_structs
# create and run program
cc -o $oprog $cprog
-eval $oprog | LC_COLLATE=POSIX sort
+eval $oprog | LC_COLLATE=POSIX sort | _type_size_filter
status=0
offsetof(xfs_sb_t, sb_uuid ) = 32
offsetof(xfs_sb_t, sb_versionnum ) = 100
offsetof(xfs_sb_t, sb_width ) = 188
-sizeof( xfs_agf_t ) = 60
+sizeof( xfs_agf_t ) = <SIZE>
sizeof( xfs_agfl_t ) = 4
sizeof( xfs_agi_t ) = 296
sizeof( xfs_alloc_rec_incore_t ) = 8