/* Chunk the readahead into 2 megabyte units, so that we don't pin too much memory at once.  */
int force_page_cache_readahead(struct address_space *mapping, struct file *filp, pgoff_t offset, unsigned long nr_to_read)
/* Chunk the readahead into 2 megabyte units, so that we don't pin too much memory at once.  */
int force_page_cache_readahead(struct address_space *mapping, struct file *filp, pgoff_t offset, unsigned long nr_to_read)
{
	int ret = 0;
	if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages))
		return -EINVAL;
	nr_to_read = max_sane_readahead(nr_to_read);
	while (nr_to_read) {
		int err;
		unsigned long this_chunk = (2 * 1024 * 1024) / PAGE_CACHE_SIZE;
		if (this_chunk > nr_to_read)
			this_chunk = nr_to_read;
		err = __do_page_cache_readahead(mapping, filp,
						offset, this_chunk, 0);
		if (err < 0) {
			ret = err;
			break;
		}
		ret += err;
		offset += this_chunk;
		nr_to_read -= this_chunk;
	}
	return ret;
}