aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4/ipvs/ip_vs_ctl.c
diff options
context:
space:
mode:
authorSven Wegener <sven.wegener@stealer.net>2008-08-10 18:24:41 +0000
committerSven Wegener <sven.wegener@stealer.net>2008-08-11 14:00:43 +0200
commit3a14a313f9b406c37ab7e3f855b060eb8587b8c7 (patch)
tree86dbebf182b9f8dc66cfce4e3defb79fb9e279cb /net/ipv4/ipvs/ip_vs_ctl.c
parent5587da55fbf332ab8d1b37637536f94bc373867f (diff)
ipvs: Embed estimator object into stats object
There's no reason for dynamically allocating an estimator object for every stats object. Directly embed an estimator object into every stats object and switch to using the kernel-provided list implementation. This makes the code much simpler and faster, as we do not need to traverse the list of all estimators to find the one belonging to a stats object. There's no need to use an rwlock, as we only have one reader. Also reorder the members of the estimator structure slightly to avoid padding overhead. This can't be done with the stats object as the members are currently copied to our user space object via memcpy() and changing it would break ABI. Signed-off-by: Sven Wegener <sven.wegener@stealer.net> Acked-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net/ipv4/ipvs/ip_vs_ctl.c')
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 999d884e886..d651bce0549 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -684,8 +684,8 @@ ip_vs_zero_stats(struct ip_vs_stats *stats)
{
spin_lock_bh(&stats->lock);
memset(stats, 0, (char *)&stats->lock - (char *)stats);
- spin_unlock_bh(&stats->lock);
ip_vs_zero_estimator(stats);
+ spin_unlock_bh(&stats->lock);
}
/*