aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-07-11 10:47:06 -0400
committerChris Mason <chris.mason@oracle.com>2011-07-27 12:46:43 -0400
commita94733d0bc630edaedc6ca156752dd5a7cb82521 (patch)
tree3f0bd508aa1ce5894e43df45bb73031a380ed8f5 /fs/btrfs/file.c
parentbab39bf998133510f2dad08158006197ec0dabea (diff)
Btrfs: use find_or_create_page instead of grab_cache_page
grab_cache_page will use mapping_gfp_mask(), which for all inodes is set to GFP_HIGHUSER_MOVABLE. So instead use find_or_create_page in all cases where we need GFP_NOFS so we don't deadlock. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index fa4ef18b66b1..bd6bbb877ff2 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1081,7 +1081,8 @@ static noinline int prepare_pages(struct btrfs_root *root, struct file *file,
1081 1081
1082again: 1082again:
1083 for (i = 0; i < num_pages; i++) { 1083 for (i = 0; i < num_pages; i++) {
1084 pages[i] = grab_cache_page(inode->i_mapping, index + i); 1084 pages[i] = find_or_create_page(inode->i_mapping, index + i,
1085 GFP_NOFS);
1085 if (!pages[i]) { 1086 if (!pages[i]) {
1086 faili = i - 1; 1087 faili = i - 1;
1087 err = -ENOMEM; 1088 err = -ENOMEM;