summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
authorJosef Bacik2011-09-21 21:05:58 +0200
committerJosef Bacik2011-10-19 21:12:45 +0200
commit3b16a4e3c355ee3c790473decfcf83d4faeb8ce0 (patch)
tree5c3dad941468cf6952623cc18d6b1e682ee3f264 /fs/btrfs/relocation.c
parentBtrfs: delay iput when deleting a block group (diff)
downloadkernel-qcow2-linux-3b16a4e3c355ee3c790473decfcf83d4faeb8ce0.tar.gz
kernel-qcow2-linux-3b16a4e3c355ee3c790473decfcf83d4faeb8ce0.tar.xz
kernel-qcow2-linux-3b16a4e3c355ee3c790473decfcf83d4faeb8ce0.zip
Btrfs: use the inode's mapping mask for allocating pages
Johannes pointed out we were allocating only kernel pages for doing writes, which is kind of a big deal if you are on 32bit and have more than a gig of ram. So fix our allocations to use the mapping's gfp but still clear __GFP_FS so we don't re-enter. Thanks, Reported-by: Johannes Weiner <jweiner@redhat.com> Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r--fs/btrfs/relocation.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 3ab67409f90f..7fa090fa0d39 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -2921,6 +2921,7 @@ static int relocate_file_extent_cluster(struct inode *inode,
unsigned long last_index;
struct page *page;
struct file_ra_state *ra;
+ gfp_t mask = btrfs_alloc_write_mask(inode->i_mapping);
int nr = 0;
int ret = 0;
@@ -2955,7 +2956,7 @@ static int relocate_file_extent_cluster(struct inode *inode,
ra, NULL, index,
last_index + 1 - index);
page = find_or_create_page(inode->i_mapping, index,
- GFP_NOFS);
+ mask);
if (!page) {
btrfs_delalloc_release_metadata(inode,
PAGE_CACHE_SIZE);