* Function responsible for updating the time of the next calllout * w.r.t. new temporal routes insertion. * * Called by the routing code upon adding new temporal route * to the tree. RIB_WLOCK must be held. */
| 123 | * to the tree. RIB_WLOCK must be held. |
| 124 | */ |
| 125 | void |
| 126 | tmproutes_update(struct rib_head *rnh, struct rtentry *rt) |
| 127 | { |
| 128 | int seconds; |
| 129 | |
| 130 | RIB_WLOCK_ASSERT(rnh); |
| 131 | |
| 132 | if (rnh->next_expire == 0 || rnh->next_expire > rt->rt_expire) { |
| 133 | /* |
| 134 | * Callback is not scheduled, is executing, |
| 135 | * or is scheduled for a later time than we need. |
| 136 | * |
| 137 | * Schedule the one for the current @rt expiration time. |
| 138 | */ |
| 139 | seconds = (rt->rt_expire - time_uptime); |
| 140 | if (seconds < 0) |
| 141 | seconds = 0; |
| 142 | callout_reset_sbt(&rnh->expire_callout, SBT_1S * seconds, |
| 143 | SBT_1MS * 500, expire_callout, rnh, 0); |
| 144 | |
| 145 | rnh->next_expire = rt->rt_expire; |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | void |
| 150 | tmproutes_init(struct rib_head *rh) |
no outgoing calls
no test coverage detected