forked from luck/tmp_suning_uos_patched
mm: filemap: pass __GFP_WRITE from grab_cache_page_write_begin()
Tell the page allocator that pages allocated through grab_cache_page_write_begin() are expected to become dirty soon. Signed-off-by: Johannes Weiner <jweiner@redhat.com> Reviewed-by: Rik van Riel <riel@redhat.com> Acked-by: Mel Gorman <mgorman@suse.de> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Jan Kara <jack@suse.cz> Cc: Shaohua Li <shaohua.li@intel.com> Cc: Chris Mason <chris.mason@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
a756cf5908
commit
0faa70cb01
|
@ -2351,8 +2351,11 @@ struct page *grab_cache_page_write_begin(struct address_space *mapping,
|
||||||
pgoff_t index, unsigned flags)
|
pgoff_t index, unsigned flags)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
gfp_t gfp_mask;
|
||||||
struct page *page;
|
struct page *page;
|
||||||
gfp_t gfp_notmask = 0;
|
gfp_t gfp_notmask = 0;
|
||||||
|
|
||||||
|
gfp_mask = mapping_gfp_mask(mapping) | __GFP_WRITE;
|
||||||
if (flags & AOP_FLAG_NOFS)
|
if (flags & AOP_FLAG_NOFS)
|
||||||
gfp_notmask = __GFP_FS;
|
gfp_notmask = __GFP_FS;
|
||||||
repeat:
|
repeat:
|
||||||
|
@ -2360,7 +2363,7 @@ struct page *grab_cache_page_write_begin(struct address_space *mapping,
|
||||||
if (page)
|
if (page)
|
||||||
goto found;
|
goto found;
|
||||||
|
|
||||||
page = __page_cache_alloc(mapping_gfp_mask(mapping) & ~gfp_notmask);
|
page = __page_cache_alloc(gfp_mask & ~gfp_notmask);
|
||||||
if (!page)
|
if (!page)
|
||||||
return NULL;
|
return NULL;
|
||||||
status = add_to_page_cache_lru(page, mapping, index,
|
status = add_to_page_cache_lru(page, mapping, index,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user