Lines Matching +full:full +full:- +full:length
47 # Growing a file with a backing file (without preallocation=full or
52 if [ -z "$TEST_IMG_FILE" ]; then
59 # $ rm -f foo
62 # $ fallocate -o $((block_size / 2)) -l $block_size foo
67 # rounds up the length to the block size, but independently. As
82 fallocate -o 65535 -l 2 "$TEST_IMG_FILE"
86 # (Thus, the on-disk size should not increase)
90 if [ $len1 -gt $len0 ]; then
94 rm -f "$TEST_IMG_FILE"
107 # (1) We resize it to 2 MB - 32 kB. (+ 16 kB)
112 CREATION_SIZE=$((2 * 1024 * 1024 - 48 * 1024))
114 # 512 is the actual test -- but it's good to test 64k as well, just to be sure.
118 for create_mode in off metadata falloc full; do
119 for growth_mode in off metadata falloc full; do
120 …echo "--- cluster_size=$cluster_size growth_size=$GROWTH_SIZE create_mode=$create_mode growth_mode…
122 … _make_test_img -o "preallocation=$create_mode,cluster_size=$cluster_size" ${CREATION_SIZE}
123 $QEMU_IMG resize -f "$IMGFMT" --preallocation=$growth_mode "$TEST_IMG" +${GROWTH_SIZE}K
126 file_length_0=$(stat -c '%s' "$TEST_IMG_FILE")
128 $QEMU_IO -c "write 0 $CREATION_SIZE" "$TEST_IMG" | _filter_qemu_io
131 file_length_1=$(stat -c '%s' "$TEST_IMG_FILE")
133 $QEMU_IO -c "write $CREATION_SIZE ${GROWTH_SIZE}K" "$TEST_IMG" | _filter_qemu_io
136 file_length_2=$(stat -c '%s' "$TEST_IMG_FILE")
140 # The image length should not have grown
141 if [ $file_length_1 -gt $file_length_0 ]; then
142 … echo "ERROR (create): Image length has grown from $file_length_0 to $file_length_1"
146 if [ $host_size_1 -gt $host_size_0 ]; then
154 # The image length should not have grown
155 if [ $file_length_2 -gt $file_length_1 ]; then
156 … echo "ERROR (grow): Image length has grown from $file_length_1 to $file_length_2"
160 if [ $host_size_2 -gt $host_size_1 ]; then
173 $QEMU_IMG create -f raw "$TEST_IMG.base" 128k | _filter_img_create
174 $QEMU_IO -c 'write -q -P 1 0 128k' -f raw "$TEST_IMG.base"
177 for prealloc in metadata full; do
178 echo "--- Resizing image from $orig_size to $dst_size (preallocation=$prealloc) ---"
179 _make_test_img -F raw -b "$TEST_IMG.base" -o cluster_size=64k "$orig_size"
180 $QEMU_IMG resize -f "$IMGFMT" --preallocation="$prealloc" "$TEST_IMG" "$dst_size"
182 $QEMU_IO -c "read -q -P 1 0 ${orig_size}" "$TEST_IMG"
184 $QEMU_IO -c "read -q -P 0 ${orig_size} 63k" "$TEST_IMG"
190 file_length=$(stat -c '%s' "$TEST_IMG_FILE")
192 echo "ERROR: file length $file_length (expected $expected_file_length)"
202 rm -f $seq.full