aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r--fs/btrfs/extent_map.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 81123277c2b8..71b1ac155355 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -173,6 +173,9 @@ static inline struct rb_node *tree_search(struct rb_root *root, u64 offset)
173 173
174static int mergable_maps(struct extent_map *prev, struct extent_map *next) 174static int mergable_maps(struct extent_map *prev, struct extent_map *next)
175{ 175{
176 if (test_bit(EXTENT_FLAG_PINNED, &prev->flags))
177 return 0;
178
176 if (extent_map_end(prev) == next->start && 179 if (extent_map_end(prev) == next->start &&
177 prev->flags == next->flags && 180 prev->flags == next->flags &&
178 prev->bdev == next->bdev && 181 prev->bdev == next->bdev &&
@@ -320,6 +323,7 @@ int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em)
320{ 323{
321 int ret = 0; 324 int ret = 0;
322 325
326 WARN_ON(test_bit(EXTENT_FLAG_PINNED, &em->flags));
323 BUG_ON(spin_trylock(&tree->lock)); 327 BUG_ON(spin_trylock(&tree->lock));
324 rb_erase(&em->rb_node, &tree->map); 328 rb_erase(&em->rb_node, &tree->map);
325 em->in_tree = 0; 329 em->in_tree = 0;