diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/filemap.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index bd8543c6508f..673e4581a2e5 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -1046,8 +1046,7 @@ EXPORT_SYMBOL(find_lock_entry); | |||
1046 | * @mapping: the address_space to search | 1046 | * @mapping: the address_space to search |
1047 | * @offset: the page index | 1047 | * @offset: the page index |
1048 | * @fgp_flags: PCG flags | 1048 | * @fgp_flags: PCG flags |
1049 | * @cache_gfp_mask: gfp mask to use for the page cache data page allocation | 1049 | * @gfp_mask: gfp mask to use for the page cache data page allocation |
1050 | * @radix_gfp_mask: gfp mask to use for radix tree node allocation | ||
1051 | * | 1050 | * |
1052 | * Looks up the page cache slot at @mapping & @offset. | 1051 | * Looks up the page cache slot at @mapping & @offset. |
1053 | * | 1052 | * |
@@ -1056,11 +1055,9 @@ EXPORT_SYMBOL(find_lock_entry); | |||
1056 | * FGP_ACCESSED: the page will be marked accessed | 1055 | * FGP_ACCESSED: the page will be marked accessed |
1057 | * FGP_LOCK: Page is return locked | 1056 | * FGP_LOCK: Page is return locked |
1058 | * FGP_CREAT: If page is not present then a new page is allocated using | 1057 | * FGP_CREAT: If page is not present then a new page is allocated using |
1059 | * @cache_gfp_mask and added to the page cache and the VM's LRU | 1058 | * @gfp_mask and added to the page cache and the VM's LRU |
1060 | * list. If radix tree nodes are allocated during page cache | 1059 | * list. The page is returned locked and with an increased |
1061 | * insertion then @radix_gfp_mask is used. The page is returned | 1060 | * refcount. Otherwise, %NULL is returned. |
1062 | * locked and with an increased refcount. Otherwise, %NULL is | ||
1063 | * returned. | ||
1064 | * | 1061 | * |
1065 | * If FGP_LOCK or FGP_CREAT are specified then the function may sleep even | 1062 | * If FGP_LOCK or FGP_CREAT are specified then the function may sleep even |
1066 | * if the GFP flags specified for FGP_CREAT are atomic. | 1063 | * if the GFP flags specified for FGP_CREAT are atomic. |
@@ -1068,7 +1065,7 @@ EXPORT_SYMBOL(find_lock_entry); | |||
1068 | * If there is a page cache page, it is returned with an increased refcount. | 1065 | * If there is a page cache page, it is returned with an increased refcount. |
1069 | */ | 1066 | */ |
1070 | struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset, | 1067 | struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset, |
1071 | int fgp_flags, gfp_t cache_gfp_mask, gfp_t radix_gfp_mask) | 1068 | int fgp_flags, gfp_t gfp_mask) |
1072 | { | 1069 | { |
1073 | struct page *page; | 1070 | struct page *page; |
1074 | 1071 | ||
@@ -1105,13 +1102,11 @@ no_page: | |||
1105 | if (!page && (fgp_flags & FGP_CREAT)) { | 1102 | if (!page && (fgp_flags & FGP_CREAT)) { |
1106 | int err; | 1103 | int err; |
1107 | if ((fgp_flags & FGP_WRITE) && mapping_cap_account_dirty(mapping)) | 1104 | if ((fgp_flags & FGP_WRITE) && mapping_cap_account_dirty(mapping)) |
1108 | cache_gfp_mask |= __GFP_WRITE; | 1105 | gfp_mask |= __GFP_WRITE; |
1109 | if (fgp_flags & FGP_NOFS) { | 1106 | if (fgp_flags & FGP_NOFS) |
1110 | cache_gfp_mask &= ~__GFP_FS; | 1107 | gfp_mask &= ~__GFP_FS; |
1111 | radix_gfp_mask &= ~__GFP_FS; | ||
1112 | } | ||
1113 | 1108 | ||
1114 | page = __page_cache_alloc(cache_gfp_mask); | 1109 | page = __page_cache_alloc(gfp_mask); |
1115 | if (!page) | 1110 | if (!page) |
1116 | return NULL; | 1111 | return NULL; |
1117 | 1112 | ||
@@ -1122,7 +1117,8 @@ no_page: | |||
1122 | if (fgp_flags & FGP_ACCESSED) | 1117 | if (fgp_flags & FGP_ACCESSED) |
1123 | __SetPageReferenced(page); | 1118 | __SetPageReferenced(page); |
1124 | 1119 | ||
1125 | err = add_to_page_cache_lru(page, mapping, offset, radix_gfp_mask); | 1120 | err = add_to_page_cache_lru(page, mapping, offset, |
1121 | gfp_mask & GFP_RECLAIM_MASK); | ||
1126 | if (unlikely(err)) { | 1122 | if (unlikely(err)) { |
1127 | page_cache_release(page); | 1123 | page_cache_release(page); |
1128 | page = NULL; | 1124 | page = NULL; |
@@ -2443,8 +2439,7 @@ struct page *grab_cache_page_write_begin(struct address_space *mapping, | |||
2443 | fgp_flags |= FGP_NOFS; | 2439 | fgp_flags |= FGP_NOFS; |
2444 | 2440 | ||
2445 | page = pagecache_get_page(mapping, index, fgp_flags, | 2441 | page = pagecache_get_page(mapping, index, fgp_flags, |
2446 | mapping_gfp_mask(mapping), | 2442 | mapping_gfp_mask(mapping)); |
2447 | GFP_KERNEL); | ||
2448 | if (page) | 2443 | if (page) |
2449 | wait_for_stable_page(page); | 2444 | wait_for_stable_page(page); |
2450 | 2445 | ||