diff options
author | Julian Anastasov <ja@ssi.bg> | 2013-03-22 05:46:38 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-04-01 18:23:48 -0400 |
commit | fca9c20ae1e510525f8a2aaa25861789fd721193 (patch) | |
tree | 810ace8990d277c3dbad6632919b605c85ad316e /include/net/ip_vs.h | |
parent | 6b6df46663e7aa6f7b1d82435a3488f9b81316b3 (diff) |
ipvs: add ip_vs_dest_hold and ip_vs_dest_put
ip_vs_dest_hold will be used under RCU lock
while ip_vs_dest_put can be called even after dest
is removed from service, as it happens for conns and
some schedulers.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r-- | include/net/ip_vs.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index d91385c1b3a2..7d3027f2c06e 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -1427,6 +1427,16 @@ ip_vs_find_dest(struct net *net, int af, const union nf_inet_addr *daddr, | |||
1427 | __u16 protocol, __u32 fwmark, __u32 flags); | 1427 | __u16 protocol, __u32 fwmark, __u32 flags); |
1428 | extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); | 1428 | extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); |
1429 | 1429 | ||
1430 | static inline void ip_vs_dest_hold(struct ip_vs_dest *dest) | ||
1431 | { | ||
1432 | atomic_inc(&dest->refcnt); | ||
1433 | } | ||
1434 | |||
1435 | static inline void ip_vs_dest_put(struct ip_vs_dest *dest) | ||
1436 | { | ||
1437 | smp_mb__before_atomic_dec(); | ||
1438 | atomic_dec(&dest->refcnt); | ||
1439 | } | ||
1430 | 1440 | ||
1431 | /* | 1441 | /* |
1432 | * IPVS sync daemon data and function prototypes | 1442 | * IPVS sync daemon data and function prototypes |