]>
Commit | Line | Data |
---|---|---|
2bd0ea18 | 1 | #!/bin/sh -f |
959ef981 | 2 | # SPDX-License-Identifier: GPL-2.0 |
2bd0ea18 | 3 | # |
0d3e0b37 | 4 | # Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. |
dfc130f3 | 5 | # |
2bd0ea18 NS |
6 | |
7 | OPTS=" " | |
add013da NS |
8 | DBOPTS=" " |
9 | USAGE="usage: xfs_ncheck [-sfV] [-l logdev] [-i ino]... special" | |
2bd0ea18 NS |
10 | |
11 | ||
add013da | 12 | while getopts "b:fi:l:svV" c |
2bd0ea18 NS |
13 | do |
14 | case $c in | |
15 | s) OPTS=$OPTS"-s ";; | |
16 | i) OPTS=$OPTS"-i "$OPTARG" ";; | |
9440d84d | 17 | v) OPTS=$OPTS"-v ";; |
add013da NS |
18 | f) DBOPTS=$DBOPTS" -f";; |
19 | l) DBOPTS=$DBOPTS" -l "$OPTARG" ";; | |
138aab65 CH |
20 | V) xfs_db -p xfs_ncheck -V |
21 | status=$? | |
22 | exit $status | |
23 | ;; | |
2bd0ea18 NS |
24 | \?) echo $USAGE 1>&2 |
25 | exit 2 | |
26 | ;; | |
27 | esac | |
28 | done | |
29 | set -- extra $@ | |
30 | shift $OPTIND | |
31 | case $# in | |
add013da | 32 | 1) xfs_db$DBOPTS -r -p xfs_ncheck -c "blockget -ns" -c "ncheck$OPTS" $1 |
2bd0ea18 NS |
33 | status=$? |
34 | ;; | |
35 | *) echo $USAGE 1>&2 | |
36 | exit 2 | |
37 | ;; | |
38 | esac | |
39 | exit $status |