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>
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_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)"
export XFS_GROWFS_PROG=$(type -P xfs_growfs)
export XFS_SPACEMAN_PROG="$(type -P xfs_spaceman)"
export XFS_SCRUB_PROG="$(type -P xfs_scrub)"
$XFS_DB_PROG "$@" $(_scratch_xfs_db_options)
}
$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=""
_scratch_xfs_logprint()
{
SCRATCH_OPTIONS=""
_scratch_unmount
# Now, enable projid32bit support by xfs_admin
_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"
# Now mount the fs, 32bit project quotas shall be supported, now
_qmount_option "pquota"