diff options
author | Johannes Weiner <jweiner@redhat.com> | 2012-01-10 18:07:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 19:30:43 -0500 |
commit | 0faa70cb0180d45a06208e54b552a538aabb8a30 (patch) | |
tree | 7d734a556ad1568301cf802c5afbaa83cc0bdcd5 /mm/filemap.c | |
parent | a756cf5908530e8b40bdf569eb48b40139e8d7fd (diff) |
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>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index a0701e6eec10..c4ee2e918bea 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2351,8 +2351,11 @@ struct page *grab_cache_page_write_begin(struct address_space *mapping, | |||
2351 | pgoff_t index, unsigned flags) | 2351 | pgoff_t index, unsigned flags) |
2352 | { | 2352 | { |
2353 | int status; | 2353 | int status; |
2354 | gfp_t gfp_mask; | ||
2354 | struct page *page; | 2355 | struct page *page; |
2355 | gfp_t gfp_notmask = 0; | 2356 | gfp_t gfp_notmask = 0; |
2357 | |||
2358 | gfp_mask = mapping_gfp_mask(mapping) | __GFP_WRITE; | ||
2356 | if (flags & AOP_FLAG_NOFS) | 2359 | if (flags & AOP_FLAG_NOFS) |
2357 | gfp_notmask = __GFP_FS; | 2360 | gfp_notmask = __GFP_FS; |
2358 | repeat: | 2361 | repeat: |
@@ -2360,7 +2363,7 @@ repeat: | |||
2360 | if (page) | 2363 | if (page) |
2361 | goto found; | 2364 | goto found; |
2362 | 2365 | ||
2363 | page = __page_cache_alloc(mapping_gfp_mask(mapping) & ~gfp_notmask); | 2366 | page = __page_cache_alloc(gfp_mask & ~gfp_notmask); |
2364 | if (!page) | 2367 | if (!page) |
2365 | return NULL; | 2368 | return NULL; |
2366 | status = add_to_page_cache_lru(page, mapping, index, | 2369 | status = add_to_page_cache_lru(page, mapping, index, |