|
@@ -421,6 +421,16 @@ ondemand_readahead(struct address_space *mapping,
|
|
|
ra->async_size = ra->size > req_size ? ra->size - req_size : ra->size;
|
|
|
|
|
|
readit:
|
|
|
+ /*
|
|
|
+ * Will this read hit the readahead marker made by itself?
|
|
|
+ * If so, trigger the readahead marker hit now, and merge
|
|
|
+ * the resulted next readahead window into the current one.
|
|
|
+ */
|
|
|
+ if (offset == ra->start && ra->size == ra->async_size) {
|
|
|
+ ra->async_size = get_next_ra_size(ra, max);
|
|
|
+ ra->size += ra->async_size;
|
|
|
+ }
|
|
|
+
|
|
|
return ra_submit(ra, mapping, filp);
|
|
|
}
|
|
|
|