Disk: Allow mismatched access for Read and Write drivers

This will cause the driver to fall back to the least common
denominator.
This commit is contained in:
Paul Hollinsky
2022-03-03 20:29:13 -05:00
parent 1118428250
commit 0a15adbe91
9 changed files with 56 additions and 7 deletions
+1
View File
@@ -25,6 +25,7 @@ optional<uint64_t> WriteDriver::writeLogicalDisk(Communication& com, device_even
// ensure an operation is atomic
std::vector<uint8_t> atomicBuffer(idealBlockSize);
pos += vsaOffset;
const uint64_t startBlock = pos / idealBlockSize;
const uint32_t posWithinFirstBlock = static_cast<uint32_t>(pos % idealBlockSize);
uint64_t blocks = amount / idealBlockSize + (amount % idealBlockSize ? 1 : 0);