xfs: refactor minimum log size formatting code

Create a new helper function to discover the minimum log size that will
work with the mkfs options provided, then remove all the hardcoded block
sizes from various xfs tests.  This will be necessary when we turn on
reflink or rmap by default and the minimum log size increases.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Tested-by: Yang Xu<xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Darrick J. Wong
2019-05-07 09:56:56 -07:00
committed by Eryu Guan
parent 2bb2dd24cc
commit 2fd273886b
6 changed files with 47 additions and 6 deletions
+2 -1
View File
@@ -38,7 +38,8 @@ _require_scratch
# this may hang
sync
export MKFS_OPTIONS="-l version=2,size=2560b,su=64k"
logblks=$(_scratch_find_xfs_min_logblocks -l version=2,su=64k)
export MKFS_OPTIONS="-l version=2,size=${logblks}b,su=64k"
export MOUNT_OPTIONS="-o logbsize=64k"
_scratch_mkfs_xfs >/dev/null