TESTS: Dont assume atomic align/granularity is always reported as non-0

From Alexander Motin <mav@freebsd.org>
Treat BlockLimits VPD atomic granulatity/alignment reported as 0
(no restrictions) as == 1 (also means no restriction).

Both 0 and 1 mean that there is no restriction on alignment or
granularity but with the difference being that the second value can
be used to increment to the next valid LBA.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2015-09-12 13:38:02 -07:00
parent e59d2ce1d3
commit 2e59742b1f
3 changed files with 14 additions and 12 deletions

View File

@@ -53,7 +53,7 @@ test_writeatomic16_simple(void)
logging(LOG_VERBOSE, "Test WRITEATOMIC16 of 1-256 blocks at the start of the LUN");
memset(buf, 0xa6, 256 * block_size);
for (i = inq_bl->atomic_gran; i <= 256; i += inq_bl->atomic_gran) {
for (i = gran; i <= 256; i += gran) {
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}
@@ -64,7 +64,7 @@ test_writeatomic16_simple(void)
}
logging(LOG_VERBOSE, "Test WRITEATOMIC16 of 1-256 blocks at the end of the LUN");
for (i = inq_bl->atomic_gran; i <= 256; i += inq_bl->atomic_gran) {
for (i = gran; i <= 256; i += gran) {
if (maximum_transfer_length && maximum_transfer_length < i) {
break;
}