Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40260
b: refs/heads/master
c: 2fab22f
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Oct 24, 2006
1 parent 9232015 commit 7476278
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 82571026b9771c4035b0c62abbbe588fe73373ea
refs/heads/master: 2fab22f2d3290ff7c602fe62f22e825c48e97a06
18 changes: 10 additions & 8 deletions trunk/net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,14 @@ __xfrm_state_locate(struct xfrm_state *x, int use_spi, int family)
x->id.proto, family);
}

static void xfrm_hash_grow_check(int have_hash_collision)
{
if (have_hash_collision &&
(xfrm_state_hmask + 1) < xfrm_state_hashmax &&
xfrm_state_num > xfrm_state_hmask)
schedule_work(&xfrm_hash_work);
}

struct xfrm_state *
xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
struct flowi *fl, struct xfrm_tmpl *tmpl,
Expand Down Expand Up @@ -598,6 +606,8 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
x->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES;
x->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ;
add_timer(&x->timer);
xfrm_state_num++;
xfrm_hash_grow_check(x->bydst.next != NULL);
} else {
x->km.state = XFRM_STATE_DEAD;
xfrm_state_put(x);
Expand All @@ -614,14 +624,6 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
return x;
}

static void xfrm_hash_grow_check(int have_hash_collision)
{
if (have_hash_collision &&
(xfrm_state_hmask + 1) < xfrm_state_hashmax &&
xfrm_state_num > xfrm_state_hmask)
schedule_work(&xfrm_hash_work);
}

static void __xfrm_state_insert(struct xfrm_state *x)
{
unsigned int h;
Expand Down

0 comments on commit 7476278

Please sign in to comment.