]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - io/xfs_mkfile.sh
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
11 XFS_IO
=`dirname $0`"/xfs_io -p xfs_mkfile"
12 USAGE
="Usage: xfs_mkfile [-npvV] size file..."
14 while getopts "npvV" c
26 $VERSION && $XFS_IO -V
28 shift `expr $OPTIND - 1`
29 [ "$1" != "" ] ||
exit 0
37 $PREALLOC && echo "$1 $SIZE bytes pre-allocated"
38 $PREALLOC ||
echo "$1 $SIZE bytes"
41 $XFS_IO -ft -c "truncate $SIZE" -- "$1"
43 $XFS_IO -ftd -c "resvsp 0 $SIZE" \
44 -c "pwrite -q -S0 -b256k 0 $SIZE" \
45 -c "truncate $SIZE" -- "$1"
47 $XFS_IO -ftd -c "pwrite -q -S0 -b256k 0 $SIZE" \
48 -c "truncate $SIZE" -- "$1"
50 [ $?
-eq 0 ] || ERRORS
=`expr $ERRORS + 1`