And since ctl_table.data is initialized later, we don't need to initialize
the data member of the template variable unix_table.
Signed-off-by: Changli Gao <redacted>
---
net/unix/sysctl_net_unix.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
From: Stephen Hemminger <hidden> Date: 2010-10-19 06:03:24
On Tue, 19 Oct 2010 13:24:02 +0800
Changli Gao [off-list ref] wrote:
quoted hunk
And since ctl_table.data is initialized later, we don't need to initialize
the data member of the template variable unix_table.
Signed-off-by: Changli Gao <redacted>
---
net/unix/sysctl_net_unix.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
On Tue, Oct 19, 2010 at 1:47 PM, Eric Dumazet [off-list ref] wrote:
Le mardi 19 octobre 2010 à 13:24 +0800, Changli Gao a écrit :
quoted
And since ctl_table.data is initialized later, we don't need to initialize
the data member of the template variable unix_table.
The init cost is nothing, since its a data blob that must be there
anyway.
Yes. I have tried to avoid global variable unix_table and unix_path,
then I got a bigger kernel image, so I gave it up.
We could even avoid the kmemdup() if CONFIG_NET_NS is not set
It is a good idea. We can check if the NS is init_net before kmalloc and kfree.
I'll send a update patch later. Thanks.
--
Regards,
Changli Gao(xiaosuo@gmail.com)