]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - io/xfs_bmap.sh
xfs: convert to new timestamp accessors
[thirdparty/xfsprogs-dev.git] / io / xfs_bmap.sh
CommitLineData
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
6OPTS=""
7VERSION=false
54806785 8USAGE="Usage: xfs_bmap [-adelpvV] [-n nx] file..."
e36dcc6f 9DIRNAME=`dirname $0`
2bd0ea18 10
54806785 11while getopts "adeln:pvV" c
e246ba5f
NS
12do
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
26done
e36dcc6f 27$VERSION && $DIRNAME/xfs_io -p xfs_bmap -V
2bd0ea18 28
989b74bc 29shift `expr $OPTIND - 1`
2bd0ea18 30
e246ba5f
NS
31while [ "$1" != "" ]
32do
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
37done
38exit 0