Call periodically to check for inactive ones and schedules work on them to potentially time them out
| 419 | |
| 420 | // Call periodically to check for inactive ones and schedules work on them to potentially time them out |
| 421 | static 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 |
no test coverage detected