]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
btrfs: use full subcommand name at _btrfs_get_subvolid()
authorFilipe Manana <fdmanana@suse.com>
Fri, 22 Sep 2023 11:45:01 +0000 (12:45 +0100)
committerZorro Lang <zlang@kernel.org>
Sat, 23 Sep 2023 14:13:06 +0000 (22:13 +0800)
Avoid using the shortcut "sub" for the "subvolume" command, as this is the
standard practice because such shortcuts are not guaranteed to exist in
every btrfs-progs release (they may come and go). Also make the variables
local.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/btrfs

index c9903a413cb039b7222705c18346ad95513d4490..62cee209fd1f0877bc30b7d8f4565ce822f183c8 100644 (file)
@@ -6,10 +6,10 @@
 
 _btrfs_get_subvolid()
 {
-       mnt=$1
-       name=$2
+       local mnt=$1
+       local name=$2
 
-       $BTRFS_UTIL_PROG sub list $mnt | grep -E "\s$name$" | $AWK_PROG '{ print $2 }'
+       $BTRFS_UTIL_PROG subvolume list $mnt | grep -E "\s$name$" | $AWK_PROG '{ print $2 }'
 }
 
 # _require_btrfs_command <command> [<subcommand>|<option>]