diff options
author | Simon Rettberg | 2022-08-11 10:10:27 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-08-11 10:10:27 +0200 |
commit | e8c3d0846c7bb581d417e460a3a8a8a32df2081d (patch) | |
tree | 05b51d271bbf7b756c83230e570588b8ade65b5f | |
parent | [slx-dmsetup] Handle absolute slice sizes first and remember used space (diff) | |
download | systemd-init-e8c3d0846c7bb581d417e460a3a8a8a32df2081d.tar.gz systemd-init-e8c3d0846c7bb581d417e460a3a8a8a32df2081d.tar.xz systemd-init-e8c3d0846c7bb581d417e460a3a8a8a32df2081d.zip |
[slx-dmsetup] Cannot make a local var with same name as global readonly
-rwxr-xr-x | modules.d/slx-dmsetup/scripts/dmsetup-slx-device | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules.d/slx-dmsetup/scripts/dmsetup-slx-device b/modules.d/slx-dmsetup/scripts/dmsetup-slx-device index 3551a6eb..65ee94b5 100755 --- a/modules.d/slx-dmsetup/scripts/dmsetup-slx-device +++ b/modules.d/slx-dmsetup/scripts/dmsetup-slx-device @@ -42,7 +42,7 @@ handle_unit() { case "$2" in [%]) # These are relative to the writable CoW device # Allow > 100% for over-provisioning - val="$(( writable_device_sz * val / 100 ))" + val="$(( remaining_device_sz * val / 100 ))" ;; [Kk]) potency=1 ;;& [Mm]) potency=2 ;;& @@ -58,7 +58,7 @@ handle_unit() { } parse_config() { - local writable_device_sz="$writable_device_sz" + local remaining_device_sz="$writable_device_sz" parse_config_int "$1" 0 parse_config_int "$1" 1 } @@ -131,7 +131,7 @@ parse_config_int() { esac # Decrease for upcoming calculations if we used fixed values here if [ "$rel_only" != 1 ]; then - (( writable_device_sz -= ( min + max ) / 2 )) + (( remaining_device_sz -= ( min + max ) / 2 )) fi done <<< "$1" } |