|
@@ -741,7 +741,14 @@ repeat:
|
|
page = __page_cache_alloc(gfp_mask);
|
|
page = __page_cache_alloc(gfp_mask);
|
|
if (!page)
|
|
if (!page)
|
|
return NULL;
|
|
return NULL;
|
|
- err = add_to_page_cache_lru(page, mapping, index, gfp_mask);
|
|
|
|
|
|
+ /*
|
|
|
|
+ * We want a regular kernel memory (not highmem or DMA etc)
|
|
|
|
+ * allocation for the radix tree nodes, but we need to honour
|
|
|
|
+ * the context-specific requirements the caller has asked for.
|
|
|
|
+ * GFP_RECLAIM_MASK collects those requirements.
|
|
|
|
+ */
|
|
|
|
+ err = add_to_page_cache_lru(page, mapping, index,
|
|
|
|
+ (gfp_mask & GFP_RECLAIM_MASK));
|
|
if (unlikely(err)) {
|
|
if (unlikely(err)) {
|
|
page_cache_release(page);
|
|
page_cache_release(page);
|
|
page = NULL;
|
|
page = NULL;
|
|
@@ -950,7 +957,7 @@ grab_cache_page_nowait(struct address_space *mapping, pgoff_t index)
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
page = __page_cache_alloc(mapping_gfp_mask(mapping) & ~__GFP_FS);
|
|
page = __page_cache_alloc(mapping_gfp_mask(mapping) & ~__GFP_FS);
|
|
- if (page && add_to_page_cache_lru(page, mapping, index, GFP_KERNEL)) {
|
|
|
|
|
|
+ if (page && add_to_page_cache_lru(page, mapping, index, GFP_NOFS)) {
|
|
page_cache_release(page);
|
|
page_cache_release(page);
|
|
page = NULL;
|
|
page = NULL;
|
|
}
|
|
}
|