Received: by 10.192.165.156 with SMTP id m28csp725648imm; Thu, 19 Apr 2018 06:36:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/tCJh0s/43AUPOVzZ+aAHJV5L2huAx12Lhn7cosWDlUjZ3FVTxRbaeYyYH8+CnAQPR6Y9s X-Received: by 2002:a17:902:7489:: with SMTP id h9-v6mr6122823pll.278.1524145007736; Thu, 19 Apr 2018 06:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524145007; cv=none; d=google.com; s=arc-20160816; b=UK+9nUePckv8yyVa+n3ArBtKKzMiPBMxllCIxhBouMLG2Ev90LxRc9yYLsboKDtBlx Smh3gzx0pFIMsV2xp6jW7e7L5oZLRLkR0L+pLEPZmHB1+h9EU4S+5LuAMHGvm2rigIFm iDcX1SgL5Iawmio1hr/WGr4qMg2/LRdRdt+6w7TvrhF/MHUYM2i5AjxSA0p1eN/uairE nIE1G+qgkqj4HgeAtTIVuZlF85z3QE+SqN3yTyCU6CSST8NTg+VND3f257i3hfqE+3oO Jw5zVNfRMDvC/F1jUQIjS6TkHl+FOwgoNaZFbRj8+zsu69vrjrMpwOYrj10C9310pRbz aNBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization:arc-authentication-results; bh=Z7M+t685vu67IGiteLDGEhyqOaYX7dOSRRfDa8VxXhU=; b=hLaMHOlYEDPm0IJ1hczdgZeFIIwGO3jMOffJyI7kmsrz6/ENfG3vrrGgWGAOHYzrxY lPteuafcza6VlPrBIAo1tYB6Ncf+uxPPzTKghN+ELxKxP0BH9NrUlPZzMOEMilptwSpU DtXeN7YZv5rGZk8b3H+2Cw7ds8gq7OW/BpnhDa2iiAfE61yBvVfo2y5Lqwnld4aHD0PU QL8S6UtaP11zxDjvdFSrIA4h0XCCEYonqCMZ0r501MMxhay4SKy6Cw7a4s+Lt//SCJYw GBzzZ6WF69E85NscBytuYSNpsgUzoMbQsD8G2sMNm9/Dasf+3qfKYWrHhavzWfApJ0fK CHUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13si3181115pfh.249.2018.04.19.06.36.33; Thu, 19 Apr 2018 06:36:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753510AbeDSNdl (ORCPT + 99 others); Thu, 19 Apr 2018 09:33:41 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56848 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752666AbeDSNdh (ORCPT ); Thu, 19 Apr 2018 09:33:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DBA68EC00F; Thu, 19 Apr 2018 13:33:36 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-121-60.rdu2.redhat.com [10.10.121.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2C2B10F1C05; Thu, 19 Apr 2018 13:33:35 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 21/24] net: Export get_proc_net() [ver #7] From: David Howells To: viro@zeniv.linux.org.uk Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org Date: Thu, 19 Apr 2018 14:33:35 +0100 Message-ID: <152414481524.23902.11586304669285812321.stgit@warthog.procyon.org.uk> In-Reply-To: <152414466005.23902.12967974041384198114.stgit@warthog.procyon.org.uk> References: <152414466005.23902.12967974041384198114.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 19 Apr 2018 13:33:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 19 Apr 2018 13:33:36 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Export get_proc_net() so that write() routines attached to net-namespaced proc files can find the network namespace that they're in. Currently, this is only accessible via seqfile routines. This will permit AFS to have a separate cell database per-network namespace and to manage each one independently of the others. Signed-off-by: David Howells --- fs/proc/proc_net.c | 3 ++- include/linux/proc_fs.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index 1763f370489d..23d56146e38f 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c @@ -33,10 +33,11 @@ static inline struct net *PDE_NET(struct proc_dir_entry *pde) return pde->parent->data; } -static struct net *get_proc_net(const struct inode *inode) +struct net *get_proc_net(const struct inode *inode) { return maybe_get_net(PDE_NET(PDE(inode))); } +EXPORT_SYMBOL_GPL(get_proc_net); int seq_open_net(struct inode *ino, struct file *f, const struct seq_operations *ops, int size) diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 928ef9e4d912..47a87121d30c 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -79,6 +79,8 @@ static inline struct proc_dir_entry *proc_net_mkdir( return proc_mkdir_data(name, 0, parent, net); } +extern struct net *get_proc_net(const struct inode *inode); + struct ns_common; int open_related_ns(struct ns_common *ns, struct ns_common *(*get_ns)(struct ns_common *ns));