btrfs: pass __GFP_WRITE for buffered write page allocations
authorJohannes Weiner <[email protected]>
Tue, 10 Jan 2012 23:07:55 +0000 (15:07 -0800)
committerLinus Torvalds <[email protected]>
Wed, 11 Jan 2012 00:30:44 +0000 (16:30 -0800)
Tell the page allocator that pages allocated for a buffered write are
expected to become dirty soon.

Signed-off-by: Johannes Weiner <[email protected]>
Reviewed-by: Rik van Riel <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Wu Fengguang <[email protected]>
Cc: Dave Chinner <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Shaohua Li <[email protected]>
Cc: Chris Mason <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/btrfs/file.c

index 97fbe939c050dc7d523baeaed960741c053cbf0d..20375e6691c3903597f158c2b36406af9187e9ab 100644 (file)
@@ -1081,7 +1081,7 @@ static noinline int prepare_pages(struct btrfs_root *root, struct file *file,
 again:
        for (i = 0; i < num_pages; i++) {
                pages[i] = find_or_create_page(inode->i_mapping, index + i,
-                                              mask);
+                                              mask | __GFP_WRITE);
                if (!pages[i]) {
                        faili = i - 1;
                        err = -ENOMEM;