From patchwork Thu Dec 14 13:51:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 848561 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Px8MhgGF"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yyFNq2p1sz9s7g for ; Fri, 15 Dec 2017 00:52:11 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbdLNNwI (ORCPT ); Thu, 14 Dec 2017 08:52:08 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:44715 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751477AbdLNNwH (ORCPT ); Thu, 14 Dec 2017 08:52:07 -0500 Received: by mail-pg0-f67.google.com with SMTP id j9so3441865pgc.11 for ; Thu, 14 Dec 2017 05:52:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=qCtz0YPXdSR9hAFkWcBd+QGilsuAMMETdHiC+QU7sHQ=; b=Px8MhgGFa6JFcJx1IB+cPWJRYSiG19qR4NJWXYkfbRnC+Y2ncu/rwRaoGRWzlH1D50 1qHDUPpp1WWBXRko00DQ/5ehrzD0GRP8IsU4qOcfIevMEiWTkx7umkl2FC1n0AkR63xy jhscuWeipyeHWhgIUc5x1ioGETnV6UHJpqErNSHqeVOKCDNaufNG33IpoafxKEjxtzHn JMbDg0BBXuyuPNIRdXivdLTFtCu1URGPMsIca/jyN3dwv930CTeoTtjM2L4SuG3ku7Cw Hx3SDJMfwm1JMsUrggJnUg423ymMCTaCQOx2YRO1F9/1EK0UTmaRmKfC+1ymwnISrQES 6+7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qCtz0YPXdSR9hAFkWcBd+QGilsuAMMETdHiC+QU7sHQ=; b=RdzWdo4hEyZSNT96KN3SFFcxNx6retC39T0aJFYlVMPx6rcfohqF5fy81FwnHkuyPn RUyJ4EfkabUVnBWTKyc6hpj00iPSD/6DUrjjC7DoFXcojgXLE8/bgzbH1DdZQz7+yAkm lhLhdQzILoHLF1QqDoq7rgRc6+p7EGzcvjon/Wl/AhLmT0siEzx4c0K6hQMaF37Q9x8z V5E7cwwDIGkMJ4WazUKwi/0kfP10nBFvaWdNPcTMThi2GifNCvXLo3dWXwvPsSW07J3P IdtGrU2bcFZqTkNU+bBMTP3so2DI8U3Mm7vRGOpTEuErmPT3D6HsFKf+r71fTWaDk5y8 wx3A== X-Gm-Message-State: AKGB3mL1tXyktnD2+G0O/sVUeIG8OAzN3ytkacnFQiEBY6HQw/vPbsKT 1NINqOGlGX+WgAlrrrn1LfA= X-Google-Smtp-Source: ACJfBotVPPCh+592hS9uHVA1yIcMfqFdcUWJ+q1rALL8VOj0ifAmnxBeDcVP7CPCWefp6Lg0X5PU4g== X-Received: by 10.84.139.129 with SMTP id 1mr5152802plr.87.1513259527080; Thu, 14 Dec 2017 05:52:07 -0800 (PST) Received: from local.opencloud.tech.localdomain ([52.229.160.192]) by smtp.gmail.com with ESMTPSA id w84sm8907744pfk.16.2017.12.14.05.52.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Dec 2017 05:52:06 -0800 (PST) From: Tonghao Zhang To: xiyou.wangcong@gmail.com, davem@davemloft.net Cc: netdev@vger.kernel.org, Tonghao Zhang Subject: [PATCH v7 1/3] sock: Change the netns_core member name. Date: Thu, 14 Dec 2017 05:51:57 -0800 Message-Id: <1513259519-32332-1-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Change the member name will make the code more readable. This patch will be used in next patch. Signed-off-by: Martin Zhang Signed-off-by: Tonghao Zhang --- include/net/netns/core.h | 2 +- net/core/sock.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/net/netns/core.h b/include/net/netns/core.h index 0ad4d0c..45cfb5d 100644 --- a/include/net/netns/core.h +++ b/include/net/netns/core.h @@ -11,7 +11,7 @@ struct netns_core { int sysctl_somaxconn; - struct prot_inuse __percpu *inuse; + struct prot_inuse __percpu *prot_inuse; }; #endif diff --git a/net/core/sock.c b/net/core/sock.c index c0b5b2f..c2dd2d3 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -3045,7 +3045,7 @@ struct prot_inuse { void sock_prot_inuse_add(struct net *net, struct proto *prot, int val) { - __this_cpu_add(net->core.inuse->val[prot->inuse_idx], val); + __this_cpu_add(net->core.prot_inuse->val[prot->inuse_idx], val); } EXPORT_SYMBOL_GPL(sock_prot_inuse_add); @@ -3055,7 +3055,7 @@ int sock_prot_inuse_get(struct net *net, struct proto *prot) int res = 0; for_each_possible_cpu(cpu) - res += per_cpu_ptr(net->core.inuse, cpu)->val[idx]; + res += per_cpu_ptr(net->core.prot_inuse, cpu)->val[idx]; return res >= 0 ? res : 0; } @@ -3063,13 +3063,13 @@ int sock_prot_inuse_get(struct net *net, struct proto *prot) static int __net_init sock_inuse_init_net(struct net *net) { - net->core.inuse = alloc_percpu(struct prot_inuse); - return net->core.inuse ? 0 : -ENOMEM; + net->core.prot_inuse = alloc_percpu(struct prot_inuse); + return net->core.prot_inuse ? 0 : -ENOMEM; } static void __net_exit sock_inuse_exit_net(struct net *net) { - free_percpu(net->core.inuse); + free_percpu(net->core.prot_inuse); } static struct pernet_operations net_inuse_ops = {