mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
OpenZFS 640 - number_to_scaled_string is duplicated in several commands
Porting Notes: - The OpenZFS patch added nicenum_scale() and nicenum() to a library not used by ZFS. Rather than pull in a new dependency the version of nicenum in lib/libzpool/util.c was simply replaced with the new one. Reviewed by: Sebastian Wiedenroth <wiedi@frubar.net> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Yuri Pankov <yuripv@gmx.com> Approved by: Dan McDonald <danmcd@joyent.com> Authored by: Jason King <jason.brian.king@gmail.com> Ported-by: Brian Behlendorf <behlendorf1@llnl.gov> OpenZFS-issue: https://www.illumos.org/issues/640 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/0a055120 Closes #6796
This commit is contained in:
committed by
Brian Behlendorf
parent
47c8e7fd97
commit
f3c8c9e6f0
+12
-9
@@ -23,6 +23,8 @@
|
||||
* Copyright (c) 2011, 2016 by Delphix. All rights reserved.
|
||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 Steven Hartland. All rights reserved.
|
||||
* Copyright (c) 2014 Integros [integros.com]
|
||||
* Copyright 2017 Joyent, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -608,12 +610,13 @@ usage(boolean_t requested)
|
||||
{
|
||||
const ztest_shared_opts_t *zo = &ztest_opts_defaults;
|
||||
|
||||
char nice_vdev_size[10];
|
||||
char nice_gang_bang[10];
|
||||
char nice_vdev_size[NN_NUMBUF_SZ];
|
||||
char nice_gang_bang[NN_NUMBUF_SZ];
|
||||
FILE *fp = requested ? stdout : stderr;
|
||||
|
||||
nicenum(zo->zo_vdev_size, nice_vdev_size);
|
||||
nicenum(zo->zo_metaslab_gang_bang, nice_gang_bang);
|
||||
nicenum(zo->zo_vdev_size, nice_vdev_size, sizeof (nice_vdev_size));
|
||||
nicenum(zo->zo_metaslab_gang_bang, nice_gang_bang,
|
||||
sizeof (nice_gang_bang));
|
||||
|
||||
(void) fprintf(fp, "Usage: %s\n"
|
||||
"\t[-v vdevs (default: %llu)]\n"
|
||||
@@ -3550,10 +3553,10 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
|
||||
old_class_space, new_class_space);
|
||||
|
||||
if (ztest_opts.zo_verbose >= 5) {
|
||||
char oldnumbuf[6], newnumbuf[6];
|
||||
char oldnumbuf[NN_NUMBUF_SZ], newnumbuf[NN_NUMBUF_SZ];
|
||||
|
||||
nicenum(old_class_space, oldnumbuf);
|
||||
nicenum(new_class_space, newnumbuf);
|
||||
nicenum(old_class_space, oldnumbuf, sizeof (oldnumbuf));
|
||||
nicenum(new_class_space, newnumbuf, sizeof (newnumbuf));
|
||||
(void) printf("%s grew from %s to %s\n",
|
||||
spa->spa_name, oldnumbuf, newnumbuf);
|
||||
}
|
||||
@@ -7024,7 +7027,7 @@ main(int argc, char **argv)
|
||||
ztest_info_t *zi;
|
||||
ztest_shared_callstate_t *zc;
|
||||
char timebuf[100];
|
||||
char numbuf[6];
|
||||
char numbuf[NN_NUMBUF_SZ];
|
||||
spa_t *spa;
|
||||
char *cmd;
|
||||
boolean_t hasalt;
|
||||
@@ -7178,7 +7181,7 @@ main(int argc, char **argv)
|
||||
|
||||
now = MIN(now, zs->zs_proc_stop);
|
||||
print_time(zs->zs_proc_stop - now, timebuf);
|
||||
nicenum(zs->zs_space, numbuf);
|
||||
nicenum(zs->zs_space, numbuf, sizeof (numbuf));
|
||||
|
||||
(void) printf("Pass %3d, %8s, %3llu ENOSPC, "
|
||||
"%4.1f%% of %5s used, %3.0f%% done, %8s to go\n",
|
||||
|
||||
Reference in New Issue
Block a user