Skip to content

Commit

Permalink
btrfs: use reada direction enum instead of constant value in load_fre…
Browse files Browse the repository at this point in the history
…e_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 <gujx@cn.fujitsu.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Gu JinXiang authored and David Sterba committed Mar 26, 2018
1 parent 019599a commit 7ce311d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/free-space-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 7ce311d

Please sign in to comment.