aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2011-03-24 07:41:21 -0400
committerroot <Chris Mason chris.mason@oracle.com>2011-03-28 05:37:39 -0400
commitfc0e4a314e361af3b13d9320e92c64118f9a3e61 (patch)
tree5bb9f51968375e5a7e19751da028bb5a8b74c624 /fs/btrfs/extent-tree.c
parent97d9a8a420444eb5b5c071d4b3b9c4100a7ae015 (diff)
btrfs: use GFP_NOFS instead of GFP_KERNEL
In the filesystem context, we must allocate memory by GFP_NOFS, or we may start another filesystem operation and make kswap thread hang up. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 5bc658a9d85c..7922f296420d 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -471,7 +471,7 @@ static int cache_block_group(struct btrfs_block_group_cache *cache,
471 if (load_cache_only) 471 if (load_cache_only)
472 return 0; 472 return 0;
473 473
474 caching_ctl = kzalloc(sizeof(*caching_ctl), GFP_KERNEL); 474 caching_ctl = kzalloc(sizeof(*caching_ctl), GFP_NOFS);
475 BUG_ON(!caching_ctl); 475 BUG_ON(!caching_ctl);
476 476
477 INIT_LIST_HEAD(&caching_ctl->list); 477 INIT_LIST_HEAD(&caching_ctl->list);
@@ -1743,7 +1743,7 @@ static int remove_extent_backref(struct btrfs_trans_handle *trans,
1743static void btrfs_issue_discard(struct block_device *bdev, 1743static void btrfs_issue_discard(struct block_device *bdev,
1744 u64 start, u64 len) 1744 u64 start, u64 len)
1745{ 1745{
1746 blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, 0); 1746 blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_NOFS, 0);
1747} 1747}
1748 1748
1749static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, 1749static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr,