From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kirill Tkhai Subject: [PATCH net-next v2 1/3] net: Make extern and export get_net_ns() Date: Wed, 14 Feb 2018 16:39:56 +0300 Message-ID: <151861559628.9376.13025481762984671728.stgit@localhost.localdomain> References: <151861548493.9376.6162694167471967.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: davem@davemloft.net, jasowang@redhat.com, edumazet@google.com, xiyou.wangcong@gmail.com, willemb@google.com, peterpenkov96@gmail.com, linyu.yuan@alcatel-sbell.com.cn, kstewart@linuxfoundation.org, aviadye@mellanox.com, gregkh@linuxfoundation.org, ktkhai@virtuozzo.com, davejwatson@fb.com, netdev@vger.kernel.org Return-path: Received: from mail-he1eur01on0120.outbound.protection.outlook.com ([104.47.0.120]:48197 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030202AbeBNNkF (ORCPT ); Wed, 14 Feb 2018 08:40:05 -0500 In-Reply-To: <151861548493.9376.6162694167471967.stgit@localhost.localdomain> Sender: netdev-owner@vger.kernel.org List-ID: This function will be used to obtain net of tun device. Signed-off-by: Kirill Tkhai --- include/linux/socket.h | 2 ++ net/socket.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/socket.h b/include/linux/socket.h index 9286a5a8c60c..1ce1f768a58c 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -353,4 +353,6 @@ extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen unsigned int flags, struct timespec *timeout); extern int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, unsigned int flags); + +extern struct ns_common *get_net_ns(struct ns_common *ns); #endif /* _LINUX_SOCKET_H */ diff --git a/net/socket.c b/net/socket.c index fac8246a8ae8..7d1ffa755821 100644 --- a/net/socket.c +++ b/net/socket.c @@ -991,10 +991,11 @@ static long sock_do_ioctl(struct net *net, struct socket *sock, * what to do with it - that's up to the protocol still. */ -static struct ns_common *get_net_ns(struct ns_common *ns) +struct ns_common *get_net_ns(struct ns_common *ns) { return &get_net(container_of(ns, struct net, ns))->ns; } +EXPORT_SYMBOL_GPL(get_net_ns); static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg) {