From 47bb69de19c601dcf18f42b7f109a6ee9f8edd19 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Thu, 8 Dec 2016 16:12:12 +0800 Subject: [PATCH] common/btrfs: rename and enhance _require_btrfs to _require_btrfs_command Rename _require_btrfs() to _require_btrfs_command() to avoid confusion, as all other _require_btrfs_* has a quite clear suffix, like _require_btrfs_mkfs_feature() or _require_btrfs_fs_feature(). Also enhance _require_btrfs_command() to accept 2nd level commands or options. Options will be determined by the first "-" char. This is quite useful for case like "btrfs inspect-internal dump-tree" and "btrfs check --qgroup-report". [eguan: make local vars in _require_btrfs_command "local"] Signed-off-by: Qu Wenruo Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- common/btrfs | 25 ++++++++++++++++++++++--- tests/btrfs/004 | 3 ++- tests/btrfs/048 | 2 +- tests/btrfs/059 | 2 +- tests/btrfs/131 | 2 +- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/common/btrfs b/common/btrfs index ab6497da..d9350ea5 100644 --- a/common/btrfs +++ b/common/btrfs @@ -10,16 +10,35 @@ _btrfs_get_subvolid() $BTRFS_UTIL_PROG sub list $mnt | grep $name | awk '{ print $2 }' } +# _require_btrfs_command [|