]> rtime.felk.cvut.cz Git - linux-imx.git/blobdiff - mm/readahead.c
[PATCH] AOP_TRUNCATED_PAGE victims in read_pages() belong in the LRU
[linux-imx.git] / mm / readahead.c
index 301b36c4a0ce10a006c651637cb2597040ec1413..4ee52cadab9371f4d22522489b5d4cec1be2125b 100644 (file)
@@ -182,14 +182,11 @@ static int read_pages(struct address_space *mapping, struct file *filp,
                list_del(&page->lru);
                if (!add_to_page_cache(page, mapping,
                                        page->index, GFP_KERNEL)) {
-                       ret = mapping->a_ops->readpage(filp, page);
-                       if (ret != AOP_TRUNCATED_PAGE) {
-                               if (!pagevec_add(&lru_pvec, page))
-                                       __pagevec_lru_add(&lru_pvec);
-                               continue;
-                       } /* else fall through to release */
-               }
-               page_cache_release(page);
+                       mapping->a_ops->readpage(filp, page);
+                       if (!pagevec_add(&lru_pvec, page))
+                               __pagevec_lru_add(&lru_pvec);
+               } else
+                       page_cache_release(page);
        }
        pagevec_lru_add(&lru_pvec);
        ret = 0;
@@ -555,6 +552,7 @@ recheck:
 out:
        return ra->prev_page + 1;
 }
+EXPORT_SYMBOL_GPL(page_cache_readahead);
 
 /*
  * handle_ra_miss() is called when it is known that a page which should have