ipvs: Pass ipvs not net to register_ip_vs_app and unregister_ip_vs_app
[deliverable/linux.git] / net / netfilter / ipvs / ip_vs_app.c
index 20cb947a3ddd5615936e14ae6e01084a6ff53aaa..a0cc08337a2ca8364d4748fecd5f784930933fde 100644 (file)
@@ -192,15 +192,11 @@ register_ip_vs_app_inc(struct netns_ipvs *ipvs, struct ip_vs_app *app, __u16 pro
 
 
 /* Register application for netns */
-struct ip_vs_app *register_ip_vs_app(struct net *net, struct ip_vs_app *app)
+struct ip_vs_app *register_ip_vs_app(struct netns_ipvs *ipvs, struct ip_vs_app *app)
 {
-       struct netns_ipvs *ipvs = net_ipvs(net);
        struct ip_vs_app *a;
        int err = 0;
 
-       if (!ipvs)
-               return ERR_PTR(-ENOENT);
-
        mutex_lock(&__ip_vs_app_mutex);
 
        list_for_each_entry(a, &ipvs->app_list, a_list) {
@@ -231,13 +227,10 @@ out_unlock:
  *     We are sure there are no app incarnations attached to services
  *     Caller should use synchronize_rcu() or rcu_barrier()
  */
-void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app)
+void unregister_ip_vs_app(struct netns_ipvs *ipvs, struct ip_vs_app *app)
 {
-       struct netns_ipvs *ipvs = net_ipvs(net);
        struct ip_vs_app *a, *anxt, *inc, *nxt;
-
-       if (!ipvs)
-               return;
+       struct net *net = ipvs->net;
 
        mutex_lock(&__ip_vs_app_mutex);
 
@@ -623,6 +616,8 @@ int __net_init ip_vs_app_net_init(struct net *net)
 
 void __net_exit ip_vs_app_net_cleanup(struct net *net)
 {
-       unregister_ip_vs_app(net, NULL /* all */);
+       struct netns_ipvs *ipvs = net_ipvs(net);
+
+       unregister_ip_vs_app(ipvs, NULL /* all */);
        remove_proc_entry("ip_vs_app", net->proc_net);
 }
This page took 0.024127 seconds and 5 git commands to generate.