aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-09-21 15:05:58 -0400
committerJosef Bacik <josef@redhat.com>2011-10-19 15:12:45 -0400
commit3b16a4e3c355ee3c790473decfcf83d4faeb8ce0 (patch)
tree5c3dad941468cf6952623cc18d6b1e682ee3f264 /fs/btrfs/ctree.h
parent455757c322cc0a0f2a692c5625dd88aaf6a7b889 (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/ctree.h')
-rw-r--r--fs/btrfs/ctree.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index a5faf8e33baa..47dea7118e0e 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -30,6 +30,7 @@
30#include <linux/kobject.h> 30#include <linux/kobject.h>
31#include <trace/events/btrfs.h> 31#include <trace/events/btrfs.h>
32#include <asm/kmap_types.h> 32#include <asm/kmap_types.h>
33#include <linux/pagemap.h>
33#include "extent_io.h" 34#include "extent_io.h"
34#include "extent_map.h" 35#include "extent_map.h"
35#include "async-thread.h" 36#include "async-thread.h"
@@ -2117,6 +2118,11 @@ static inline bool btrfs_mixed_space_info(struct btrfs_space_info *space_info)
2117 (space_info->flags & BTRFS_BLOCK_GROUP_DATA)); 2118 (space_info->flags & BTRFS_BLOCK_GROUP_DATA));
2118} 2119}
2119 2120
2121static inline gfp_t btrfs_alloc_write_mask(struct address_space *mapping)
2122{
2123 return mapping_gfp_mask(mapping) & ~__GFP_FS;
2124}
2125
2120/* extent-tree.c */ 2126/* extent-tree.c */
2121static inline u64 btrfs_calc_trans_metadata_size(struct btrfs_root *root, 2127static inline u64 btrfs_calc_trans_metadata_size(struct btrfs_root *root,
2122 unsigned num_items) 2128 unsigned num_items)