aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/lib/loss_interval.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-11-28 08:15:40 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:55:11 -0500
commit276f2edc52e309b38a216245952e05880e182c83 (patch)
tree3f581eb831a6f7f16ab30bd0f8e8d80b5b97fe50 /net/dccp/ccids/lib/loss_interval.c
parentea4f76ae13b4240dac304ed50636391d6b22e9c5 (diff)
[TFRC]: Migrate TX history to singly-linked lis
This patch was based on another made by Gerrit Renker, his changelog was: ------------------------------------------------------ The patch set migrates TFRC TX history to a singly-linked list. The details are: * use of a consistent naming scheme (all TFRC functions now begin with `tfrc_'); * allocation and cleanup are taken care of internally; * provision of a lookup function, which is used by the CCID TX infrastructure to determine the time a packet was sent (in turn used for RTT sampling); * integration of the new interface with the present use in CCID3. ------------------------------------------------------ Simplifications I did: . removing the tfrc_tx_hist_head that had a pointer to the list head and another for the slabcache. . No need for creating a slabcache for each CCID that wants to use the TFRC tx history routines, create a single slabcache when the dccp_tfrc_lib module init routine is called. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccids/lib/loss_interval.c')
-rw-r--r--net/dccp/ccids/lib/loss_interval.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c
index d26b88dbbb45..f2ca4eb74ddb 100644
--- a/net/dccp/ccids/lib/loss_interval.c
+++ b/net/dccp/ccids/lib/loss_interval.c
@@ -277,7 +277,7 @@ void dccp_li_update_li(struct sock *sk,
277 277
278EXPORT_SYMBOL_GPL(dccp_li_update_li); 278EXPORT_SYMBOL_GPL(dccp_li_update_li);
279 279
280static __init int dccp_li_init(void) 280int __init dccp_li_init(void)
281{ 281{
282 dccp_li_cachep = kmem_cache_create("dccp_li_hist", 282 dccp_li_cachep = kmem_cache_create("dccp_li_hist",
283 sizeof(struct dccp_li_hist_entry), 283 sizeof(struct dccp_li_hist_entry),
@@ -285,10 +285,10 @@ static __init int dccp_li_init(void)
285 return dccp_li_cachep == NULL ? -ENOBUFS : 0; 285 return dccp_li_cachep == NULL ? -ENOBUFS : 0;
286} 286}
287 287
288static __exit void dccp_li_exit(void) 288void dccp_li_exit(void)
289{ 289{
290 kmem_cache_destroy(dccp_li_cachep); 290 if (dccp_li_cachep != NULL) {
291 kmem_cache_destroy(dccp_li_cachep);
292 dccp_li_cachep = NULL;
293 }
291} 294}
292
293module_init(dccp_li_init);
294module_exit(dccp_li_exit);