]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - io/xfs_bmap.sh
configure: don't check for readdir
[thirdparty/xfsprogs-dev.git] / io / xfs_bmap.sh
1 #!/bin/sh -f
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved.
4 #
5
6 OPTS=""
7 VERSION=false
8 USAGE="Usage: xfs_bmap [-adelpvV] [-n nx] file..."
9 DIRNAME=`dirname $0`
10
11 while getopts "adeln:pvV" c
12 do
13 case $c in
14 a) OPTS=$OPTS" -a";;
15 d) OPTS=$OPTS" -d";;
16 e) OPTS=$OPTS" -e";;
17 l) OPTS=$OPTS" -l";;
18 n) OPTS=$OPTS" -n "$OPTARG;;
19 p) OPTS=$OPTS" -p";;
20 v) OPTS=$OPTS" -v";;
21 V) VERSION=true;;
22 \?) echo $USAGE 1>&2
23 exit 2
24 ;;
25 esac
26 done
27 $VERSION && $DIRNAME/xfs_io -p xfs_bmap -V
28
29 shift `expr $OPTIND - 1`
30
31 while [ "$1" != "" ]
32 do
33 $DIRNAME/xfs_io -r -p xfs_bmap -c "bmap $OPTS" "$1"
34 status=$?
35 [ $status -ne 0 ] && exit $status
36 shift
37 done
38 exit 0