}
EXPORT_SYMBOL_GPL(file_ra_state_init);
-static void read_pages(struct readahead_control *rac, bool skip_page)
+static void read_pages(struct readahead_control *rac)
{
const struct address_space_operations *aops = rac->mapping->a_ops;
struct page *page;
struct blk_plug plug;
if (!readahead_count(rac))
- goto out;
+ return;
blk_start_plug(&plug);
blk_finish_plug(&plug);
BUG_ON(readahead_count(rac));
-
-out:
- if (skip_page)
- rac->_index++;
}
/**
* have a stable reference to this page, and it's
* not worth getting one just for that.
*/
- read_pages(ractl, true);
+ read_pages(ractl);
+ ractl->_index++;
i = ractl->_index + ractl->_nr_pages - index - 1;
continue;
}
if (filemap_add_folio(mapping, folio, index + i,
gfp_mask) < 0) {
folio_put(folio);
- read_pages(ractl, true);
+ read_pages(ractl);
+ ractl->_index++;
i = ractl->_index + ractl->_nr_pages - index - 1;
continue;
}
* uptodate then the caller will launch readpage again, and
* will then handle the error.
*/
- read_pages(ractl, false);
+ read_pages(ractl);
filemap_invalidate_unlock_shared(mapping);
memalloc_nofs_restore(nofs);
}
ra->async_size += index - limit - 1;
}
- read_pages(ractl, false);
+ read_pages(ractl);
/*
* If there were already pages in the page cache, then we may have