From: Kirill Tkhai <ktkhai@virtuozzo.com>
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
Subject: [PATCH net-next v2 1/3] net: Make extern and export get_net_ns()
Date: Wed, 14 Feb 2018 16:39:56 +0300 [thread overview]
Message-ID: <151861559628.9376.13025481762984671728.stgit@localhost.localdomain> (raw)
In-Reply-To: <151861548493.9376.6162694167471967.stgit@localhost.localdomain>
This function will be used to obtain net of tun device.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
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)
{
next prev parent reply other threads:[~2018-02-14 13:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 13:39 [PATCH net-next v2 0/3] Add ioctl() SIOCGSKNS cmd to allow obtaining net ns of tun device Kirill Tkhai
2018-02-14 13:39 ` Kirill Tkhai [this message]
2018-02-14 13:40 ` [PATCH net-next v2 2/3] net: Export open_related_ns() Kirill Tkhai
2018-02-14 13:40 ` [PATCH net-next v2 3/3] tun: Add ioctl() SIOCGSKNS cmd to allow obtaining net ns of tun device Kirill Tkhai
2018-02-15 20:35 ` [PATCH net-next v2 0/3] " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=151861559628.9376.13025481762984671728.stgit@localhost.localdomain \
--to=ktkhai@virtuozzo.com \
--cc=aviadye@mellanox.com \
--cc=davejwatson@fb.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jasowang@redhat.com \
--cc=kstewart@linuxfoundation.org \
--cc=linyu.yuan@alcatel-sbell.com.cn \
--cc=netdev@vger.kernel.org \
--cc=peterpenkov96@gmail.com \
--cc=willemb@google.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox