parallels: invent parallels_opts_prealloc() helper to parse prealloc opts
commit93361b7e33ab7046e7c4c2064503ff199ae1cef9
authorDenis V. Lunev <den@openvz.org>
Mon, 18 Sep 2023 18:00:42 +0000 (18 20:00 +0200)
committerDenis V. Lunev <den@openvz.org>
Thu, 21 Sep 2023 06:45:43 +0000 (21 08:45 +0200)
treeb439e5f000bff2f78243f85dc0ae9813b2f18927
parentc74cd7bd328001c85cd6f74f63b52ae1263b4c22
parallels: invent parallels_opts_prealloc() helper to parse prealloc opts

This patch creates above mentioned helper and moves its usage to the
beginning of parallels_open(). This simplifies parallels_open() a bit.

The patch also ensures that we store prealloc_size on block driver state
always in sectors. This makes code cleaner and avoids wrong opinion at
the assignment that the value is in bytes.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
block/parallels.c