rbd: fix Windows block count overflow

rbd-wnbd uses uint32_t for storing the image total block count,
which will overflow for >2TB images that are using 512B blocks.

This patch will switch to a uint64_t.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
This commit is contained in:
Lucian Petrut 2021-01-27 08:30:54 +00:00
parent 7a2f9903fe
commit 6dc45eea20

View File

@ -65,7 +65,7 @@ class WnbdHandler
private:
librbd::Image &image;
std::string instance_name;
uint32_t block_count;
uint64_t block_count;
uint32_t block_size;
bool readonly;
bool rbd_cache_enabled;
@ -76,7 +76,7 @@ private:
public:
WnbdHandler(librbd::Image& _image, std::string _instance_name,
uint32_t _block_count, uint32_t _block_size,
uint64_t _block_count, uint32_t _block_size,
bool _readonly, bool _rbd_cache_enabled,
uint32_t _io_req_workers,
uint32_t _io_reply_workers)