/* Hides the details of the LRU cache etc from the filesystems.  */
int read_cache_pages(struct address_space *mapping, struct list_head *pages, int(*filler)(void *, struct page *), void *data)
/* Hides the details of the LRU cache etc from the filesystems.  */
int read_cache_pages(struct address_space *mapping, struct list_head *pages, int(*filler)(void *, struct page *), void *data)
{
	struct page *page;
	int ret = 0;
	while (!list_empty(pages)) {
		page = list_to_page(pages);
		list_del(&page->lru);
		if (add_to_page_cache_lru(page, mapping,
					page->index, GFP_KERNEL)) {
			read_cache_pages_invalidate_page(mapping, page);
			continue;
		}
		page_cache_release(page);
		ret = filler(data, page);
		if (unlikely(ret)) {
			read_cache_pages_invalidate_pages(mapping, pages);
			break;
		}
		task_io_account_read(PAGE_CACHE_SIZE);
	}
	return ret;
}