#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2015 SUSE. All Rights Reserved.
+#
# FS QA Test No. btrfs/085
#
# Tests to ensure that orphan items are properly created and cleaned up
# (i.e. btrfs subvol set-default)
# 3) Non-default subvolume lookup
#
-#-----------------------------------------------------------------------
-# Copyright (c) 2015 SUSE. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#-----------------------------------------------------------------------
-#
-
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
_supported_os Linux
_require_scratch
_require_dm_target flakey
-_require_command "$BTRFS_DEBUG_TREE_PROG" btrfs-debug-tree
+_require_btrfs_command inspect-internal dump-tree
rm -f $seqres.full
has_orphan_item()
{
INO=$1
- if $BTRFS_DEBUG_TREE_PROG $SCRATCH_DEV | \
+ if $BTRFS_UTIL_PROG inspect-internal dump-tree $FLAKEY_DEV | \
grep -q "key (ORPHAN ORPHAN_ITEM $INO)"; then
return 0
fi