diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2007-12-12 09:24:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:57:15 -0500 |
commit | df8f83fdd6369e1ba85f089fd6fe26bb2ddcb36f (patch) | |
tree | 8ddb2e0b70d5ed99837919ada6664e70c876f119 /net/dccp/ccids/lib/tfrc.c | |
parent | 2aaef4e47fef8a6c0bc7fc5d9d3eea4af290e04c (diff) |
[TFRC]: Put RX/TX initialisation into tfrc.c
This separates RX/TX initialisation and puts all packet history / loss intervals
initialisation into tfrc.c.
The organisation is uniform: slab declaration -> {rx,tx}_init() -> {rx,tx}_exit()
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
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/tfrc.c')
-rw-r--r-- | net/dccp/ccids/lib/tfrc.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/net/dccp/ccids/lib/tfrc.c b/net/dccp/ccids/lib/tfrc.c index 3a7a1838a64b..20763fa75d44 100644 --- a/net/dccp/ccids/lib/tfrc.c +++ b/net/dccp/ccids/lib/tfrc.c | |||
@@ -14,27 +14,42 @@ module_param(tfrc_debug, bool, 0444); | |||
14 | MODULE_PARM_DESC(tfrc_debug, "Enable debug messages"); | 14 | MODULE_PARM_DESC(tfrc_debug, "Enable debug messages"); |
15 | #endif | 15 | #endif |
16 | 16 | ||
17 | extern int tfrc_tx_packet_history_init(void); | ||
18 | extern void tfrc_tx_packet_history_exit(void); | ||
19 | extern int tfrc_rx_packet_history_init(void); | ||
20 | extern void tfrc_rx_packet_history_exit(void); | ||
21 | |||
17 | extern int dccp_li_init(void); | 22 | extern int dccp_li_init(void); |
18 | extern void dccp_li_exit(void); | 23 | extern void dccp_li_exit(void); |
19 | extern int packet_history_init(void); | ||
20 | extern void packet_history_exit(void); | ||
21 | 24 | ||
22 | static int __init tfrc_module_init(void) | 25 | static int __init tfrc_module_init(void) |
23 | { | 26 | { |
24 | int rc = dccp_li_init(); | 27 | int rc = dccp_li_init(); |
25 | 28 | ||
26 | if (rc == 0) { | 29 | if (rc) |
27 | rc = packet_history_init(); | 30 | goto out; |
28 | if (rc != 0) | 31 | |
29 | dccp_li_exit(); | 32 | rc = tfrc_tx_packet_history_init(); |
30 | } | 33 | if (rc) |
34 | goto out_free_loss_intervals; | ||
31 | 35 | ||
36 | rc = tfrc_rx_packet_history_init(); | ||
37 | if (rc) | ||
38 | goto out_free_tx_history; | ||
39 | return 0; | ||
40 | |||
41 | out_free_tx_history: | ||
42 | tfrc_tx_packet_history_exit(); | ||
43 | out_free_loss_intervals: | ||
44 | dccp_li_exit(); | ||
45 | out: | ||
32 | return rc; | 46 | return rc; |
33 | } | 47 | } |
34 | 48 | ||
35 | static void __exit tfrc_module_exit(void) | 49 | static void __exit tfrc_module_exit(void) |
36 | { | 50 | { |
37 | packet_history_exit(); | 51 | tfrc_rx_packet_history_exit(); |
52 | tfrc_tx_packet_history_exit(); | ||
38 | dccp_li_exit(); | 53 | dccp_li_exit(); |
39 | } | 54 | } |
40 | 55 | ||