aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 140ebda9640f..35e12d186566 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -441,7 +441,7 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
441 /* 441 /*
442 * Splice_read and readahead add shmem/tmpfs pages into the page cache 442 * Splice_read and readahead add shmem/tmpfs pages into the page cache
443 * before shmem_readpage has a chance to mark them as SwapBacked: they 443 * before shmem_readpage has a chance to mark them as SwapBacked: they
444 * need to go on the active_anon lru below, and mem_cgroup_cache_charge 444 * need to go on the anon lru below, and mem_cgroup_cache_charge
445 * (called in add_to_page_cache) needs to know where they're going too. 445 * (called in add_to_page_cache) needs to know where they're going too.
446 */ 446 */
447 if (mapping_cap_swap_backed(mapping)) 447 if (mapping_cap_swap_backed(mapping))
@@ -452,7 +452,7 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
452 if (page_is_file_cache(page)) 452 if (page_is_file_cache(page))
453 lru_cache_add_file(page); 453 lru_cache_add_file(page);
454 else 454 else
455 lru_cache_add_active_anon(page); 455 lru_cache_add_anon(page);
456 } 456 }
457 return ret; 457 return ret;
458} 458}
@@ -461,9 +461,15 @@ EXPORT_SYMBOL_GPL(add_to_page_cache_lru);
461#ifdef CONFIG_NUMA 461#ifdef CONFIG_NUMA
462struct page *__page_cache_alloc(gfp_t gfp) 462struct page *__page_cache_alloc(gfp_t gfp)
463{ 463{
464 int n;
465 struct page *page;
466
464 if (cpuset_do_page_mem_spread()) { 467 if (cpuset_do_page_mem_spread()) {
465 int n = cpuset_mem_spread_node(); 468 get_mems_allowed();
466 return alloc_pages_exact_node(n, gfp, 0); 469 n = cpuset_mem_spread_node();
470 page = alloc_pages_exact_node(n, gfp, 0);
471 put_mems_allowed();
472 return page;
467 } 473 }
468 return alloc_pages(gfp, 0); 474 return alloc_pages(gfp, 0);
469} 475}
@@ -1099,6 +1105,12 @@ page_not_up_to_date_locked:
1099 } 1105 }
1100 1106
1101readpage: 1107readpage:
1108 /*
1109 * A previous I/O error may have been due to temporary
1110 * failures, eg. multipath errors.
1111 * PG_error will be set again if readpage fails.
1112 */
1113 ClearPageError(page);
1102 /* Start the actual read. The read will unlock the page. */ 1114 /* Start the actual read. The read will unlock the page. */
1103 error = mapping->a_ops->readpage(filp, page); 1115 error = mapping->a_ops->readpage(filp, page);
1104 1116