From patchwork Thu Oct 2 10:14:10 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 2365 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 2B50ADDDEC for ; Thu, 2 Oct 2008 20:15:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753383AbYJBKPU (ORCPT ); Thu, 2 Oct 2008 06:15:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753371AbYJBKPT (ORCPT ); Thu, 2 Oct 2008 06:15:19 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:37486 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753329AbYJBKPQ (ORCPT ); Thu, 2 Oct 2008 06:15:16 -0400 Received: from iris.sw.ru ([10.30.1.9]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id m92ADskc002556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Oct 2008 14:13:55 +0400 (MSD) Received: from den by iris.sw.ru with local (Exim 4.69) (envelope-from ) id 1KlLCG-0002Z9-OC; Thu, 02 Oct 2008 14:14:12 +0400 From: "Denis V. Lunev" To: yoshfuji@linux-ipv6.org Cc: netdev@vger.kernel.org, containers@lists.linux-foundation.org, den@openvz.org, benjamin.thery@bull.net, dlezcano@fr.ibm.com, xemul@openvz.org Subject: [PATCH net-next 7/9] netns: add stab functions for per/namespace mibs allocation Date: Thu, 2 Oct 2008 14:14:10 +0400 Message-Id: <1222942452-9820-7-git-send-email-den@openvz.org> X-Mailer: git-send-email 1.5.6.4 In-Reply-To: <1222942394.6327.5.camel@iris.sw.ru> References: <1222942394.6327.5.camel@iris.sw.ru> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The content of init_ipv6_mibs/cleanup_ipv6_mibs will be moved to new calls one by one next. Signed-off-by: Denis V. Lunev --- net/ipv6/af_inet6.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 95055f8..46d4e62 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -834,6 +834,15 @@ static void cleanup_ipv6_mibs(void) snmp_mib_free((void **)udplite_stats_in6); } +static int __net_init ipv6_init_mibs(struct net *net) +{ + return 0; +} + +static void __net_exit ipv6_cleanup_mibs(struct net *net) +{ +} + static int inet6_net_init(struct net *net) { int err = 0; @@ -849,6 +858,9 @@ static int inet6_net_init(struct net *net) net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40; net->ipv6.sysctl.icmpv6_time = 1*HZ; + err = ipv6_init_mibs(net); + if (err) + return err; #ifdef CONFIG_PROC_FS err = udp6_proc_init(net); if (err) @@ -859,7 +871,6 @@ static int inet6_net_init(struct net *net) err = ac6_proc_init(net); if (err) goto proc_ac6_fail; -out: #endif return err; @@ -868,7 +879,9 @@ proc_ac6_fail: tcp6_proc_exit(net); proc_tcp6_fail: udp6_proc_exit(net); - goto out; +out: + ipv6_cleanup_mibs(net); + return err; #endif } @@ -879,6 +892,7 @@ static void inet6_net_exit(struct net *net) tcp6_proc_exit(net); ac6_proc_exit(net); #endif + ipv6_cleanup_mibs(net); } static struct pernet_operations inet6_net_ops = {