From: Darrick J. Wong Date: Mon, 4 Mar 2019 21:19:41 +0000 (-0800) Subject: populate: force large finobt creation on xfs X-Git-Tag: v2022.05.01~1231 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c2d149681c12a90e2efd2135c3e0c74c71cee7e5;p=xfstests-dev.git populate: force large finobt creation on xfs Teach the populate routines to create enough inodes that we end up with multi-level inode btrees. Signed-off-by: Darrick J. Wong Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/populate b/common/populate index d49fbc29..95953476 100644 --- a/common/populate +++ b/common/populate @@ -260,6 +260,21 @@ _scratch_xfs_populate() { $XFS_IO_PROG -f -c "pwrite -S 0x62 0 $((blksz * nr))" "${SCRATCH_MNT}/BNOBT" ./src/punch-alternating "${SCRATCH_MNT}/BNOBT" + # Inode btree + echo "+ inobt btree" + local ino_per_rec=64 + local rec_per_btblock=16 + local nr="$(( 2 * (blksz / rec_per_btblock) * ino_per_rec ))" + local dir="${SCRATCH_MNT}/INOBT" + mkdir -p "${dir}" + seq 0 "${nr}" | while read f; do + touch "${dir}/${f}" + done + + seq 0 "$((ino_per_rec + 1))" "${nr}" | while read f; do + rm -f "${dir}/${f}" + done + # Reverse-mapping btree is_rmapbt="$($XFS_INFO_PROG "${SCRATCH_MNT}" | grep -c 'rmapbt=1')" if [ $is_rmapbt -gt 0 ]; then @@ -562,6 +577,8 @@ _scratch_xfs_populate_check() { __populate_check_xfs_aformat "${btree_attr}" "btree" __populate_check_xfs_agbtree_height "bno" __populate_check_xfs_agbtree_height "cnt" + __populate_check_xfs_agbtree_height "ino" + test $is_finobt -ne 0 && __populate_check_xfs_agbtree_height "fino" test $is_rmapbt -ne 0 && __populate_check_xfs_agbtree_height "rmap" test $is_reflink -ne 0 && __populate_check_xfs_agbtree_height "refcnt" }