Skip to content

Commit 019599a

Browse files
Gu Jinxiangkdave
authored andcommitted
btrfs: use reada direction enum instead of constant value in populate_free_space_tree
populate_free_space_tree calls function btrfs_search_slot_for_read with parameter int find_higher = 1, it means that, if no exact match is found, then use the next higher item. So in function populate_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 <[email protected]> Reviewed-by: Nikolay Borisov <[email protected]> [ update changelog ] Signed-off-by: David Sterba <[email protected]>
1 parent c1c3fac commit 019599a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/free-space-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ static int populate_free_space_tree(struct btrfs_trans_handle *trans,
10711071
path = btrfs_alloc_path();
10721072
if (!path)
10731073
return -ENOMEM;
1074-
path->reada = 1;
1074+
path->reada = READA_FORWARD;
10751075

10761076
path2 = btrfs_alloc_path();
10771077
if (!path2) {

0 commit comments

Comments
 (0)