[TFRC]: Provide central source file and debug facility
This patch changes the tfrc_lib module in the following manner: (1) a dedicated tfrc source file to call the packet history & loss interval init/exit functions. (2) a dedicated tfrc_pr_debug macro with toggle switch `tfrc_debug'. Commiter note: renamed tfrc_module.c to tfrc.c, and made CONFIG_IP_DCCP_CCID3 select IP_DCCP_TFRC_LIB. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
f8b33fdfaf
commit
c40616c597
@ -35,7 +35,6 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/string.h>
|
||||
#include "packet_history.h"
|
||||
|
||||
@ -277,39 +276,19 @@ void dccp_rx_hist_purge(struct dccp_rx_hist *hist, struct list_head *list)
|
||||
|
||||
EXPORT_SYMBOL_GPL(dccp_rx_hist_purge);
|
||||
|
||||
extern int __init dccp_li_init(void);
|
||||
extern void dccp_li_exit(void);
|
||||
|
||||
static __init int packet_history_init(void)
|
||||
__init int packet_history_init(void)
|
||||
{
|
||||
if (dccp_li_init() != 0)
|
||||
goto out;
|
||||
|
||||
tfrc_tx_hist = kmem_cache_create("tfrc_tx_hist",
|
||||
sizeof(struct tfrc_tx_hist_entry), 0,
|
||||
SLAB_HWCACHE_ALIGN, NULL);
|
||||
if (tfrc_tx_hist == NULL)
|
||||
goto out_li_exit;
|
||||
|
||||
return 0;
|
||||
out_li_exit:
|
||||
dccp_li_exit();
|
||||
out:
|
||||
return -ENOBUFS;
|
||||
return tfrc_tx_hist == NULL ? -ENOBUFS : 0;
|
||||
}
|
||||
module_init(packet_history_init);
|
||||
|
||||
static __exit void packet_history_exit(void)
|
||||
void packet_history_exit(void)
|
||||
{
|
||||
if (tfrc_tx_hist != NULL) {
|
||||
kmem_cache_destroy(tfrc_tx_hist);
|
||||
tfrc_tx_hist = NULL;
|
||||
}
|
||||
dccp_li_exit();
|
||||
}
|
||||
module_exit(packet_history_exit);
|
||||
|
||||
MODULE_AUTHOR("Ian McDonald <ian.mcdonald@jandi.co.nz>, "
|
||||
"Arnaldo Carvalho de Melo <acme@ghostprotocols.net>");
|
||||
MODULE_DESCRIPTION("DCCP TFRC library");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
Reference in New Issue
Block a user