diff options
author | Josef Bacik <josef@redhat.com> | 2011-09-21 15:05:58 -0400 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2011-10-19 15:12:45 -0400 |
commit | 3b16a4e3c355ee3c790473decfcf83d4faeb8ce0 (patch) | |
tree | 5c3dad941468cf6952623cc18d6b1e682ee3f264 /fs/btrfs/relocation.c | |
parent | 455757c322cc0a0f2a692c5625dd88aaf6a7b889 (diff) |
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, | |||
2921 | unsigned long last_index; | 2921 | unsigned long last_index; |
2922 | struct page *page; | 2922 | struct page *page; |
2923 | struct file_ra_state *ra; | 2923 | struct file_ra_state *ra; |
2924 | gfp_t mask = btrfs_alloc_write_mask(inode->i_mapping); | ||
2924 | int nr = 0; | 2925 | int nr = 0; |
2925 | int ret = 0; | 2926 | int ret = 0; |
2926 | 2927 | ||
@@ -2955,7 +2956,7 @@ static int relocate_file_extent_cluster(struct inode *inode, | |||
2955 | ra, NULL, index, | 2956 | ra, NULL, index, |
2956 | last_index + 1 - index); | 2957 | last_index + 1 - index); |
2957 | page = find_or_create_page(inode->i_mapping, index, | 2958 | page = find_or_create_page(inode->i_mapping, index, |
2958 | GFP_NOFS); | 2959 | mask); |
2959 | if (!page) { | 2960 | if (!page) { |
2960 | btrfs_delalloc_release_metadata(inode, | 2961 | btrfs_delalloc_release_metadata(inode, |
2961 | PAGE_CACHE_SIZE); | 2962 | PAGE_CACHE_SIZE); |