-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INET]: Move the TCP hashtable functions/structs to inet_hashtables.[ch]
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Arnaldo Carvalho de Melo
authored and
David S. Miller
committed
Aug 29, 2005
1 parent
0f7ff92
commit 77d8bf9
Showing
6 changed files
with
181 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* INET An implementation of the TCP/IP protocol suite for the LINUX | ||
* operating system. INET is implemented using the BSD Socket | ||
* interface as the means of communication with the user level. | ||
* | ||
* Generic INET transport hashtables | ||
* | ||
* Authors: Lotsa people, from code originally in tcp | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version | ||
* 2 of the License, or (at your option) any later version. | ||
*/ | ||
|
||
#include <linux/config.h> | ||
#include <linux/slab.h> | ||
|
||
#include <net/inet_hashtables.h> | ||
|
||
/* | ||
* Allocate and initialize a new local port bind bucket. | ||
* The bindhash mutex for snum's hash chain must be held here. | ||
*/ | ||
struct inet_bind_bucket *inet_bind_bucket_create(kmem_cache_t *cachep, | ||
struct inet_bind_hashbucket *head, | ||
const unsigned short snum) | ||
{ | ||
struct inet_bind_bucket *tb = kmem_cache_alloc(cachep, SLAB_ATOMIC); | ||
|
||
if (tb != NULL) { | ||
tb->port = snum; | ||
tb->fastreuse = 0; | ||
INIT_HLIST_HEAD(&tb->owners); | ||
hlist_add_head(&tb->node, &head->chain); | ||
} | ||
return tb; | ||
} | ||
|
||
EXPORT_SYMBOL(inet_bind_bucket_create); | ||
|
||
/* | ||
* Caller must hold hashbucket lock for this tb with local BH disabled | ||
*/ | ||
void inet_bind_bucket_destroy(kmem_cache_t *cachep, struct inet_bind_bucket *tb) | ||
{ | ||
if (hlist_empty(&tb->owners)) { | ||
__hlist_del(&tb->node); | ||
kmem_cache_free(cachep, tb); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters