diff options
Diffstat (limited to 'include/net/genetlink.h')
-rw-r--r-- | include/net/genetlink.h | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index eb551baafc04..f7dcd2c70412 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -68,26 +68,15 @@ struct genl_info { | |||
68 | #endif | 68 | #endif |
69 | }; | 69 | }; |
70 | 70 | ||
71 | #ifdef CONFIG_NET_NS | ||
72 | static inline struct net *genl_info_net(struct genl_info *info) | 71 | static inline struct net *genl_info_net(struct genl_info *info) |
73 | { | 72 | { |
74 | return info->_net; | 73 | return read_pnet(&info->_net); |
75 | } | 74 | } |
76 | 75 | ||
77 | static inline void genl_info_net_set(struct genl_info *info, struct net *net) | 76 | static inline void genl_info_net_set(struct genl_info *info, struct net *net) |
78 | { | 77 | { |
79 | info->_net = net; | 78 | write_pnet(&info->_net, net); |
80 | } | 79 | } |
81 | #else | ||
82 | static inline struct net *genl_info_net(struct genl_info *info) | ||
83 | { | ||
84 | return &init_net; | ||
85 | } | ||
86 | |||
87 | static inline void genl_info_net_set(struct genl_info *info, struct net *net) | ||
88 | { | ||
89 | } | ||
90 | #endif | ||
91 | 80 | ||
92 | /** | 81 | /** |
93 | * struct genl_ops - generic netlink operations | 82 | * struct genl_ops - generic netlink operations |