o Reduce chances for integer overflow.
o More verbose sysctl description added. MFC after: 2 weeks Sponsored by: Nginx, Inc.
This commit is contained in:
parent
34b95dbb6a
commit
7dfdd83d56
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232156
@ -369,7 +369,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HANDLER_ARGS)
|
||||
maxlength = count;
|
||||
}
|
||||
n_nchash = nchash + 1;
|
||||
pct = (used * 100 * 100) / n_nchash;
|
||||
pct = (used * 100) / (n_nchash / 100);
|
||||
error = SYSCTL_OUT(req, &n_nchash, sizeof(n_nchash));
|
||||
if (error)
|
||||
return (error);
|
||||
@ -386,7 +386,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HANDLER_ARGS)
|
||||
}
|
||||
SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE_INT|CTLFLAG_RD|
|
||||
CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_nchash, "I",
|
||||
"nchash chain lengths");
|
||||
"nchash statistics (number of total/used buckets, maximum chain length, usage percentage)");
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user