MCPcopy Create free account
hub / github.com/PiSCSI/piscsi / ValidateBlockAddress

Method ValidateBlockAddress

cpp/devices/disk.cpp:621–630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621void Disk::ValidateBlockAddress(access_mode mode) const
622{
623 const uint64_t block = mode == RW16 ? GetInt64(GetController()->GetCmd(), 2) : GetInt32(GetController()->GetCmd(), 2);
624
625 if (block > GetBlockCount()) {
626 LogTrace("Capacity of " + to_string(GetBlockCount()) + " block(s) exceeded: Trying to access block "
627 + to_string(block));
628 throw scsi_exception(sense_key::illegal_request, asc::lba_out_of_range);
629 }
630}
631
632tuple<bool, uint64_t, uint32_t> Disk::CheckAndGetStartAndCount(access_mode mode) const
633{

Callers

nothing calls this directly

Calls 3

GetInt32Function · 0.85
scsi_exceptionClass · 0.85
GetCmdMethod · 0.80

Tested by

no test coverage detected