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.
37 _scratch_mkfs_xfs >/dev/null 2>&1
40 small=$SCRATCH_MNT/small
43 # sanity check on a small directory
45 # expect that an empty directory has no extents
46 $XFS_IO_PROG -c "bmap" $small | _filter_scratch
47 # and that we can set an extent size on it
48 $XFS_IO_PROG -c 'extsize 8m' $small
49 # and finally check that the extent size update has taken place
50 $XFS_IO_PROG -c "extsize" $small | _filter_scratch
52 # now create a 'big' (with extents) directory
54 for idx in {0..1000}; do
57 $XFS_IO_PROG -c 'bmap -vp' $big | _filter_bmap | \
59 [ $? -eq 0 ] || echo "Can't force allocating extents!" 1>&2
61 # expect that we can set the extent size on $big as well
62 $XFS_IO_PROG -c 'extsize 8m' $big | _filter_scratch
63 # and that it took effect
64 $XFS_IO_PROG -c 'extsize' $big | _filter_scratch