2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Google Inc. All Rights Reserved.
7 # Determine whether the extent size hint can be set on directories
8 # with allocated extents correctly.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # get standard environment, filters and checks
30 # real QA test starts here
32 # Modify as appropriate.
36 _scratch_mkfs_xfs >/dev/null 2>&1
39 small=$SCRATCH_MNT/small
42 # sanity check on a small directory
44 # expect that an empty directory has no extents
45 $XFS_IO_PROG -c "bmap" $small | _filter_scratch
46 # and that we can set an extent size on it
47 $XFS_IO_PROG -c 'extsize 8m' $small
48 # and finally check that the extent size update has taken place
49 $XFS_IO_PROG -c "extsize" $small | _filter_scratch
51 # now create a 'big' (with extents) directory
53 for idx in {0..1000}; do
56 $XFS_IO_PROG -c 'bmap -vp' $big | _filter_bmap | \
58 [ $? -eq 0 ] || echo "Can't force allocating extents!" 1>&2
60 # expect that we can set the extent size on $big as well
61 $XFS_IO_PROG -c 'extsize 8m' $big | _filter_scratch
62 # and that it took effect
63 $XFS_IO_PROG -c 'extsize' $big | _filter_scratch