diff options
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r-- | fs/btrfs/extent_map.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index fff2c28497b6..ed88f5ee4bea 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c | |||
@@ -171,6 +171,10 @@ static int mergable_maps(struct extent_map *prev, struct extent_map *next) | |||
171 | if (test_bit(EXTENT_FLAG_COMPRESSED, &prev->flags)) | 171 | if (test_bit(EXTENT_FLAG_COMPRESSED, &prev->flags)) |
172 | return 0; | 172 | return 0; |
173 | 173 | ||
174 | if (test_bit(EXTENT_FLAG_LOGGING, &prev->flags) || | ||
175 | test_bit(EXTENT_FLAG_LOGGING, &next->flags)) | ||
176 | return 0; | ||
177 | |||
174 | if (extent_map_end(prev) == next->start && | 178 | if (extent_map_end(prev) == next->start && |
175 | prev->flags == next->flags && | 179 | prev->flags == next->flags && |
176 | prev->bdev == next->bdev && | 180 | prev->bdev == next->bdev && |
@@ -256,7 +260,8 @@ int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, | |||
256 | if (!em) | 260 | if (!em) |
257 | goto out; | 261 | goto out; |
258 | 262 | ||
259 | list_move(&em->list, &tree->modified_extents); | 263 | if (!test_bit(EXTENT_FLAG_LOGGING, &em->flags)) |
264 | list_move(&em->list, &tree->modified_extents); | ||
260 | em->generation = gen; | 265 | em->generation = gen; |
261 | clear_bit(EXTENT_FLAG_PINNED, &em->flags); | 266 | clear_bit(EXTENT_FLAG_PINNED, &em->flags); |
262 | em->mod_start = em->start; | 267 | em->mod_start = em->start; |
@@ -281,6 +286,12 @@ out: | |||
281 | 286 | ||
282 | } | 287 | } |
283 | 288 | ||
289 | void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em) | ||
290 | { | ||
291 | clear_bit(EXTENT_FLAG_LOGGING, &em->flags); | ||
292 | try_merge_map(tree, em); | ||
293 | } | ||
294 | |||
284 | /** | 295 | /** |
285 | * add_extent_mapping - add new extent map to the extent tree | 296 | * add_extent_mapping - add new extent map to the extent tree |
286 | * @tree: tree to insert new map in | 297 | * @tree: tree to insert new map in |