Device: Consider VSA when calculating logical disk size
When the underlying disk driver has VSA access the total size must be calculated with respect to the VSA offset.pull/56/head
parent
f4e4a103ad
commit
41a569fc2d
|
|
@ -642,7 +642,12 @@ std::optional<uint64_t> Device::getLogicalDiskSize() {
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
return info->getReportedSize();
|
||||
const auto reportedSize = info->getReportedSize();
|
||||
|
||||
if (diskReadDriver->getAccess() == Disk::Access::VSA)
|
||||
return reportedSize - diskReadDriver->getVSAOffset();
|
||||
|
||||
return reportedSize;
|
||||
}
|
||||
|
||||
std::optional<uint64_t> Device::getVSAOffsetInLogicalDisk() {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public:
|
|||
virtual std::pair<uint32_t, uint32_t> getBlockSizeBounds() const = 0;
|
||||
|
||||
void setVSAOffset(uint64_t offset) { vsaOffset = offset; }
|
||||
uint64_t getVSAOffset() const { return vsaOffset; }
|
||||
|
||||
protected:
|
||||
uint64_t vsaOffset = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue