Skip to contentSkip to conversation

fio: simplify zoneskip= validness check

PATCH In review Alexey Dobriyan 2 participants 2 messages Feb 14, 2021 – Feb 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fio: simplify zoneskip= validness check

Simply check the remainder

(zoneskip % zone_size) > 0

It will do the right thing for all zoneskip= values, and zonesize being positive is checked earlier.

---

 zbd.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
zbd.c +1 -3
@@ -285,9 +285,7 @@ static bool zbd_verify_sizes(void)
 				return false;
 			}
 
-			if (td->o.zone_skip &&
-			    (td->o.zone_skip < td->o.zone_size ||
-			     td->o.zone_skip % td->o.zone_size)) {
+			if (td->o.zone_skip % td->o.zone_size) {
 				log_err("%s: zoneskip %llu is not a multiple of the device zone size %llu.\n",
 					f->file_name, (unsigned long long) td->o.zone_skip,
 					(unsigned long long) td->o.zone_size);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines

-----Original Message-----
From: Alexey Dobriyan <[email protected]>
Sent: Sunday, February 14, 2021 2:17 PM
To: [email protected]
Cc: [email protected]
Subject: [PATCH] fio: simplify zoneskip= validness check

fio: -> zbd:?

Quoted 9 lines

Simply check the remainder

(zoneskip % zone_size) > 0

It will do the right thing for all zoneskip= values, and zonesize being positive is checked earlier.

With the small nit above, looks good.

Quoted 21 lines

---

 zbd.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
zbd.c +1 -3
@@ -285,9 +285,7 @@ static bool zbd_verify_sizes(void)
 				return false;
 			}
 
-			if (td->o.zone_skip &&
-			    (td->o.zone_skip < td->o.zone_size ||
-			     td->o.zone_skip % td->o.zone_size)) {
+			if (td->o.zone_skip % td->o.zone_size) {
 				log_err("%s: zoneskip %llu is not a multiple of
 the device zone size %llu.\n",
 					f->file_name, (unsigned long long)

td->o.zone_skip,
(unsigned long long) td-

Quoted 1 line

o.zone_size);