btrfs: use printxval_u for error types printing

* btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) <case
BTRFS_IOC_GET_DEV_STATS>: Use printxval_u for error type printing.
* tests/btrfs.c (btrfs_test_get_dev_stats_ioctl): Update expected output.
This commit is contained in:
Eugene Syromyatnikov 2018-04-04 15:56:52 +02:00 committed by Dmitry V. Levin
parent b85a824a5e
commit 3dd9d5f34a
2 changed files with 10 additions and 10 deletions

10
btrfs.c
View File

@ -813,13 +813,9 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
break;
}
const char *err_type =
xlookup(btrfs_dev_stats_values, i);
if (err_type)
tprintf("[%s] = ", err_type);
else
tprintf("[%" PRIu64 "] = ", i);
tprintf("%" PRI__u64, args.values[i]);
tprints("[");
printxval_u(btrfs_dev_stats_values, i, NULL);
tprintf("] = %" PRI__u64, args.values[i]);
}
tprints("]}");
break;

View File

@ -1724,10 +1724,14 @@ btrfs_test_get_dev_stats_ioctl(void)
if (i)
printf(", ");
if (name)
printf("[%s] = ", name);
else
if (name) {
if (verbose_xlat)
printf("[%u /* %s */] = ", i, name);
else
printf("[%s] = ", name);
} else {
printf("[%u] = ", i);
}
printf("%" PRI__u64, args.values[i]);
}