]>
Commit | Line | Data |
---|---|---|
e246ba5f | 1 | #!/bin/sh -f |
959ef981 | 2 | # SPDX-License-Identifier: GPL-2.0 |
e246ba5f | 3 | # Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved. |
dfc130f3 | 4 | # |
2bd0ea18 | 5 | |
e246ba5f NS |
6 | OPTS="" |
7 | VERSION=false | |
54806785 | 8 | USAGE="Usage: xfs_bmap [-adelpvV] [-n nx] file..." |
e36dcc6f | 9 | DIRNAME=`dirname $0` |
2bd0ea18 | 10 | |
54806785 | 11 | while getopts "adeln:pvV" c |
e246ba5f NS |
12 | do |
13 | case $c in | |
14 | a) OPTS=$OPTS" -a";; | |
15 | d) OPTS=$OPTS" -d";; | |
54806785 | 16 | e) OPTS=$OPTS" -e";; |
e246ba5f | 17 | l) OPTS=$OPTS" -l";; |
d2c39754 | 18 | n) OPTS=$OPTS" -n "$OPTARG;; |
e246ba5f NS |
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 | |
e36dcc6f | 27 | $VERSION && $DIRNAME/xfs_io -p xfs_bmap -V |
2bd0ea18 | 28 | |
989b74bc | 29 | shift `expr $OPTIND - 1` |
2bd0ea18 | 30 | |
e246ba5f NS |
31 | while [ "$1" != "" ] |
32 | do | |
989b74bc | 33 | $DIRNAME/xfs_io -r -p xfs_bmap -c "bmap $OPTS" "$1" |
e246ba5f NS |
34 | status=$? |
35 | [ $status -ne 0 ] && exit $status | |
e36dcc6f | 36 | shift |
e246ba5f NS |
37 | done |
38 | exit 0 |