2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

tcp_read_sysctl_limits(): simplify vect

I spent some time trying to figure out why vect array
is declared as [2][3], also why vect[0] is not used.
The answer is commit 4bca68b that removed code using it.

Let's save a few bytes, and make the code more readable.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Kir Kolyshkin
2015-10-14 15:09:56 -07:00
committed by Pavel Emelyanov
parent 86bb235b5c
commit b1599c3d1c

View File

@@ -210,11 +210,11 @@ int kerndat_get_dirty_track(void)
static int tcp_read_sysctl_limits(void)
{
u32 vect[2][3] = { };
u32 vect[3] = { };
int ret;
struct sysctl_req req[] = {
{ "net/ipv4/tcp_rmem", &vect[1], CTL_U32A(ARRAY_SIZE(vect[1])) },
{ "net/ipv4/tcp_rmem", &vect, CTL_U32A(ARRAY_SIZE(vect)) },
};
/*
@@ -227,7 +227,7 @@ static int tcp_read_sysctl_limits(void)
goto out;
}
kdat.tcp_max_rshare = min(kdat.tcp_max_rshare, (int)vect[1][2]);
kdat.tcp_max_rshare = min(kdat.tcp_max_rshare, (int)vect[2]);
if (kdat.tcp_max_rshare < 128)
pr_warn("The memory limits for TCP queues are suspiciously small\n");