[Top] [All Lists]

[patch 5/5] Btrfs: pass __GFP_WRITE for buffered write page allocations

To: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Subject: [patch 5/5] Btrfs: pass __GFP_WRITE for buffered write page allocations
From: Johannes Weiner <jweiner@xxxxxxxxxx>
Date: Fri, 30 Sep 2011 09:17:24 +0200
Cc: Mel Gorman <mgorman@xxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, Wu Fengguang <fengguang.wu@xxxxxxxxx>, Jan Kara <jack@xxxxxxx>, Rik van Riel <riel@xxxxxxxxxx>, Minchan Kim <minchan.kim@xxxxxxxxx>, Chris Mason <chris.mason@xxxxxxxxxx>, "Theodore Ts'o" <tytso@xxxxxxx>, Andreas Dilger <adilger.kernel@xxxxxxxxx>, Shaohua Li <shaohua.li@xxxxxxxxx>, xfs@xxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
In-reply-to: <1317367044-475-1-git-send-email-jweiner@xxxxxxxxxx>
References: <1317367044-475-1-git-send-email-jweiner@xxxxxxxxxx>
Tell the page allocator that pages allocated for a buffered write are
expected to become dirty soon.

Signed-off-by: Johannes Weiner <jweiner@xxxxxxxxxx>
Reviewed-by: Rik van Riel <riel@xxxxxxxxxx>
 fs/btrfs/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index e7872e4..ea1b892 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1084,7 +1084,7 @@ static noinline int prepare_pages(struct btrfs_root 
*root, struct file *file,
        for (i = 0; i < num_pages; i++) {
                pages[i] = find_or_create_page(inode->i_mapping, index + i,
-                                              GFP_NOFS);
+                                              GFP_NOFS | __GFP_WRITE);
                if (!pages[i]) {
                        faili = i - 1;
                        err = -ENOMEM;

<Prev in Thread] Current Thread [Next in Thread>