}
pv_field() {
- local r=$(pvs --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1")
+ local r
+ r=$(pvs --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1")
trim_ "$r"
}
vg_field() {
- local r=$(vgs --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1")
+ local r
+ r=$(vgs --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1")
trim_ "$r"
}
lv_field() {
- local r=$(lvs --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1")
+ local r
+ r=$(lvs --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1")
trim_ "$r"
}
lv_first_seg_field() {
- local r=$(lvs --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1" | head -1)
+ local r
+ r=$(lvs --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1" | head -1)
trim_ "$r"
}
lvh_field() {
- local r=$(lvs -H --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1")
+ local r
+ r=$(lvs -H --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1")
trim_ "$r"
}
lva_field() {
- local r=$(lvs -a --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1")
+ local r
+ r=$(lvs -a --config 'log{prefix=""}' --noheadings -o "$2" "${@:3}" "$1")
trim_ "$r"
}
lv_tree_devices_() {
local lv="$1/$2"
- local type=$(lv_field "$lv" segtype -a --unbuffered | head -n 1)
- local orig=$(lv_field_lv_ "$lv" origin)
+ local type
+ type=$(lv_field "$lv" segtype -a --unbuffered | head -n 1)
+ #local orig
+ #orig=$(lv_field_lv_ "$lv" origin)
# FIXME: should we count in also origins ?
#test -z "$orig" || lv_tree_devices_ $1 $orig
case "$type" in
lv_devices "$lv"
;;
mirror|raid*)
- local log=$(lv_field_lv_ "$lv" mirror_log)
+ local log
+ log=$(lv_field_lv_ "$lv" mirror_log)
test -z "$log" || lv_tree_devices_ "$1" "$log"
for i in $(lv_devices "$lv")
do lv_tree_devices_ "$1" "$i"; done