309 }
310 discovery = (discovery_t *) hashbin_get_next(log);
311 }
312
313 spin_unlock_irqrestore(&log->hb_spinlock, flags);
314
315
316 *pn = i;
317 return(buffer);
318}
319
320#ifdef CONFIG_PROC_FS
321static inline discovery_t *discovery_seq_idx(loff_t pos)
322
323{
324 discovery_t *discovery;
325
326 for (discovery = (discovery_t *) hashbin_get_first(irlmp->cachelog);
327 discovery != NULL;
328 discovery = (discovery_t *) hashbin_get_next(irlmp->cachelog)) {
329 if (pos-- == 0)
330 break;
331 }
332
333 return discovery;
334}
335
336static void *discovery_seq_start(struct seq_file *seq, loff_t *pos)
337{
338 spin_lock_irq(&irlmp->cachelog->hb_spinlock);
339 return *pos ? discovery_seq_idx(*pos - 1) : SEQ_START_TOKEN;
340}
341
342static void *discovery_seq_next(struct seq_file *seq, void *v, loff_t *pos)
343{
344 ++*pos;
345 return (v == SEQ_START_TOKEN)
346 ? (void *) hashbin_get_first(irlmp->cachelog)
347 : (void *) hashbin_get_next(irlmp->cachelog);
348}
349