summaryrefslogtreecommitdiffstats
path: root/sys-utils/blkzone.c
diff options
context:
space:
mode:
authorDamien Le Moal2017-04-12 11:20:32 +0200
committerKarel Zak2017-04-18 11:25:31 +0200
commitb1484d8d37a8bb90dca99131b08e38d6c8399cac (patch)
treec230b62bcafae40f339f23c4ae4249285f13d734 /sys-utils/blkzone.c
parentlscpu: use macro for path to DMI (diff)
downloadkernel-qcow2-util-linux-b1484d8d37a8bb90dca99131b08e38d6c8399cac.tar.gz
kernel-qcow2-util-linux-b1484d8d37a8bb90dca99131b08e38d6c8399cac.tar.xz
kernel-qcow2-util-linux-b1484d8d37a8bb90dca99131b08e38d6c8399cac.zip
blkzone: Fix zone condition strings handling
Fixed the condition strings for implicit open and explicit open to match the man page defined strings ("oi" and "oe"). Also while at it, correct the condition_str array entries adding the reserved "xC" case so that the read_only, full and offline conditions match the condition codes. This increases the array size to 16, so also fix the condition code masking when displaying the result. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Diffstat (limited to 'sys-utils/blkzone.c')
-rw-r--r--sys-utils/blkzone.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys-utils/blkzone.c b/sys-utils/blkzone.c
index 1457225c9..7713ff3b2 100644
--- a/sys-utils/blkzone.c
+++ b/sys-utils/blkzone.c
@@ -151,10 +151,10 @@ static const char *type_text[] = {
static const char *condition_str[] = {
"nw", /* Not write pointer */
"em", /* Empty */
- "io", /* Implicitly opened */
- "eo", /* Explicitly opened */
+ "oi", /* Implicitly opened */
+ "oe", /* Explicitly opened */
"cl", /* Closed */
- "x5", "x6", "x7", "x8", "x9", "xA", "xB", /* xN: reserved */
+ "x5", "x6", "x7", "x8", "x9", "xA", "xB", "xC", /* xN: reserved */
"ro", /* Read only */
"fu", /* Full */
"of" /* Offline */
@@ -220,7 +220,7 @@ static int blkzone_report(struct blkzone_control *ctl)
" reset:%u non-seq:%u, zcond:%2u(%s) [type: %u(%s)]\n"),
start, len, (type == 0x1) ? 0 : wp - start,
entry->reset, entry->non_seq,
- cond, condition_str[cond & ARRAY_SIZE(condition_str)],
+ cond, condition_str[cond & (ARRAY_SIZE(condition_str) - 1)],
type, type_text[type]);
nr_zones--;