Merge commit 'refs/top-bases/linux-legacy' into linux-legacy
This commit is contained in:
commit
f4b3b4ea9c
|
@ -509,19 +509,19 @@ void
|
|||
zfs_nicenum(uint64_t num, char *buf, size_t buflen)
|
||||
{
|
||||
uint64_t n = num;
|
||||
int index = 0;
|
||||
int i = 0;
|
||||
char u;
|
||||
|
||||
while (n >= 1024) {
|
||||
n /= 1024;
|
||||
index++;
|
||||
i++;
|
||||
}
|
||||
|
||||
u = " KMGTPE"[index];
|
||||
u = " KMGTPE"[i];
|
||||
|
||||
if (index == 0) {
|
||||
if (i == 0) {
|
||||
(void) snprintf(buf, buflen, "%llu", (u_longlong_t) n);
|
||||
} else if ((num & ((1ULL << 10 * index) - 1)) == 0) {
|
||||
} else if ((num & ((1ULL << 10 * i) - 1)) == 0) {
|
||||
/*
|
||||
* If this is an even multiple of the base, always display
|
||||
* without any decimal precision.
|
||||
|
@ -540,7 +540,7 @@ zfs_nicenum(uint64_t num, char *buf, size_t buflen)
|
|||
int i;
|
||||
for (i = 2; i >= 0; i--) {
|
||||
if (snprintf(buf, buflen, "%.*f%c", i,
|
||||
(double)num / (1ULL << 10 * index), u) <= 5)
|
||||
(double)num / (1ULL << 10 * i), u) <= 5)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1358,7 +1358,7 @@ zprop_expand_list(libzfs_handle_t *hdl, zprop_list_t **plp, zfs_type_t type)
|
|||
{
|
||||
zprop_list_t *entry;
|
||||
zprop_list_t **last;
|
||||
expand_data_t exp;
|
||||
expand_data_t ed;
|
||||
|
||||
if (*plp == NULL) {
|
||||
/*
|
||||
|
@ -1368,11 +1368,11 @@ zprop_expand_list(libzfs_handle_t *hdl, zprop_list_t **plp, zfs_type_t type)
|
|||
*/
|
||||
last = plp;
|
||||
|
||||
exp.last = last;
|
||||
exp.hdl = hdl;
|
||||
exp.type = type;
|
||||
ed.last = last;
|
||||
ed.hdl = hdl;
|
||||
ed.type = type;
|
||||
|
||||
if (zprop_iter_common(zprop_expand_list_cb, &exp, B_FALSE,
|
||||
if (zprop_iter_common(zprop_expand_list_cb, &ed, B_FALSE,
|
||||
B_FALSE, type) == ZPROP_INVAL)
|
||||
return (-1);
|
||||
|
||||
|
|
Loading…
Reference in New Issue