[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>
This commit is contained in:
Arnaldo Carvalho de Melo
2007-11-28 11:15:40 -02:00
committed by David S. Miller
parent ea4f76ae13
commit 276f2edc52
5 changed files with 102 additions and 187 deletions

View File

@@ -277,7 +277,7 @@ void dccp_li_update_li(struct sock *sk,
EXPORT_SYMBOL_GPL(dccp_li_update_li);
static __init int dccp_li_init(void)
int __init dccp_li_init(void)
{
dccp_li_cachep = kmem_cache_create("dccp_li_hist",
sizeof(struct dccp_li_hist_entry),
@@ -285,10 +285,10 @@ static __init int dccp_li_init(void)
return dccp_li_cachep == NULL ? -ENOBUFS : 0;
}
static __exit void dccp_li_exit(void)
void dccp_li_exit(void)
{
kmem_cache_destroy(dccp_li_cachep);
if (dccp_li_cachep != NULL) {
kmem_cache_destroy(dccp_li_cachep);
dccp_li_cachep = NULL;
}
}
module_init(dccp_li_init);
module_exit(dccp_li_exit);