1760static const struct file_operations ipmr_vif_fops = {
1761 .owner = THIS_MODULE,
1762 .open = ipmr_vif_open,
1763 .read = seq_read,
1764 .llseek = seq_lseek,
1765 .release = seq_release_private,
1766};
1767
1768struct ipmr_mfc_iter {
1769 struct mfc_cache **cache;
1770 int ct;
1771};
1772
1773
1774static struct mfc_cache *ipmr_mfc_seq_idx(struct ipmr_mfc_iter *it, loff_t pos)
1775{
1776 struct mfc_cache *mfc;
1777
1778 it->cache = mfc_cache_array;
1779 read_lock(&mrt_lock);
1780 for (it->ct = 0; it->ct < MFC_LINES; it->ct++)
1781 for (mfc = mfc_cache_array[it->ct]; mfc; mfc = mfc->next)
1782 if (pos-- == 0)
1783 return mfc;
1784 read_unlock(&mrt_lock);
1785
1786 it->cache = &mfc_unres_queue;
1787 spin_lock_bh(&mfc_unres_lock);
1788 for (mfc = mfc_unres_queue; mfc; mfc = mfc->next)
1789 if (pos-- == 0)
1790 return mfc;
1791 spin_unlock_bh(&mfc_unres_lock);
1792
1793 it->cache = NULL;
1794 return NULL;
1795}
1796
1797
1798static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos)
1799{
1800 struct ipmr_mfc_iter *it = seq->private;