1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

fsadm: rename local variables to avoid confusion

This commit is contained in:
Ondrej Kozina 2017-10-23 18:11:32 +02:00
parent 213cea3aaa
commit 9916d8fa9a

View File

@ -526,8 +526,8 @@ resize_xfs() {
# 1) look for LUKS device with well-known UUID format (CRYPT-LUKS[12]-<uuid>-<dmname>)
# 2) the dm-crypt device has to be on top of original device (dont't support detached LUKS headers)
detect_luks_device() {
local _LUKS_VERSION=
local _LUKS_UUID=
local _LUKS_VERSION
local _LUKS_UUID
CRYPT_NAME=""
CRYPT_DATA_OFFSET=""
@ -564,9 +564,9 @@ detect_luks_device() {
# - LUKS must be active for fs resize
######################################
resize_luks() {
local NEWFSIZE=
local NEWCBLOCKCOUNT=
local NAME=""
local L_NEWSIZE
local L_NEWBLOCKCOUNT
local NAME
local SHRINK=0
detect_luks_device
@ -585,25 +585,25 @@ resize_luks() {
error "New size is smaller than minimum ($(((CRYPT_DATA_OFFSET + 1) * 512)) bytes) for LUKS device $VOLUME"
fi
NEWCBLOCKCOUNT=$((NEWBLOCKCOUNT - CRYPT_DATA_OFFSET))
NEWFSIZE=$(( NEWCBLOCKCOUNT * 512))
L_NEWBLOCKCOUNT=$((NEWBLOCKCOUNT - CRYPT_DATA_OFFSET))
L_NEWSIZE=$(( L_NEWBLOCKCOUNT * 512))
VOLUME="$DM_DEV_DIR/mapper/$NAME"
detect_device_size
test "$DEVSIZE" -le "$NEWFSIZE" || SHRINK=1
test "$DEVSIZE" -le "$L_NEWSIZE" || SHRINK=1
if [ $SHRINK -eq 1 ]; then
# shrink fs on LUKS device first
resize "$DM_DEV_DIR/mapper/$NAME" "$NEWFSIZE"b
resize "$DM_DEV_DIR/mapper/$NAME" "$L_NEWSIZE"b
fi
# resize LUKS device
dry $CRYPTSETUP resize $NAME --size $NEWCBLOCKCOUNT || error "Failed to resize active LUKS device"
dry $CRYPTSETUP resize $NAME --size $L_NEWBLOCKCOUNT || error "Failed to resize active LUKS device"
if [ $SHRINK -eq 0 ]; then
# grow fs on top of LUKS device
resize "$DM_DEV_DIR/mapper/$NAME" "$NEWFSIZE"b
resize "$DM_DEV_DIR/mapper/$NAME" "$L_NEWSIZE"b
fi
}