2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright 2014 (C) Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>
7 # Test fallocate FALLOC_FL_ZERO_RANGE
10 _begin_fstest auto quick prealloc zero
12 # Import common functions.
16 # real QA test starts here
17 _require_xfs_io_command "fzero"
18 _require_xfs_io_command "fiemap"
19 _require_xfs_io_command "falloc"
22 testfile=$TEST_DIR/009.$$
24 # Disable extent zeroing for ext4 as that change where holes are created
25 if [ "$FSTYP" = "ext4" ]; then
26 _ext4_disable_extent_zeroout
28 if [ "$FSTYP" = "overlay" -a "$OVL_BASE_FSTYP" = "ext4" ]; then
29 _ext4_disable_extent_zeroout "$OVL_BASE_TEST_DEV"
32 # Standard zero range tests
33 _test_generic_punch falloc fzero fzero fiemap _filter_fiemap $testfile
35 # Delayed allocation zero range tests
36 _test_generic_punch -d falloc fzero fzero fiemap _filter_fiemap $testfile
38 # Multi zero range tests
39 _test_generic_punch -k falloc fzero fzero fiemap _filter_fiemap $testfile
41 # Delayed allocation multi zero range tests
42 _test_generic_punch -d -k falloc fzero fzero fiemap _filter_fiemap $testfile