xfs: refactor calls to xfs_admin

Create a helper to run xfs_admin on the scratch device, then
refactor all tests to use it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Darrick J. Wong
2020-03-03 18:46:40 -08:00
committed by Eryu Guan
parent 640c75ef96
commit 2eff3870a7
3 changed files with 10 additions and 1 deletions
+1
View File
@@ -154,6 +154,7 @@ MKSWAP_PROG="$MKSWAP_PROG -f"
export XFS_LOGPRINT_PROG="$(type -P xfs_logprint)"
export XFS_REPAIR_PROG="$(type -P xfs_repair)"
export XFS_DB_PROG="$(type -P xfs_db)"
export XFS_ADMIN_PROG="$(type -P xfs_admin)"
export XFS_GROWFS_PROG=$(type -P xfs_growfs)
export XFS_SPACEMAN_PROG="$(type -P xfs_spaceman)"
export XFS_SCRUB_PROG="$(type -P xfs_scrub)"
+8
View File
@@ -218,6 +218,14 @@ _scratch_xfs_db()
$XFS_DB_PROG "$@" $(_scratch_xfs_db_options)
}
_scratch_xfs_admin()
{
local options=("$SCRATCH_DEV")
[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
options+=("$SCRATCH_LOGDEV")
$XFS_ADMIN_PROG "$@" "${options[@]}"
}
_scratch_xfs_logprint()
{
SCRATCH_OPTIONS=""
+1 -1
View File
@@ -70,7 +70,7 @@ $XFS_IO_PROG -r -c "lsproj" $dir/32bit
_scratch_unmount
# Now, enable projid32bit support by xfs_admin
xfs_admin -p $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_admin failed"
_scratch_xfs_admin -p >> $seqres.full 2>&1 || _fail "xfs_admin failed"
# Now mount the fs, 32bit project quotas shall be supported, now
_qmount_option "pquota"