summaryrefslogtreecommitdiff
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-03-02 20:54:52 +0300
committerDavid Sterba <dsterba@suse.com>2017-04-18 15:07:25 +0300
commitcc8385b59e17d489814d54d6a846aba7051fdea5 (patch)
tree5fec399f1ead33f3e52de975c185eaf788ad2978 /fs/btrfs/volumes.c
parent261cc2cca0a8c1d817be65434052feb1db1fd961 (diff)
downloadlinux-cc8385b59e17d489814d54d6a846aba7051fdea5.tar.xz
btrfs: preallocate radix tree node for readahead
We can preallocate the node so insertion does not have to do that under the lock. The GFP flags for the per-device radix tree are initialized to GFP_NOFS & ~__GFP_DIRECT_RECLAIM but we can use GFP_KERNEL, same as an allocation above anyway, but also because readahead is optional and not on any critical writeout path. Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 13574f37dc36..df50a63bbc3f 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -252,7 +252,7 @@ static struct btrfs_device *__alloc_device(void)
atomic_set(&dev->reada_in_flight, 0);
atomic_set(&dev->dev_stats_ccnt, 0);
btrfs_device_data_ordered_init(dev);
- INIT_RADIX_TREE(&dev->reada_zones, GFP_NOFS & ~__GFP_DIRECT_RECLAIM);
+ INIT_RADIX_TREE(&dev->reada_zones, GFP_KERNEL);
INIT_RADIX_TREE(&dev->reada_extents, GFP_NOFS & ~__GFP_DIRECT_RECLAIM);
return dev;