Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756590Ab1BYSxW (ORCPT ); Fri, 25 Feb 2011 13:53:22 -0500 Received: from mail-ew0-f46.google.com ([209.85.215.46]:41821 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756562Ab1BYSxU (ORCPT ); Fri, 25 Feb 2011 13:53:20 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=AFVzyE5Ak62fMwsXdNOdH1oEiiTM+79io7Y64rhz3TgkwQ0lnKKNYM/v0w2JFhB/q4 9uDruJ6RwNXWEfhFYlJAbEQJUNhii3vMb45A6LRYhZWeEVTc7CrPd/YGWX8RbZOsQJkW lm2mKTWFomc5gOofE3MvgbiA4R7h+iuIvBeRc= From: Lucian Adrian Grijincu To: "David S. Miller" , Alexey Dobriyan , "Eric W. Biederman" , Octavian Purdila , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lucian Adrian Grijincu Subject: [PATCH 5/9] sysctl: net: share netns_core_table between nets Date: Fri, 25 Feb 2011 20:52:37 +0200 Message-Id: <1298659961-23863-6-git-send-email-lucian.grijincu@gmail.com> X-Mailer: git-send-email 1.7.4.rc1.7.g2cf08.dirty In-Reply-To: <1298659961-23863-1-git-send-email-lucian.grijincu@gmail.com> References: <1298659961-23863-1-git-send-email-lucian.grijincu@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1917 Lines: 70 Signed-off-by: Lucian Adrian Grijincu --- net/core/sysctl_net_core.c | 28 +++------------------------- 1 files changed, 3 insertions(+), 25 deletions(-) diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 385b609..e5a1544 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c @@ -182,7 +182,7 @@ static struct ctl_table netns_core_table[] = { .data = &init_net.core.sysctl_somaxconn, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = (proc_handler *) netns_proc_dointvec }, { } }; @@ -195,41 +195,19 @@ __net_initdata struct ctl_path net_core_path[] = { static __net_init int sysctl_core_net_init(struct net *net) { - struct ctl_table *tbl; - net->core.sysctl_somaxconn = SOMAXCONN; - tbl = netns_core_table; - if (!net_eq(net, &init_net)) { - tbl = kmemdup(tbl, sizeof(netns_core_table), GFP_KERNEL); - if (tbl == NULL) - goto err_dup; - - tbl[0].data = &net->core.sysctl_somaxconn; - } - net->core.sysctl_hdr = register_net_sysctl_table(net, - net_core_path, tbl); + net_core_path, netns_core_table); if (net->core.sysctl_hdr == NULL) - goto err_reg; + return -ENOMEM; return 0; - -err_reg: - if (tbl != netns_core_table) - kfree(tbl); -err_dup: - return -ENOMEM; } static __net_exit void sysctl_core_net_exit(struct net *net) { - struct ctl_table *tbl; - - tbl = net->core.sysctl_hdr->ctl_table_arg; unregister_net_sysctl_table(net->core.sysctl_hdr); - BUG_ON(tbl == netns_core_table); - kfree(tbl); } static __net_initdata struct pernet_operations sysctl_core_ops = { -- 1.7.4.rc1.7.g2cf08.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/