sctp: drop the old assoc hashtable of sctp
transport hashtable will replace the association hashtable, so association hashtable is not used in sctp any more, so drop the codes about that. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
39f66a7dce
commit
b5eff71283
@@ -1416,24 +1416,6 @@ static __init int sctp_init(void)
|
||||
for (order = 0; (1UL << order) < goal; order++)
|
||||
;
|
||||
|
||||
do {
|
||||
sctp_assoc_hashsize = (1UL << order) * PAGE_SIZE /
|
||||
sizeof(struct sctp_hashbucket);
|
||||
if ((sctp_assoc_hashsize > (64 * 1024)) && order > 0)
|
||||
continue;
|
||||
sctp_assoc_hashtable = (struct sctp_hashbucket *)
|
||||
__get_free_pages(GFP_KERNEL | __GFP_NOWARN, order);
|
||||
} while (!sctp_assoc_hashtable && --order > 0);
|
||||
if (!sctp_assoc_hashtable) {
|
||||
pr_err("Failed association hash alloc\n");
|
||||
status = -ENOMEM;
|
||||
goto err_ahash_alloc;
|
||||
}
|
||||
for (i = 0; i < sctp_assoc_hashsize; i++) {
|
||||
rwlock_init(&sctp_assoc_hashtable[i].lock);
|
||||
INIT_HLIST_HEAD(&sctp_assoc_hashtable[i].chain);
|
||||
}
|
||||
|
||||
/* Allocate and initialize the endpoint hash table. */
|
||||
sctp_ep_hashsize = 64;
|
||||
sctp_ep_hashtable =
|
||||
@@ -1470,8 +1452,7 @@ static __init int sctp_init(void)
|
||||
if (sctp_transport_hashtable_init())
|
||||
goto err_thash_alloc;
|
||||
|
||||
pr_info("Hash tables configured (established %d bind %d)\n",
|
||||
sctp_assoc_hashsize, sctp_port_hashsize);
|
||||
pr_info("Hash tables configured (bind %d)\n", sctp_port_hashsize);
|
||||
|
||||
sctp_sysctl_register();
|
||||
|
||||
@@ -1528,10 +1509,6 @@ err_bhash_alloc:
|
||||
err_thash_alloc:
|
||||
kfree(sctp_ep_hashtable);
|
||||
err_ehash_alloc:
|
||||
free_pages((unsigned long)sctp_assoc_hashtable,
|
||||
get_order(sctp_assoc_hashsize *
|
||||
sizeof(struct sctp_hashbucket)));
|
||||
err_ahash_alloc:
|
||||
percpu_counter_destroy(&sctp_sockets_allocated);
|
||||
err_percpu_counter_init:
|
||||
kmem_cache_destroy(sctp_chunk_cachep);
|
||||
@@ -1565,13 +1542,10 @@ static __exit void sctp_exit(void)
|
||||
|
||||
sctp_sysctl_unregister();
|
||||
|
||||
free_pages((unsigned long)sctp_assoc_hashtable,
|
||||
get_order(sctp_assoc_hashsize *
|
||||
sizeof(struct sctp_hashbucket)));
|
||||
kfree(sctp_ep_hashtable);
|
||||
free_pages((unsigned long)sctp_port_hashtable,
|
||||
get_order(sctp_port_hashsize *
|
||||
sizeof(struct sctp_bind_hashbucket)));
|
||||
kfree(sctp_ep_hashtable);
|
||||
sctp_transport_hashtable_destroy();
|
||||
|
||||
percpu_counter_destroy(&sctp_sockets_allocated);
|
||||
|
Reference in New Issue
Block a user