/* Scan the cache with a timer and see what we need to throw out.  */
static void rif_check_expire(unsigned long dummy)
/* Scan the cache with a timer and see what we need to throw out.  */
static void rif_check_expire(unsigned long dummy)
{
	int i;
	unsigned long flags, next_interval = jiffies + sysctl_tr_rif_timeout/2;
	spin_lock_irqsave(&rif_lock, flags);
	for(i =0; i < RIF_TABLE_SIZE; i++) {
		struct rif_cache *entry, **pentry;
		pentry = rif_table+i;
		while((entry=*pentry) != NULL) {
			unsigned long expires
				= entry->last_used + sysctl_tr_rif_timeout;
			if (time_before_eq(expires, jiffies)) {
				*pentry = entry->next;
				kfree(entry);
			} else {
				pentry = &entry->next;
				if (time_before(expires, next_interval))
					next_interval = expires;
			}
		}
	}
	spin_unlock_irqrestore(&rif_lock, flags);
	mod_timer(&rif_timer, next_interval);
}