MCPcopy Create free account
hub / github.com/XTXMarkets/ternfs / timeout_sockets

Function timeout_sockets

kmod/block.c:421–436  ·  view source on GitHub ↗

Call periodically to check for inactive ones and schedules work on them to potentially time them out

Source from the content-addressed store, hash-verified

419
420// Call periodically to check for inactive ones and schedules work on them to potentially time them out
421static void timeout_sockets(struct block_ops* ops) {
422 int bucket;
423 struct block_socket* sock;
424 u64 now = get_jiffies_64();
425
426 rcu_read_lock();
427 hash_for_each_rcu(ops->sockets, bucket, sock, hnode) {
428 if (block_socket_check_timeout(sock, now, *ops->timeout_jiffies)) {
429 // We can't clean up here as timing out involves removing from hash and needs
430 // synchronization through rcu_synchronize
431 block_socket_hold(sock);
432 queue_work_or_put(sock);
433 }
434 }
435 rcu_read_unlock();
436}
437
438// check if socket needs cleanup due to error or timeout
439// returns true if socket was cleaned up or partly cleaned up

Callers 1

do_timeout_socketsFunction · 0.85

Calls 3

block_socket_holdFunction · 0.85
queue_work_or_putFunction · 0.85

Tested by

no test coverage detected