diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-09-23 12:06:12 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2016-09-23 14:39:43 -0400 |
commit | 2ed6afdee798658fe3c33b50c4a79d1bde45f1d8 (patch) | |
tree | 5af38ce57575d8353dc1313957f97c96c2fb972c | |
parent | 213b067ce314f9d7e72307c7036ba3cd285b80da (diff) |
netns: move {inc,dec}_net_namespaces into #ifdef
With the newly enforced limit on the number of namespaces,
we get a build warning if CONFIG_NETNS is disabled:
net/core/net_namespace.c:273:13: error: 'dec_net_namespaces' defined but not used [-Werror=unused-function]
net/core/net_namespace.c:268:24: error: 'inc_net_namespaces' defined but not used [-Werror=unused-function]
This moves the two added functions inside the #ifdef that guards
their callers.
Fixes: 703286608a22 ("netns: Add a limit on the number of net namespaces")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
-rw-r--r-- | net/core/net_namespace.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index e8be581b47b0..5e0042693c65 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -266,16 +266,6 @@ struct net *get_net_ns_by_id(struct net *net, int id) | |||
266 | return peer; | 266 | return peer; |
267 | } | 267 | } |
268 | 268 | ||
269 | static struct ucounts *inc_net_namespaces(struct user_namespace *ns) | ||
270 | { | ||
271 | return inc_ucount(ns, current_euid(), UCOUNT_NET_NAMESPACES); | ||
272 | } | ||
273 | |||
274 | static void dec_net_namespaces(struct ucounts *ucounts) | ||
275 | { | ||
276 | dec_ucount(ucounts, UCOUNT_NET_NAMESPACES); | ||
277 | } | ||
278 | |||
279 | /* | 269 | /* |
280 | * setup_net runs the initializers for the network namespace object. | 270 | * setup_net runs the initializers for the network namespace object. |
281 | */ | 271 | */ |
@@ -320,6 +310,16 @@ out_undo: | |||
320 | 310 | ||
321 | 311 | ||
322 | #ifdef CONFIG_NET_NS | 312 | #ifdef CONFIG_NET_NS |
313 | static struct ucounts *inc_net_namespaces(struct user_namespace *ns) | ||
314 | { | ||
315 | return inc_ucount(ns, current_euid(), UCOUNT_NET_NAMESPACES); | ||
316 | } | ||
317 | |||
318 | static void dec_net_namespaces(struct ucounts *ucounts) | ||
319 | { | ||
320 | dec_ucount(ucounts, UCOUNT_NET_NAMESPACES); | ||
321 | } | ||
322 | |||
323 | static struct kmem_cache *net_cachep; | 323 | static struct kmem_cache *net_cachep; |
324 | static struct workqueue_struct *netns_wq; | 324 | static struct workqueue_struct *netns_wq; |
325 | 325 | ||