diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2010-03-30 21:19:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-01 22:41:34 -0400 |
commit | 34996cb91dd72f0b0456d8fd3fef4aaee62232f2 (patch) | |
tree | 404cfd62ecc437a83ffecdaf86560bbe9e8fdb7e /net/xfrm | |
parent | bd2c77a0a749589b45f2697ea446a4438d078f9b (diff) |
xfrm: Remove xfrm_state_genid
The xfrm state genid only needs to be matched against the copy
saved in xfrm_dst. So we don't need a global genid at all. In
fact, we don't even need to initialise it.
Based on observation by Timo Teräs.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_state.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 17d5b96f2fc8..71f8f33d637b 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -37,7 +37,6 @@ | |||
37 | static DEFINE_SPINLOCK(xfrm_state_lock); | 37 | static DEFINE_SPINLOCK(xfrm_state_lock); |
38 | 38 | ||
39 | static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024; | 39 | static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024; |
40 | static unsigned int xfrm_state_genid; | ||
41 | 40 | ||
42 | static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family); | 41 | static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family); |
43 | static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo); | 42 | static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo); |
@@ -923,8 +922,6 @@ static void __xfrm_state_insert(struct xfrm_state *x) | |||
923 | struct net *net = xs_net(x); | 922 | struct net *net = xs_net(x); |
924 | unsigned int h; | 923 | unsigned int h; |
925 | 924 | ||
926 | x->genid = ++xfrm_state_genid; | ||
927 | |||
928 | list_add(&x->km.all, &net->xfrm.state_all); | 925 | list_add(&x->km.all, &net->xfrm.state_all); |
929 | 926 | ||
930 | h = xfrm_dst_hash(net, &x->id.daddr, &x->props.saddr, | 927 | h = xfrm_dst_hash(net, &x->id.daddr, &x->props.saddr, |
@@ -970,7 +967,7 @@ static void __xfrm_state_bump_genids(struct xfrm_state *xnew) | |||
970 | (mark & x->mark.m) == x->mark.v && | 967 | (mark & x->mark.m) == x->mark.v && |
971 | !xfrm_addr_cmp(&x->id.daddr, &xnew->id.daddr, family) && | 968 | !xfrm_addr_cmp(&x->id.daddr, &xnew->id.daddr, family) && |
972 | !xfrm_addr_cmp(&x->props.saddr, &xnew->props.saddr, family)) | 969 | !xfrm_addr_cmp(&x->props.saddr, &xnew->props.saddr, family)) |
973 | x->genid = xfrm_state_genid; | 970 | x->genid++; |
974 | } | 971 | } |
975 | } | 972 | } |
976 | 973 | ||