diff options
author | Josef Bacik <josef@redhat.com> | 2011-09-21 23:05:58 +0400 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2011-10-19 23:12:45 +0400 |
commit | 3b16a4e3c355ee3c790473decfcf83d4faeb8ce0 (patch) | |
tree | 5c3dad941468cf6952623cc18d6b1e682ee3f264 /fs/btrfs/relocation.c | |
parent | 455757c322cc0a0f2a692c5625dd88aaf6a7b889 (diff) | |
download | linux-3b16a4e3c355ee3c790473decfcf83d4faeb8ce0.tar.xz |
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.c | 3 |
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); |