12 #include <linux/module.h>
13 #include <linux/net.h>
15 #include <linux/slab.h>
24 static unsigned long rxrpc_transport_timeout = 3600 * 24;
42 INIT_LIST_HEAD(&trans->
link);
53 switch (peer->
srx.transport_type) {
79 const char *
new =
"old";
82 _enter(
"{%pI4+%hu},{%pI4+%hu},",
83 &local->
srx.transport.sin.sin_addr,
84 ntohs(local->
srx.transport.sin.sin_port),
85 &peer->
srx.transport.sin.sin_addr,
86 ntohs(peer->
srx.transport.sin.sin_port));
91 if (trans->
local == local && trans->
peer == peer)
92 goto found_extant_transport;
98 candidate = rxrpc_alloc_transport(local, peer, gfp);
107 if (trans->
local == local && trans->
peer == peer)
108 goto found_extant_second;
123 _net(
"TRANSPORT %s %d local %d -> peer %d",
126 trans->
local->debug_id,
127 trans->
peer->debug_id);
129 _leave(
" = %p {u=%d}", trans, usage);
133 found_extant_transport:
154 _enter(
"{%pI4+%hu},{%pI4+%hu},",
155 &local->
srx.transport.sin.sin_addr,
156 ntohs(local->
srx.transport.sin.sin_port),
157 &peer->
srx.transport.sin.sin_addr,
158 ntohs(peer->
srx.transport.sin.sin_port));
164 if (trans->
local == local && trans->
peer == peer)
165 goto found_extant_transport;
172 found_extant_transport:
219 unsigned long now, earliest, reap_time;
231 _debug(
"reap TRANS %d { u=%d t=%ld }",
233 (
long) now - (
long) trans->
put_time);
238 reap_time = trans->
put_time + rxrpc_transport_timeout;
239 if (reap_time <= now)
240 list_move_tail(&trans->
link, &graveyard);
241 else if (reap_time < earliest)
242 earliest = reap_time;
247 _debug(
"reschedule reaper %ld", (
long) earliest - now);
250 (earliest - now) *
HZ);
254 while (!list_empty(&graveyard)) {
257 list_del_init(&trans->
link);
260 rxrpc_cleanup_transport(trans);
274 rxrpc_transport_timeout = 0;