#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2014 Red Hat Inc. All Rights Reserved.
+#
# FS QA Test No. shared/006
#
# Stress test fs by using up all inodes and check fs.
# Also a regression test for xfsprogs commit
# d586858 xfs_repair: fix sibling pointer tests in verify_dir2_path()
#
-#-----------------------------------------------------------------------
-# Copyright (c) 2014 Red Hat Inc. 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"
_scratch_mount
i=0
-free_inode=`$DF_PROG -i $SCRATCH_MNT | tail -1 | awk '{print $3}'`
+free_inode=`_get_free_inode $SCRATCH_MNT`
file_per_dir=1000
loop=$((free_inode / file_per_dir + 1))
mkdir -p $SCRATCH_MNT/testdir