@@ -766,6 +766,20 @@ _require_xfs_mkfs_without_validation()
fi
}
+_require_xfs_scratch_shrink()
+{
+ _require_scratch
+ _require_command "$XFS_GROWFS_PROG" xfs_growfs
+
+ _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs >/dev/null
+ . $tmp.mkfs
+ _scratch_mount
+ # here just to check if kernel supports, no need do more extra work
+ $XFS_GROWFS_PROG -D$((dblocks-1)) "$SCRATCH_MNT" > /dev/null 2>&1 || \
+ _notrun "kernel does not support shrinking"
+ _scratch_unmount
+}
+
# XFS ability to change UUIDs on V5/CRC filesystems
#
_require_meta_uuid()
In order to detect whether the current kernel supports XFS shrinking. Signed-off-by: Gao Xiang <hsiangkao@redhat.com> --- common/xfs | 14 ++++++++++++++ 1 file changed, 14 insertions(+)