ipvs: do not expect result from done_service
authorJulian Anastasov <ja@ssi.bg>
Fri, 22 Mar 2013 09:46:50 +0000 (11:46 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 Apr 2013 22:23:56 +0000 (00:23 +0200)
This method releases the scheduler state,
it can not fail. Such change will help to properly
replace the scheduler in following patch.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
include/net/ip_vs.h
net/netfilter/ipvs/ip_vs_ctl.c
net/netfilter/ipvs/ip_vs_dh.c
net/netfilter/ipvs/ip_vs_lblc.c
net/netfilter/ipvs/ip_vs_lblcr.c
net/netfilter/ipvs/ip_vs_sched.c
net/netfilter/ipvs/ip_vs_sh.c
net/netfilter/ipvs/ip_vs_wrr.c

index 18aeb85079f86232bd4de0420d8635aacb1f8ce0..4990de6985763a40dfb59396e61f6a2c2ccc7e20 100644 (file)
@@ -806,7 +806,7 @@ struct ip_vs_scheduler {
        /* scheduler initializing service */
        int (*init_service)(struct ip_vs_service *svc);
        /* scheduling service finish */
-       int (*done_service)(struct ip_vs_service *svc);
+       void (*done_service)(struct ip_vs_service *svc);
        /* scheduler updating service */
        int (*update_service)(struct ip_vs_service *svc);
        /* dest is linked */
@@ -1392,7 +1392,7 @@ extern int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler);
 extern int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler);
 extern int ip_vs_bind_scheduler(struct ip_vs_service *svc,
                                struct ip_vs_scheduler *scheduler);
-extern int ip_vs_unbind_scheduler(struct ip_vs_service *svc);
+extern void ip_vs_unbind_scheduler(struct ip_vs_service *svc);
 extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name);
 extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler);
 extern struct ip_vs_conn *
index 80d366b7daabb893e3216de30b5fed3ebc041dda..d02272685dda643bfe518d92757ca3cc389a517d 100644 (file)
@@ -1334,10 +1334,7 @@ ip_vs_edit_service(struct ip_vs_service *svc, struct ip_vs_service_user_kern *u)
                /*
                 * Unbind the old scheduler
                 */
-               if ((ret = ip_vs_unbind_scheduler(svc))) {
-                       old_sched = sched;
-                       goto out_unlock;
-               }
+               ip_vs_unbind_scheduler(svc);
 
                /*
                 * Bind the new scheduler
index ebe80f44e712534b7afb4540602d008513f2ed91..89c27230d93abcdf0acd6493d7afa8f3ed7ca7be 100644 (file)
@@ -174,7 +174,7 @@ static int ip_vs_dh_init_svc(struct ip_vs_service *svc)
 }
 
 
-static int ip_vs_dh_done_svc(struct ip_vs_service *svc)
+static void ip_vs_dh_done_svc(struct ip_vs_service *svc)
 {
        struct ip_vs_dh_state *s = svc->sched_data;
 
@@ -185,8 +185,6 @@ static int ip_vs_dh_done_svc(struct ip_vs_service *svc)
        kfree_rcu(s, rcu_head);
        IP_VS_DBG(6, "DH hash table (memory=%Zdbytes) released\n",
                  sizeof(struct ip_vs_dh_bucket)*IP_VS_DH_TAB_SIZE);
-
-       return 0;
 }
 
 
index b873e177435a71663067500d5c36182ec68c48a8..c7ff97895237d99b2fb812f93be849a2c2dacc3d 100644 (file)
@@ -388,7 +388,7 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc)
 }
 
 
-static int ip_vs_lblc_done_svc(struct ip_vs_service *svc)
+static void ip_vs_lblc_done_svc(struct ip_vs_service *svc)
 {
        struct ip_vs_lblc_table *tbl = svc->sched_data;
 
@@ -402,8 +402,6 @@ static int ip_vs_lblc_done_svc(struct ip_vs_service *svc)
        kfree_rcu(tbl, rcu_head);
        IP_VS_DBG(6, "LBLC hash table (memory=%Zdbytes) released\n",
                  sizeof(*tbl));
-
-       return 0;
 }
 
 
index c22f173d528c21c60ac33ba0e527c52fd2b77e80..6049b85df41fe44de05ad5931d2dcea45064503b 100644 (file)
@@ -555,7 +555,7 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
 }
 
 
-static int ip_vs_lblcr_done_svc(struct ip_vs_service *svc)
+static void ip_vs_lblcr_done_svc(struct ip_vs_service *svc)
 {
        struct ip_vs_lblcr_table *tbl = svc->sched_data;
 
@@ -569,8 +569,6 @@ static int ip_vs_lblcr_done_svc(struct ip_vs_service *svc)
        kfree_rcu(tbl, rcu_head);
        IP_VS_DBG(6, "LBLCR hash table (memory=%Zdbytes) released\n",
                  sizeof(*tbl));
-
-       return 0;
 }
 
 
index 7f11d3d37a427e416a49f6ff4a2c60ab64d43833..1b715d0caf435471da54c30eb22dce6c976aacd7 100644 (file)
@@ -64,22 +64,17 @@ int ip_vs_bind_scheduler(struct ip_vs_service *svc,
 /*
  *  Unbind a service with its scheduler
  */
-int ip_vs_unbind_scheduler(struct ip_vs_service *svc)
+void ip_vs_unbind_scheduler(struct ip_vs_service *svc)
 {
        struct ip_vs_scheduler *sched = svc->scheduler;
 
        if (!sched)
-               return 0;
+               return;
 
-       if (sched->done_service) {
-               if (sched->done_service(svc) != 0) {
-                       pr_err("%s(): done error\n", __func__);
-                       return -EINVAL;
-               }
-       }
+       if (sched->done_service)
+               sched->done_service(svc);
 
        svc->scheduler = NULL;
-       return 0;
 }
 
 
index 55e76d8db711ae715621c31744ee05f237d0c243..81c1a10c7b49d0aca067942de43381c4c2f10435 100644 (file)
@@ -187,7 +187,7 @@ static int ip_vs_sh_init_svc(struct ip_vs_service *svc)
 }
 
 
-static int ip_vs_sh_done_svc(struct ip_vs_service *svc)
+static void ip_vs_sh_done_svc(struct ip_vs_service *svc)
 {
        struct ip_vs_sh_state *s = svc->sched_data;
 
@@ -198,8 +198,6 @@ static int ip_vs_sh_done_svc(struct ip_vs_service *svc)
        kfree_rcu(s, rcu_head);
        IP_VS_DBG(6, "SH hash table (memory=%Zdbytes) released\n",
                  sizeof(struct ip_vs_sh_bucket)*IP_VS_SH_TAB_SIZE);
-
-       return 0;
 }
 
 
index 98cb05e345c9e07755747275f25807810a5db12e..a74fd9bab953ea1a3e627537a2002fc78bbf6022 100644 (file)
@@ -129,7 +129,7 @@ static int ip_vs_wrr_init_svc(struct ip_vs_service *svc)
 }
 
 
-static int ip_vs_wrr_done_svc(struct ip_vs_service *svc)
+static void ip_vs_wrr_done_svc(struct ip_vs_service *svc)
 {
        struct ip_vs_wrr_mark *mark = svc->sched_data;
 
@@ -137,8 +137,6 @@ static int ip_vs_wrr_done_svc(struct ip_vs_service *svc)
         *    Release the mark variable
         */
        kfree_rcu(mark, rcu_head);
-
-       return 0;
 }