Skip to content

Commit

Permalink
btrfs: reada: use GFP_KERNEL everywhere
Browse files Browse the repository at this point in the history
The readahead framework is not on the critical writeback path we don't
need to use GFP_NOFS for allocations. All error paths are handled and
the readahead failures are not fatal. The actual users (scrub,
dev-replace) will trigger reads if the blocks are not found in cache.

Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
David Sterba committed Feb 11, 2016
1 parent e780b0d commit ed0244f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fs/btrfs/reada.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static struct reada_zone *reada_find_zone(struct btrfs_fs_info *fs_info,
end = start + cache->key.offset - 1;
btrfs_put_block_group(cache);

zone = kzalloc(sizeof(*zone), GFP_NOFS);
zone = kzalloc(sizeof(*zone), GFP_KERNEL);
if (!zone)
return NULL;

Expand Down Expand Up @@ -343,7 +343,7 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root,
if (re)
return re;

re = kzalloc(sizeof(*re), GFP_NOFS);
re = kzalloc(sizeof(*re), GFP_KERNEL);
if (!re)
return NULL;

Expand Down Expand Up @@ -566,7 +566,7 @@ static int reada_add_block(struct reada_control *rc, u64 logical,
if (!re)
return -1;

rec = kzalloc(sizeof(*rec), GFP_NOFS);
rec = kzalloc(sizeof(*rec), GFP_KERNEL);
if (!rec) {
reada_extent_put(root->fs_info, re);
return -ENOMEM;
Expand Down Expand Up @@ -791,7 +791,7 @@ static void reada_start_machine(struct btrfs_fs_info *fs_info)
{
struct reada_machine_work *rmw;

rmw = kzalloc(sizeof(*rmw), GFP_NOFS);
rmw = kzalloc(sizeof(*rmw), GFP_KERNEL);
if (!rmw) {
/* FIXME we cannot handle this properly right now */
BUG();
Expand Down Expand Up @@ -926,7 +926,7 @@ struct reada_control *btrfs_reada_add(struct btrfs_root *root,
.offset = (u64)-1
};

rc = kzalloc(sizeof(*rc), GFP_NOFS);
rc = kzalloc(sizeof(*rc), GFP_KERNEL);
if (!rc)
return ERR_PTR(-ENOMEM);

Expand Down

0 comments on commit ed0244f

Please sign in to comment.