2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved.
7 # ->page-mkwrite test - unwritten extents and mmap
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "exit \$status" 0 1 2 3 15
19 # get standard environment, filters and checks
23 # assumes 1st, 3rd and 5th blocks are single written blocks,
24 # the others are unwritten.
31 unwritten1 = ((1048576/512) / 2) - written_size
32 unwritten2 = ((1048576/512) / 2) - 2 * written_size
35 # is the extent unwritten?
47 } else if ($6 != unwritten2) {
51 if ($6 != written_size)
54 print $1, "[AA..BB]", "XX..YY", "AG", "(AA..BB)", size, flags
58 # real QA test starts here
63 _scratch_mkfs_xfs >/dev/null 2>&1
66 TEST_FILE=$SCRATCH_MNT/test_file
67 TEST_PROG=$here/src/unwritten_mmap
71 $TEST_PROG $FILE_SIZE $TEST_FILE
73 xfs_bmap -vp $TEST_FILE >> $seqres.full
74 xfs_bmap -vp $TEST_FILE | _filter_blocks