mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
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.
This commit is contained in:
+6
-1
@@ -642,7 +642,12 @@ std::optional<uint64_t> Device::getLogicalDiskSize() {
|
|||||||
return std::nullopt;
|
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() {
|
std::optional<uint64_t> Device::getVSAOffsetInLogicalDisk() {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public:
|
|||||||
virtual std::pair<uint32_t, uint32_t> getBlockSizeBounds() const = 0;
|
virtual std::pair<uint32_t, uint32_t> getBlockSizeBounds() const = 0;
|
||||||
|
|
||||||
void setVSAOffset(uint64_t offset) { vsaOffset = offset; }
|
void setVSAOffset(uint64_t offset) { vsaOffset = offset; }
|
||||||
|
uint64_t getVSAOffset() const { return vsaOffset; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint64_t vsaOffset = 0;
|
uint64_t vsaOffset = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user