diff options
author | Sven Wegener <sven.wegener@stealer.net> | 2008-08-10 14:24:41 -0400 |
---|---|---|
committer | Sven Wegener <sven.wegener@stealer.net> | 2008-08-11 08:00:46 -0400 |
commit | 519e49e888458649dde453d36c08b7f3432525dc (patch) | |
tree | 10f71cce8b9fe0a7ec0a764a24cdadc4f7446a2c /net/ipv4 | |
parent | 3a14a313f9b406c37ab7e3f855b060eb8587b8c7 (diff) |
ipvs: No need to zero out ip_vs_stats during initialization
It's a global variable and automatically initialized to zero. And now we can
also initialize the lock at compile time.
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Acked-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_ctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index d651bce0549..cfb1d20993d 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c | |||
@@ -1784,7 +1784,9 @@ static const struct file_operations ip_vs_info_fops = { | |||
1784 | 1784 | ||
1785 | #endif | 1785 | #endif |
1786 | 1786 | ||
1787 | struct ip_vs_stats ip_vs_stats; | 1787 | struct ip_vs_stats ip_vs_stats = { |
1788 | .lock = __SPIN_LOCK_UNLOCKED(ip_vs_stats.lock), | ||
1789 | }; | ||
1788 | 1790 | ||
1789 | #ifdef CONFIG_PROC_FS | 1791 | #ifdef CONFIG_PROC_FS |
1790 | static int ip_vs_stats_show(struct seq_file *seq, void *v) | 1792 | static int ip_vs_stats_show(struct seq_file *seq, void *v) |
@@ -2333,8 +2335,6 @@ int __init ip_vs_control_init(void) | |||
2333 | INIT_LIST_HEAD(&ip_vs_rtable[idx]); | 2335 | INIT_LIST_HEAD(&ip_vs_rtable[idx]); |
2334 | } | 2336 | } |
2335 | 2337 | ||
2336 | memset(&ip_vs_stats, 0, sizeof(ip_vs_stats)); | ||
2337 | spin_lock_init(&ip_vs_stats.lock); | ||
2338 | ip_vs_new_estimator(&ip_vs_stats); | 2338 | ip_vs_new_estimator(&ip_vs_stats); |
2339 | 2339 | ||
2340 | /* Hook the defense timer */ | 2340 | /* Hook the defense timer */ |