ipvs: Initialize schedulers' struct list_head at compile time
authorSven Wegener <sven.wegener@stealer.net>
Sun, 10 Aug 2008 09:18:02 +0000 (09:18 +0000)
committerSven Wegener <sven.wegener@stealer.net>
Mon, 11 Aug 2008 09:46:06 +0000 (11:46 +0200)
No need to do it at runtime and this saves a couple of bytes in the text
section.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Acked-by: Simon Horman <horms@verge.net.au>
net/ipv4/ipvs/ip_vs_dh.c
net/ipv4/ipvs/ip_vs_lblc.c
net/ipv4/ipvs/ip_vs_lblcr.c
net/ipv4/ipvs/ip_vs_lc.c
net/ipv4/ipvs/ip_vs_nq.c
net/ipv4/ipvs/ip_vs_rr.c
net/ipv4/ipvs/ip_vs_sed.c
net/ipv4/ipvs/ip_vs_sh.c
net/ipv4/ipvs/ip_vs_wlc.c
net/ipv4/ipvs/ip_vs_wrr.c

index 8afc150..fa66824 100644 (file)
@@ -233,6 +233,7 @@ static struct ip_vs_scheduler ip_vs_dh_scheduler =
        .name =                 "dh",
        .refcnt =               ATOMIC_INIT(0),
        .module =               THIS_MODULE,
+       .n_list =               LIST_HEAD_INIT(ip_vs_dh_scheduler.n_list),
        .init_service =         ip_vs_dh_init_svc,
        .done_service =         ip_vs_dh_done_svc,
        .update_service =       ip_vs_dh_update_svc,
@@ -242,7 +243,6 @@ static struct ip_vs_scheduler ip_vs_dh_scheduler =
 
 static int __init ip_vs_dh_init(void)
 {
-       INIT_LIST_HEAD(&ip_vs_dh_scheduler.n_list);
        return register_ip_vs_scheduler(&ip_vs_dh_scheduler);
 }
 
index 0efa3db..7a6a319 100644 (file)
@@ -539,6 +539,7 @@ static struct ip_vs_scheduler ip_vs_lblc_scheduler =
        .name =                 "lblc",
        .refcnt =               ATOMIC_INIT(0),
        .module =               THIS_MODULE,
+       .n_list =               LIST_HEAD_INIT(ip_vs_lblc_scheduler.n_list),
        .init_service =         ip_vs_lblc_init_svc,
        .done_service =         ip_vs_lblc_done_svc,
        .update_service =       ip_vs_lblc_update_svc,
@@ -550,7 +551,6 @@ static int __init ip_vs_lblc_init(void)
 {
        int ret;
 
-       INIT_LIST_HEAD(&ip_vs_lblc_scheduler.n_list);
        sysctl_header = register_sysctl_paths(net_vs_ctl_path, vs_vars_table);
        ret = register_ip_vs_scheduler(&ip_vs_lblc_scheduler);
        if (ret)
index 8e3bbeb..c234e73 100644 (file)
@@ -728,6 +728,7 @@ static struct ip_vs_scheduler ip_vs_lblcr_scheduler =
        .name =                 "lblcr",
        .refcnt =               ATOMIC_INIT(0),
        .module =               THIS_MODULE,
+       .n_list =               LIST_HEAD_INIT(ip_vs_lblcr_scheduler.n_list),
        .init_service =         ip_vs_lblcr_init_svc,
        .done_service =         ip_vs_lblcr_done_svc,
        .update_service =       ip_vs_lblcr_update_svc,
@@ -739,7 +740,6 @@ static int __init ip_vs_lblcr_init(void)
 {
        int ret;
 
-       INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list);
        sysctl_header = register_sysctl_paths(net_vs_ctl_path, vs_vars_table);
        ret = register_ip_vs_scheduler(&ip_vs_lblcr_scheduler);
        if (ret)
index ac9f08e..ebcdbf7 100644 (file)
@@ -98,6 +98,7 @@ static struct ip_vs_scheduler ip_vs_lc_scheduler = {
        .name =                 "lc",
        .refcnt =               ATOMIC_INIT(0),
        .module =               THIS_MODULE,
+       .n_list =               LIST_HEAD_INIT(ip_vs_lc_scheduler.n_list),
        .init_service =         ip_vs_lc_init_svc,
        .done_service =         ip_vs_lc_done_svc,
        .update_service =       ip_vs_lc_update_svc,
@@ -107,7 +108,6 @@ static struct ip_vs_scheduler ip_vs_lc_scheduler = {
 
 static int __init ip_vs_lc_init(void)
 {
-       INIT_LIST_HEAD(&ip_vs_lc_scheduler.n_list);
        return register_ip_vs_scheduler(&ip_vs_lc_scheduler) ;
 }
 
index a46bf25..92f3a67 100644 (file)
@@ -136,6 +136,7 @@ static struct ip_vs_scheduler ip_vs_nq_scheduler =
        .name =                 "nq",
        .refcnt =               ATOMIC_INIT(0),
        .module =               THIS_MODULE,
+       .n_list =               LIST_HEAD_INIT(ip_vs_nq_scheduler.n_list),
        .init_service =         ip_vs_nq_init_svc,
        .done_service =         ip_vs_nq_done_svc,
        .update_service =       ip_vs_nq_update_svc,
@@ -145,7 +146,6 @@ static struct ip_vs_scheduler ip_vs_nq_scheduler =
 
 static int __init ip_vs_nq_init(void)
 {
-       INIT_LIST_HEAD(&ip_vs_nq_scheduler.n_list);
        return register_ip_vs_scheduler(&ip_vs_nq_scheduler);
 }
 
index c8db12d..358110d 100644 (file)
@@ -94,6 +94,7 @@ static struct ip_vs_scheduler ip_vs_rr_scheduler = {
        .name =                 "rr",                   /* name */
        .refcnt =               ATOMIC_INIT(0),
        .module =               THIS_MODULE,
+       .n_list =               LIST_HEAD_INIT(ip_vs_rr_scheduler.n_list),
        .init_service =         ip_vs_rr_init_svc,
        .done_service =         ip_vs_rr_done_svc,
        .update_service =       ip_vs_rr_update_svc,
@@ -102,7 +103,6 @@ static struct ip_vs_scheduler ip_vs_rr_scheduler = {
 
 static int __init ip_vs_rr_init(void)
 {
-       INIT_LIST_HEAD(&ip_vs_rr_scheduler.n_list);
        return register_ip_vs_scheduler(&ip_vs_rr_scheduler);
 }
 
index 2a7d313..77663d8 100644 (file)
@@ -138,6 +138,7 @@ static struct ip_vs_scheduler ip_vs_sed_scheduler =
        .name =                 "sed",
        .refcnt =               ATOMIC_INIT(0),
        .module =               THIS_MODULE,
+       .n_list =               LIST_HEAD_INIT(ip_vs_sed_scheduler.n_list),
        .init_service =         ip_vs_sed_init_svc,
        .done_service =         ip_vs_sed_done_svc,
        .update_service =       ip_vs_sed_update_svc,
@@ -147,7 +148,6 @@ static struct ip_vs_scheduler ip_vs_sed_scheduler =
 
 static int __init ip_vs_sed_init(void)
 {
-       INIT_LIST_HEAD(&ip_vs_sed_scheduler.n_list);
        return register_ip_vs_scheduler(&ip_vs_sed_scheduler);
 }
 
index b8fdfac..7b979e2 100644 (file)
@@ -230,6 +230,7 @@ static struct ip_vs_scheduler ip_vs_sh_scheduler =
        .name =                 "sh",
        .refcnt =               ATOMIC_INIT(0),
        .module =               THIS_MODULE,
+       .n_list  =              LIST_HEAD_INIT(ip_vs_sh_scheduler.n_list),
        .init_service =         ip_vs_sh_init_svc,
        .done_service =         ip_vs_sh_done_svc,
        .update_service =       ip_vs_sh_update_svc,
@@ -239,7 +240,6 @@ static struct ip_vs_scheduler ip_vs_sh_scheduler =
 
 static int __init ip_vs_sh_init(void)
 {
-       INIT_LIST_HEAD(&ip_vs_sh_scheduler.n_list);
        return register_ip_vs_scheduler(&ip_vs_sh_scheduler);
 }
 
index 772c3cb..9b0ef86 100644 (file)
@@ -126,6 +126,7 @@ static struct ip_vs_scheduler ip_vs_wlc_scheduler =
        .name =                 "wlc",
        .refcnt =               ATOMIC_INIT(0),
        .module =               THIS_MODULE,
+       .n_list =               LIST_HEAD_INIT(ip_vs_wlc_scheduler.n_list),
        .init_service =         ip_vs_wlc_init_svc,
        .done_service =         ip_vs_wlc_done_svc,
        .update_service =       ip_vs_wlc_update_svc,
@@ -135,7 +136,6 @@ static struct ip_vs_scheduler ip_vs_wlc_scheduler =
 
 static int __init ip_vs_wlc_init(void)
 {
-       INIT_LIST_HEAD(&ip_vs_wlc_scheduler.n_list);
        return register_ip_vs_scheduler(&ip_vs_wlc_scheduler);
 }
 
index 1d6932d..0d86a79 100644 (file)
@@ -212,6 +212,7 @@ static struct ip_vs_scheduler ip_vs_wrr_scheduler = {
        .name =                 "wrr",
        .refcnt =               ATOMIC_INIT(0),
        .module =               THIS_MODULE,
+       .n_list =               LIST_HEAD_INIT(ip_vs_wrr_scheduler.n_list),
        .init_service =         ip_vs_wrr_init_svc,
        .done_service =         ip_vs_wrr_done_svc,
        .update_service =       ip_vs_wrr_update_svc,
@@ -220,7 +221,6 @@ static struct ip_vs_scheduler ip_vs_wrr_scheduler = {
 
 static int __init ip_vs_wrr_init(void)
 {
-       INIT_LIST_HEAD(&ip_vs_wrr_scheduler.n_list);
        return register_ip_vs_scheduler(&ip_vs_wrr_scheduler) ;
 }