469
470}
471
472
473
474
475
476
477#ifdef CONFIG_PROC_FS
478
479static struct rif_cache *rif_get_idx(loff_t pos)
480{
481 int i;
482 struct rif_cache *entry;
483 loff_t off = 0;
484
485 for(i = 0; i < RIF_TABLE_SIZE; i++)
486 for(entry = rif_table[i]; entry; entry = entry->next) {
487 if (off == pos)
488 return entry;
489 ++off;
490 }
491
492 return NULL;
493}
494
495static void *rif_seq_start(struct seq_file *seq, loff_t *pos)
496{
497 spin_lock_irq(&rif_lock);
498
499 return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN;
500}
501
502static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos)
503{
504 int i;
505 struct rif_cache *ent = v;
506
507 ++*pos;
508
509 if (v == SEQ_START_TOKEN) {