Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58987
b: refs/heads/master
c: 8e5105a
h: refs/heads/master
i:
  58985: 50eac4b
  58983: ece0671
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jul 11, 2007
1 parent 242dc4d commit 5aa5efa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 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: 61eb3107cd8e0302f95aae26206e552365daf290
refs/heads/master: 8e5105a0c36a059dfd0f0bb9e73ee7c97d306247
22 changes: 12 additions & 10 deletions trunk/net/netfilter/nf_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,12 +965,14 @@ void nf_conntrack_cleanup(void)
nf_conntrack_helper_fini();
}

static struct list_head *alloc_hashtable(int size, int *vmalloced)
static struct list_head *alloc_hashtable(int *sizep, int *vmalloced)
{
struct list_head *hash;
unsigned int i;
unsigned int size, i;

*vmalloced = 0;

size = *sizep = roundup(*sizep, PAGE_SIZE / sizeof(struct list_head));
hash = (void*)__get_free_pages(GFP_KERNEL,
get_order(sizeof(struct list_head)
* size));
Expand Down Expand Up @@ -1003,7 +1005,7 @@ int set_hashsize(const char *val, struct kernel_param *kp)
if (!hashsize)
return -EINVAL;

hash = alloc_hashtable(hashsize, &vmalloced);
hash = alloc_hashtable(&hashsize, &vmalloced);
if (!hash)
return -ENOMEM;

Expand Down Expand Up @@ -1053,19 +1055,19 @@ int __init nf_conntrack_init(void)
if (nf_conntrack_htable_size < 16)
nf_conntrack_htable_size = 16;
}
nf_conntrack_max = 8 * nf_conntrack_htable_size;

printk("nf_conntrack version %s (%u buckets, %d max)\n",
NF_CONNTRACK_VERSION, nf_conntrack_htable_size,
nf_conntrack_max);

nf_conntrack_hash = alloc_hashtable(nf_conntrack_htable_size,
nf_conntrack_hash = alloc_hashtable(&nf_conntrack_htable_size,
&nf_conntrack_vmalloc);
if (!nf_conntrack_hash) {
printk(KERN_ERR "Unable to create nf_conntrack_hash\n");
goto err_out;
}

nf_conntrack_max = 8 * nf_conntrack_htable_size;

printk("nf_conntrack version %s (%u buckets, %d max)\n",
NF_CONNTRACK_VERSION, nf_conntrack_htable_size,
nf_conntrack_max);

nf_conntrack_cachep = kmem_cache_create("nf_conntrack",
sizeof(struct nf_conn),
0, 0, NULL, NULL);
Expand Down

0 comments on commit 5aa5efa

Please sign in to comment.