diff options
author | Julian Anastasov <ja@ssi.bg> | 2013-03-22 11:46:38 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-04-02 00:23:48 +0200 |
commit | fca9c20ae1e510525f8a2aaa25861789fd721193 (patch) | |
tree | 810ace8990d277c3dbad6632919b605c85ad316e /include/net/ip_vs.h | |
parent | 6b6df46663e7aa6f7b1d82435a3488f9b81316b3 (diff) | |
download | linux-fca9c20ae1e510525f8a2aaa25861789fd721193.tar.bz2 |
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, __u16 protocol, __u32 fwmark, __u32 flags); extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); +static inline void ip_vs_dest_hold(struct ip_vs_dest *dest) +{ + atomic_inc(&dest->refcnt); +} + +static inline void ip_vs_dest_put(struct ip_vs_dest *dest) +{ + smp_mb__before_atomic_dec(); + atomic_dec(&dest->refcnt); +} /* * IPVS sync daemon data and function prototypes |