mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
ns: add to_<type>_ns() to respective headers
Every namespace type has a container_of(ns, <ns_type>, ns) static inline function that is currently not exposed in the header. So we have a bunch of places that open-code it via container_of(). Move it to the headers so we can use it directly. Reviewed-by: Aleksa Sarai <cyphar@cyphar.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -262,6 +262,11 @@ void ipx_unregister_sysctl(void);
|
||||
#ifdef CONFIG_NET_NS
|
||||
void __put_net(struct net *net);
|
||||
|
||||
static inline struct net *to_net_ns(struct ns_common *ns)
|
||||
{
|
||||
return container_of(ns, struct net, ns);
|
||||
}
|
||||
|
||||
/* Try using get_net_track() instead */
|
||||
static inline struct net *get_net(struct net *net)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user