--- b7d860390f34779836aaec1182fdd60c7a71a82f +++ d6387d9376d8ec19baf43fcb91832648b4247363 @@ -484,8 +484,8 @@ out: } EXPORT_SYMBOL(add_to_page_cache_locked); -int add_to_page_cache_lru(struct page *page, struct address_space *mapping, - pgoff_t offset, gfp_t gfp_mask) +int __add_to_page_cache_lru(struct page *page, struct address_space *mapping, + pgoff_t offset, gfp_t gfp_mask, int tail) { int ret; @@ -501,12 +501,18 @@ int add_to_page_cache_lru(struct page *p ret = add_to_page_cache(page, mapping, offset, gfp_mask); if (ret == 0) { if (page_is_file_cache(page)) - lru_cache_add_file(page); + lru_cache_add_file_tail(page, tail); else lru_cache_add_anon(page); } return ret; } + +int add_to_page_cache_lru(struct page *page, struct address_space *mapping, + pgoff_t offset, gfp_t gfp_mask) +{ + return __add_to_page_cache_lru(page, mapping, offset, gfp_mask, 0); +} EXPORT_SYMBOL_GPL(add_to_page_cache_lru); #ifdef CONFIG_NUMA