Simplify the tcp pcblist estimate logic slightly.

MFC after:	3 days
This commit is contained in:
John Baldwin 2010-08-27 18:17:46 +00:00
parent ac59403c39
commit 98b9eb0db2

View File

@ -1022,11 +1022,9 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
* resource-intensive to repeat twice on every request.
*/
if (req->oldptr == NULL) {
m = syncache_pcbcount();
n = V_tcbinfo.ipi_count;
n += imax((m + n) / 8, 10);
req->oldidx = 2 * (sizeof xig) +
(m + n) * sizeof(struct xtcpcb);
n = V_tcbinfo.ipi_count + syncache_pcbcount();
n += imax(n / 8, 10);
req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xtcpcb);
return (0);
}