[RH7,29/32] net: Make extern and export get_net_ns()

Submitted by Pavel Tikhomirov on June 8, 2020, 5:05 p.m.

Details

Message ID 20200608170602.308872-30-ptikhomirov@virtuozzo.com
State New
Series "port nsfs from vz8"
Headers show

Commit Message

Pavel Tikhomirov June 8, 2020, 5:05 p.m.
From: Kirill Tkhai <ktkhai@virtuozzo.com>

This function will be used to obtain net of tun device.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

(cherry picked from commit d8d211a2a0c37755a8660dc69f97b7c70bf210b1)

https://jira.sw.ru/browse/PSBM-102357

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 include/linux/socket.h | 2 ++
 net/socket.c           | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/include/linux/socket.h b/include/linux/socket.h
index d49d9bd7e7d9..591cec9a9bd8 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -354,4 +354,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 728c7ec9fca4..3cd3cbd2be1b 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1091,10 +1091,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)
 {