From: Gu JinXiang Date: Thu, 11 Jan 2018 08:12:18 +0000 (+0800) Subject: btrfs: use reada direction enum instead of constant value in load_free_space_tree X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7ce311d552e473a5176f8bb143fb45de64b8bd81;p=openwrt%2Fstaging%2Fblogic.git btrfs: use reada direction enum instead of constant value in load_free_space_tree load_free_space_tree calls either function load_free_space_bitmaps or load_free_space_extents. And either of those two will lead to call btrfs_next_item. So in function load_free_space_tree, use READA_FORWARD to read forward ahead. This also changes the value from READA_BACK to READA_FORWARD, since according to the logic, it should reada_for_search forward, not backward. Signed-off-by: Gu JinXiang Reviewed-by: Nikolay Borisov [ update changelog ] Signed-off-by: David Sterba --- diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c index d7b6c0017143..af36a6a971fe 100644 --- a/fs/btrfs/free-space-tree.c +++ b/fs/btrfs/free-space-tree.c @@ -1573,7 +1573,7 @@ int load_free_space_tree(struct btrfs_caching_control *caching_ctl) */ path->skip_locking = 1; path->search_commit_root = 1; - path->reada = 1; + path->reada = READA_FORWARD; info = search_free_space_info(NULL, fs_info, block_group, path, 0); if (IS_ERR(info)) {