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 _begin_fstest ioctl auto quick
13 # Import common functions.
17 # real QA test starts here
19 # Modify as appropriate.
23 _scratch_mkfs_xfs >/dev/null 2>&1
26 small=$SCRATCH_MNT/small
29 # sanity check on a small directory
31 # expect that an empty directory has no extents
32 $XFS_IO_PROG -c "bmap" $small | _filter_scratch
33 # and that we can set an extent size on it
34 $XFS_IO_PROG -c 'extsize 8m' $small
35 # and finally check that the extent size update has taken place
36 $XFS_IO_PROG -c "extsize" $small | _filter_scratch
38 # now create a 'big' (with extents) directory
40 for idx in {0..1000}; do
43 $XFS_IO_PROG -c 'bmap -vp' $big | _filter_bmap | \
45 [ $? -eq 0 ] || echo "Can't force allocating extents!" 1>&2
47 # expect that we can set the extent size on $big as well
48 $XFS_IO_PROG -c 'extsize 8m' $big | _filter_scratch
49 # and that it took effect
50 $XFS_IO_PROG -c 'extsize' $big | _filter_scratch