@@ -91,13 +91,13 @@ inumbers_count()
bstat_versions | while read v_tag v_flag; do
echo -n "inumbers all($v_tag): "
nr=$(inumbers_fs $SCRATCH_MNT $v_flag)
- _within_tolerance "inumbers" $nr $expect $tolerance -v
+ _within_tolerance "inumbers" $((nr - METADATA_FILES)) $expect $tolerance -v
local agcount=$(_xfs_mount_agcount $SCRATCH_MNT)
for batchsize in 71 2 1; do
echo -n "inumbers $batchsize($v_tag): "
nr=$(inumbers_ag $agcount $batchsize $SCRATCH_MNT $v_flag)
- _within_tolerance "inumbers" $nr $expect $tolerance -v
+ _within_tolerance "inumbers" $((nr - METADATA_FILES)) $expect $tolerance -v
done
done
}
@@ -143,9 +143,26 @@ _supported_fs xfs
DIRCOUNT=8
INOCOUNT=$((2048 / DIRCOUNT))
+# Count everything in the metadata directory tree.
+count_metadir_files() {
+ local metadirs=('/realtime' '/quota')
+ local db_args=('-f')
+
+ for m in "${metadirs[@]}"; do
+ db_args+=('-c' "ls -m $m")
+ done
+
+ local ret=$(_scratch_xfs_db "${db_args[@]}" 2>/dev/null | grep regular | wc -l)
+ test -z "$ret" && ret=0
+ echo $ret
+}
+
_scratch_mkfs "-d agcount=$DIRCOUNT" >> $seqres.full 2>&1 || _fail "mkfs failed"
_scratch_mount
+METADATA_FILES=$(count_metadir_files)
+echo "found $METADATA_FILES metadata files" >> $seqres.full
+
# Figure out if we have v5 bulkstat/inumbers ioctls.
has_v5=
bs_root_out="$($XFS_IO_PROG -c 'bulkstat_single root' $SCRATCH_MNT 2>>$seqres.full)"