Authored by: Yuri Pankov <yuri.pankov@gmail.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov <mail@gmelikov.ru>
OpenZFS-issue: https://www.illumos.org/issues/6580
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/
9498083
Closes #5789
Porting notes:
- deleted in ZoL: functional/utils_test/utils_test_007_pos.ksh
"<status> [type]"
fi
- if [[ $WRAPPER == *"smi"* ]]; then
- $ECHO $device | $EGREP "^c[0-F]+([td][0-F]+)+$" > /dev/null 2>&1
- if (( $? == 0 )); then
- device=${device}s2
- fi
- fi
-
#
# Get all the cache devices and status table like below
#
log_note "Zero $FS_DISK0 and place free space in to slice 0"
log_must cleanup_devices $FS_DISK0
-if [[ $WRAPPER == *"smi"* ]]; then
- diskslice="${DEV_DSKDIR}/${FS_DISK0}${SLICE_PREFIX}${SLICE2}"
-else
- diskslice="${DEV_DSKDIR}/${FS_DISK0}${SLICE_PREFIX}${SLICE0}"
-fi
-
+diskslice="${DEV_DSKDIR}/${FS_DISK0}${SLICE0}"
log_note "Configuring $diskslice as dump device"
log_must $DUMPADM -d $diskslice > /dev/null
for num in 0 1 2; do
eval typeset slice=\${FS_SIDE$num}
- disk=${slice%${SLICE_PREFIX}*}
+ disk=${slice%s*}
slice=${slice##*${SLICE_PREFIX}}
- if [[ $WRAPPER == *"smi"* && $disk == ${saved_disk} ]]; then
- cyl=$(get_endslice $disk ${saved_slice})
- log_must set_partition $slice "$cyl" $FS_SIZE $disk
- else
- log_must set_partition $slice "" $FS_SIZE $disk
- fi
- saved_disk=$disk
- saved_slice=$slice
+ log_must set_partition $slice "" $FS_SIZE $disk
done
log_note "Make a ufs filesystem on source $rawdisk1"
eval typeset slice=\${FS_SIDE$num}
disk=${slice%${SLICE_PREFIX}*}
slice=${slice##*${SLICE_PREFIX}}
- if [[ $WRAPPER == *"smi"* && \
- $disk == ${saved_disk} ]]; then
- cyl=$(get_endslice $disk ${saved_slice})
- log_must set_partition $slice "$cyl" $FS_SIZE $disk
- else
- log_must set_partition $slice "" $FS_SIZE $disk
- fi
- saved_disk=$disk
- saved_slice=$slice
+ log_must set_partition $slice "" $FS_SIZE $disk
done
if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then
eval typeset slice=\${FS_SIDE$num}
disk=${slice%${SLICE_PREFIX}*}
slice=${slice##*${SLICE_PREFIX}}
- if [[ $WRAPPER == *"smi"* && \
- $disk == ${saved_disk} ]]; then
- cyl=$(get_endslice $disk ${saved_slice})
- log_must set_partition $slice "$cyl" $FS_SIZE $disk
- else
- log_must set_partition $slice "" $FS_SIZE $disk
- fi
- saved_disk=$disk
- saved_slice=$slice
+ log_must set_partition $slice "" $FS_SIZE $disk
done
if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then
eval typeset slice=\${FS_SIDE$num}
disk=${slice%${SLICE_PREFIX}*}
slice=${slice##*${SLICE_PREFIX}}
- if [[ $WRAPPER == *"smi"* && \
- $disk == ${saved_disk} ]]; then
- cyl=$(get_endslice $disk ${saved_slice})
- log_must set_partition $slice "$cyl" $FS_SIZE $disk
- else
- log_must set_partition $slice "" $FS_SIZE $disk
- fi
- saved_disk=$disk
- saved_slice=$slice
+ log_must set_partition $slice "" $FS_SIZE $disk
done
if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then
eval typeset slice=\${FS_SIDE$num}
disk=${slice%${SLICE_PREFIX}*}
slice=${slice##*${SLICE_PREFIX}}
- if [[ $WRAPPER == *"smi"* && \
- $disk == ${saved_disk} ]]; then
- cyl=$(get_endslice $disk ${saved_slice})
- log_must set_partition $slice "$cyl" $FS_SIZE $disk
- else
- log_must set_partition $slice "" $FS_SIZE $disk
- fi
- saved_disk=$disk
- saved_slice=$slice
+ log_must set_partition $slice "" $FS_SIZE $disk
done
while (( i < ${#vdevs[*]} )); do
eval typeset slice=\${FS_SIDE$num}
disk=${slice%${SLICE_PREFIX}*}
slice=${slice##*${SLICE_PREFIX}}
- if [[ $WRAPPER == *"smi"* && \
- $disk == ${saved_disk} ]]; then
- cyl=$(get_endslice $disk ${saved_slice})
- log_must set_partition $slice "$cyl" $FS_SIZE $disk
- else
- log_must set_partition $slice "" $FS_SIZE $disk
- fi
- saved_disk=$disk
- saved_slice=$slice
+ log_must set_partition $slice "" $FS_SIZE $disk
done
if [[ -n $SINGLE_DISK && -n ${vdevs[i]} ]]; then
"<status> [type]"
fi
- if [[ $WRAPPER == *"smi"* ]]; then
- $ECHO $device | $EGREP "^c[0-F]+([td][0-F]+)+$" > /dev/null 2>&1
- if (( $? == 0 )); then
- device=${device}s2
- fi
- fi
-
#
# Get all the slog devices and status table like below
#