From 543e4a76facc258a4193938a0e1611e29fc6de50 Mon Sep 17 00:00:00 2001 From: Tim Shimmin Date: Fri, 26 May 2006 15:38:44 +0000 Subject: [PATCH] An attempt at looking at the sizes of xfs structures with exclusions for ones that we know are different. The aim is to help pick up on extensions to structures and addition of structures which for instance may vary on 32 bit and 64 bit word size versions. Merge of master-melb:xfs-cmds:26056a by kenmcd. An attempt at looking at the sizes of xfs structures with exclusions for ones that we know are different. The aim is to help pick up on extensions to structures and addition of structures which for instance may vary on 32 bit and 64 bit word size versions. --- 122 | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 122.out | 123 ++++++++++++++++++++++++++++++++++++++++++++++ group | 1 + 3 files changed, 272 insertions(+) create mode 100755 122 create mode 100644 122.out diff --git a/122 b/122 new file mode 100755 index 00000000..900af2a2 --- /dev/null +++ b/122 @@ -0,0 +1,148 @@ +#! /bin/sh +# FS QA Test No. 122 +# +# pv#952498 +# Keep an eye on some of the xfs type sizes +# Motivation from differing ondisk types for 32 and 64 bit word versions. +# +#----------------------------------------------------------------------- +# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved. +#----------------------------------------------------------------------- +# +# creator +owner=tes@sgi.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +# get standard environment +. ./common.rc + +# real QA test starts here +_supported_fs xfs +_supported_os Linux + +cprog=$tmp.get_structs.c +oprog=$tmp.get_structs + +cat >$cprog < +#include +EOF + +cat >$tmp.ignore <>$cprog + +# +# Printfs of typedef sizes +# +cat /usr/include/xfs/xfs*.h | indent |\ +sed -e 's/__attribute__ *[(][(]packed[)][)]//' |\ +tee shit |\ +egrep '} *xfs_.*_t' |\ +egrep -v -f $tmp.ignore |\ +awk '{sub(/[;,]/,"",$2); print "printf(\"sizeof(", $2, ") = %d\\n\", sizeof(", $2, "));"}' \ +>>$cprog + +# +# Look at offsets of key ones which differ in lengths +# + +# xfs_sb_t +cat /usr/include/xfs/xfs*.h | indent |\ +awk ' + /typedef struct xfs_sb/ { structon = 1; next } + structon && $2 ~ /^sb_/ { sub(/[;,]/,"",$2) + print "printf(\"offsetof(xfs_sb_t,", $2, ") = %d\\n\", offsetof(xfs_sb_t,", $2, "));"; next} + structon && /}/ { structon = 0; next} +'>>$cprog + +echo 'return 0; }' >>$cprog + +# create and run program +cc -o $oprog $cprog +eval $oprog + +status=0 diff --git a/122.out b/122.out new file mode 100644 index 00000000..4d91c092 --- /dev/null +++ b/122.out @@ -0,0 +1,123 @@ +QA output created by 122 +sizeof( xfs_agf_t ) = 60 +sizeof( xfs_agi_t ) = 296 +sizeof( xfs_agfl_t ) = 4 +sizeof( xfs_alloc_rec_t ) = 8 +sizeof( xfs_alloc_rec_incore_t ) = 8 +sizeof( xfs_alloctype_t ) = 4 +sizeof( xfs_attr_leaf_map_t ) = 4 +sizeof( xfs_attr_leaf_hdr_t ) = 32 +sizeof( xfs_attr_leaf_entry_t ) = 8 +sizeof( xfs_attr_leaf_name_local_t ) = 4 +sizeof( xfs_attr_leaf_name_remote_t ) = 12 +sizeof( xfs_attr_leafblock_t ) = 56 +sizeof( xfs_attr_inactive_list_t ) = 8 +sizeof( xfs_attr_shortform_t ) = 8 +sizeof( xfs_bmdr_block_t ) = 4 +sizeof( xfs_bmbt_rec_32_t ) = 16 +sizeof( xfs_bmbt_rec_64_t ) = 16 +sizeof( xfs_exntfmt_t ) = 4 +sizeof( xfs_exntst_t ) = 4 +sizeof( xfs_bmbt_key_t ) = 8 +sizeof( xfs_btree_sblock_t ) = 16 +sizeof( xfs_btree_lblock_t ) = 24 +sizeof( xfs_btree_hdr_t ) = 8 +sizeof( xfs_btree_block_t ) = 24 +sizeof( xfs_buf_log_format_v1_t ) = 20 +sizeof( xfs_buf_log_format_t ) = 24 +sizeof( xfs_da_blkinfo_t ) = 12 +sizeof( xfs_da_intnode_t ) = 24 +sizeof( xfs_timestamp_t ) = 8 +sizeof( xfs_dinode_core_t ) = 96 +sizeof( xfs_dinode_fmt_t ) = 4 +sizeof( xfs_dir2_data_free_t ) = 4 +sizeof( xfs_dir2_data_hdr_t ) = 16 +sizeof( xfs_dir2_data_unused_t ) = 6 +sizeof( xfs_dir2_leaf_hdr_t ) = 16 +sizeof( xfs_dir2_leaf_entry_t ) = 8 +sizeof( xfs_dir2_leaf_tail_t ) = 4 +sizeof( xfs_dir2_leaf_t ) = 32 +sizeof( xfs_dir2_free_hdr_t ) = 16 +sizeof( xfs_dir2_free_t ) = 20 +sizeof( xfs_dir2_ino8_t ) = 8 +sizeof( xfs_dir2_ino4_t ) = 4 +sizeof( xfs_dir2_inou_t ) = 8 +sizeof( xfs_dir2_sf_off_t ) = 2 +sizeof( xfs_dir2_sf_hdr_t ) = 10 +sizeof( xfs_dir2_sf_entry_t ) = 12 +sizeof( xfs_dir2_sf_t ) = 22 +sizeof( xfs_dir_leaf_map_t ) = 4 +sizeof( xfs_dir_leaf_hdr_t ) = 32 +sizeof( xfs_dir_leaf_entry_t ) = 8 +sizeof( xfs_dir_leaf_name_t ) = 9 +sizeof( xfs_dir_leafblock_t ) = 52 +sizeof( xfs_dircook_t ) = 8 +sizeof( xfs_dir_sf_hdr_t ) = 9 +sizeof( xfs_dir_sf_entry_t ) = 10 +sizeof( xfs_dir_shortform_t ) = 19 +sizeof( xfs_fsop_geom_t ) = 112 +sizeof( xfs_fsop_counts_t ) = 32 +sizeof( xfs_fsop_resblks_t ) = 16 +sizeof( xfs_growfs_log_t ) = 8 +sizeof( xfs_error_injection_t ) = 8 +sizeof( xfs_attrlist_cursor_t ) = 16 +sizeof( xfs_fsid_t ) = 8 +sizeof( xfs_fid_t ) = 16 +sizeof( xfs_fid2_t ) = 16 +sizeof( xfs_handle_t ) = 24 +sizeof( xfs_inobt_rec_t ) = 16 +sizeof( xfs_inobt_key_t ) = 4 +sizeof( xfs_trans_reservations_t ) = 84 +sizeof( xfs_disk_dquot_t ) = 104 +sizeof( xfs_dqblk_t ) = 136 +sizeof( xfs_dq_logformat_t ) = 24 +sizeof( xfs_qoff_logformat_t ) = 20 +sizeof( xfs_sb_field_t ) = 4 +sizeof( xfs_trans_header_t ) = 16 +sizeof( xfs_lookup_t ) = 4 +sizeof( xfs_btnum_t ) = 4 +offsetof(xfs_sb_t, sb_magicnum ) = 0 +offsetof(xfs_sb_t, sb_blocksize ) = 4 +offsetof(xfs_sb_t, sb_dblocks ) = 8 +offsetof(xfs_sb_t, sb_rblocks ) = 16 +offsetof(xfs_sb_t, sb_rextents ) = 24 +offsetof(xfs_sb_t, sb_uuid ) = 32 +offsetof(xfs_sb_t, sb_logstart ) = 48 +offsetof(xfs_sb_t, sb_rootino ) = 56 +offsetof(xfs_sb_t, sb_rbmino ) = 64 +offsetof(xfs_sb_t, sb_rsumino ) = 72 +offsetof(xfs_sb_t, sb_rextsize ) = 80 +offsetof(xfs_sb_t, sb_agblocks ) = 84 +offsetof(xfs_sb_t, sb_agcount ) = 88 +offsetof(xfs_sb_t, sb_rbmblocks ) = 92 +offsetof(xfs_sb_t, sb_logblocks ) = 96 +offsetof(xfs_sb_t, sb_versionnum ) = 100 +offsetof(xfs_sb_t, sb_sectsize ) = 102 +offsetof(xfs_sb_t, sb_inodesize ) = 104 +offsetof(xfs_sb_t, sb_inopblock ) = 106 +offsetof(xfs_sb_t, sb_fname[12] ) = 120 +offsetof(xfs_sb_t, sb_blocklog ) = 120 +offsetof(xfs_sb_t, sb_sectlog ) = 121 +offsetof(xfs_sb_t, sb_inodelog ) = 122 +offsetof(xfs_sb_t, sb_inopblog ) = 123 +offsetof(xfs_sb_t, sb_agblklog ) = 124 +offsetof(xfs_sb_t, sb_rextslog ) = 125 +offsetof(xfs_sb_t, sb_inprogress ) = 126 +offsetof(xfs_sb_t, sb_imax_pct ) = 127 +offsetof(xfs_sb_t, sb_icount ) = 128 +offsetof(xfs_sb_t, sb_ifree ) = 136 +offsetof(xfs_sb_t, sb_fdblocks ) = 144 +offsetof(xfs_sb_t, sb_frextents ) = 152 +offsetof(xfs_sb_t, sb_uquotino ) = 160 +offsetof(xfs_sb_t, sb_gquotino ) = 168 +offsetof(xfs_sb_t, sb_qflags ) = 176 +offsetof(xfs_sb_t, sb_flags ) = 178 +offsetof(xfs_sb_t, sb_shared_vn ) = 179 +offsetof(xfs_sb_t, sb_inoalignmt ) = 180 +offsetof(xfs_sb_t, sb_unit ) = 184 +offsetof(xfs_sb_t, sb_width ) = 188 +offsetof(xfs_sb_t, sb_dirblklog ) = 192 +offsetof(xfs_sb_t, sb_logsectlog ) = 193 +offsetof(xfs_sb_t, sb_logsectsize ) = 194 +offsetof(xfs_sb_t, sb_logsunit ) = 196 +offsetof(xfs_sb_t, sb_features2 ) = 200 diff --git a/group b/group index 1955b67b..3b3ae407 100644 --- a/group +++ b/group @@ -198,3 +198,4 @@ aio nathans@sgi.com 119 log v2log 120 auto 121 log auto +122 auto -- 2.39.5