diff options
author | Changbin Du <changbin.du@gmail.com> | 2021-06-15 02:52:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-15 21:00:45 +0300 |
commit | e34492dea68d4f09e9989e518fc76cd41909d707 (patch) | |
tree | cae070915005e908eec0eefdbff2da1080ad06f1 /include/net/net_namespace.h | |
parent | 475b92f932168a78da8109acd10bfb7578b8f2bb (diff) | |
download | linux-e34492dea68d4f09e9989e518fc76cd41909d707.tar.xz |
net: inline function get_net_ns_by_fd if NET_NS is disabled
The function get_net_ns_by_fd() could be inlined when NET_NS is not
enabled.
Signed-off-by: Changbin Du <changbin.du@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r-- | include/net/net_namespace.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 6412d7833d97..bdc0459a595e 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h @@ -186,6 +186,7 @@ void net_ns_get_ownership(const struct net *net, kuid_t *uid, kgid_t *gid); void net_ns_barrier(void); struct ns_common *get_net_ns(struct ns_common *ns); +struct net *get_net_ns_by_fd(int fd); #else /* CONFIG_NET_NS */ #include <linux/sched.h> #include <linux/nsproxy.h> @@ -210,13 +211,17 @@ static inline struct ns_common *get_net_ns(struct ns_common *ns) { return ERR_PTR(-EINVAL); } + +static inline struct net *get_net_ns_by_fd(int fd) +{ + return ERR_PTR(-EINVAL); +} #endif /* CONFIG_NET_NS */ extern struct list_head net_namespace_list; struct net *get_net_ns_by_pid(pid_t pid); -struct net *get_net_ns_by_fd(int fd); #ifdef CONFIG_SYSCTL void ipx_register_sysctl(void); |