> int force_page_cache_readahead(struct address_space *mapping, struct file *filp, > pgoff_t offset, unsigned long nr_to_read) > { > + struct file_ra_state fadvice_ra = { > + .pattern = RA_PATTERN_FADVISE, > + }; > int ret = 0; > > if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages)) > @@ -222,8 +397,9 @@ int force_page_cache_readahead(struct ad > > if (this_chunk > nr_to_read) > this_chunk = nr_to_read; > - err = __do_page_cache_readahead(mapping, filp, > - offset, this_chunk, 0); > + fadvice_ra.start = offset; > + fadvice_ra.size = this_chunk; > + err = ra_submit(&fadvice_ra, mapping, filp, offset, nr_to_read); > if (err < 0) { > ret = err; > break; It looks that we can safely use filp->f_ra: @@ -214,6 +386,7 @@ int force_page_cache_readahead(struct ad if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages)) return -EINVAL; + filp->f_ra.pattern = RA_PATTERN_FADVISE; nr_to_read = max_sane_readahead(nr_to_read); while (nr_to_read) { int err; @@ -222,8 +395,9 @@ int force_page_cache_readahead(struct ad if (this_chunk > nr_to_read) this_chunk = nr_to_read; - err = __do_page_cache_readahead(mapping, filp, - offset, this_chunk, 0); + filp->f_ra.start = offset; + filp->f_ra.size = this_chunk; + err = ra_submit(&filp->f_ra, mapping, filp, offset, nr_to_read); if (err < 0) { ret = err; break; But still, it adds one more function call to the fadvise path. Thanks, Fengguang -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html