Add a helper to find the minimum of two numbers. A similar helper is being added in xfstests: https://lore.kernel.org/linux-xfs/cover.1755849134.git.ojaswin@xxxxxxxxxxxxx/T/#m962683d8115979e57342d2644660230ee978c803 Signed-off-by: John Garry <john.g.garry@xxxxxxxxxx> --- common/rc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/rc b/common/rc index 946dee1..77a0f45 100644 --- a/common/rc +++ b/common/rc @@ -700,3 +700,14 @@ _real_dev() fi echo "$dev" } + +_min() { + local ret + + for arg in "$@"; do + if [ -z "$ret" ] || (( $arg < $ret )); then + ret="$arg" + fi + done + echo $ret +} \ No newline at end of file -- 2.43.5