Commit c42ac0bc authored by Filipe David Borba Manana's avatar Filipe David Borba Manana Committed by Chris Mason

Btrfs: add missing extent state caching calls

When we didn't find a matching extent state, we inserted a new one
but didn't cache it in the **cached_state parameter, which makes a
subsequent call do a tree lookup to get it.
Signed-off-by: default avatarFilipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 32193c14
...@@ -817,6 +817,7 @@ __set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, ...@@ -817,6 +817,7 @@ __set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
if (err) if (err)
extent_io_tree_panic(tree, err); extent_io_tree_panic(tree, err);
cache_state(prealloc, cached_state);
prealloc = NULL; prealloc = NULL;
goto out; goto out;
} }
...@@ -1040,9 +1041,10 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, ...@@ -1040,9 +1041,10 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
goto out; goto out;
} }
err = insert_state(tree, prealloc, start, end, &bits); err = insert_state(tree, prealloc, start, end, &bits);
prealloc = NULL;
if (err) if (err)
extent_io_tree_panic(tree, err); extent_io_tree_panic(tree, err);
cache_state(prealloc, cached_state);
prealloc = NULL;
goto out; goto out;
} }
state = rb_entry(node, struct extent_state, rb_node); state = rb_entry(node, struct extent_state, rb_node);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment