# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1183 -> 1.1184 # net/ipv4/ipvs/ip_vs_ctl.c 1.1 -> 1.2 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/10/13 wensong@xxxxxxxxxxxx 1.1184 # [IPVS] Fix to set the statistics of dest zero when bound to a new service # -------------------------------------------- # diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c --- a/net/ipv4/ipvs/ip_vs_ctl.c Mon Oct 13 23:45:27 2003 +++ b/net/ipv4/ipvs/ip_vs_ctl.c Mon Oct 13 23:45:27 2003 @@ -653,6 +653,15 @@ } +static inline void +__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); +} + /* * Update a destination in the given service */ @@ -699,6 +708,7 @@ } else { if (dest->svc != svc) { __ip_vs_unbind_svc(dest); + __ip_vs_zero_stats(&dest->stats); __ip_vs_bind_svc(dest, svc); } } @@ -1282,15 +1292,6 @@ /* * Zero counters in a service or all services */ -static inline void -__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); -} - static int ip_vs_zero_service(struct ip_vs_service *svc) { struct list_head *l;