summaryrefslogtreecommitdiff
path: root/include/linux/i2c/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorMark Harmstone <mark@harmstone.com>2026-01-07 14:09:10 +0000
committerDavid Sterba <dsterba@suse.com>2026-02-03 07:54:35 +0100
commit979e1dc3d69e4c825eec05d05d9567b251f6ec23 (patch)
tree0cc0e7fae6a08faf681dd94d550d567fe2fed8c5 /include/linux/i2c/git@git.tavy.me:linux.git
parent18ba649928711539dd124b4bf7682696b3f2e4a8 (diff)
btrfs: handle deletions from remapped block group
Handle the case where we free an extent from a block group that has the REMAPPED flag set. Because the remap tree is orthogonal to the extent tree, for data this may be within any number of identity remaps or actual remaps. If we're freeing a metadata node, this will be wholly inside one or the other. btrfs_remove_extent_from_remap_tree() searches the remap tree for the remaps that cover the range in question, then calls remove_range_from_remap_tree() for each one, to punch a hole in the remap and adjust the free-space tree. For an identity remap, remove_range_from_remap_tree() will adjust the block group's `identity_remap_count` if this changes. If it reaches zero we mark the block group as fully remapped. For an identity remap, remove_range_from_remap_tree() will adjust the block group's `identity_remap_count` if this changes. If it reaches zero we mark the block group as fully remapped. Fully remapped block groups have their chunk stripes removed and their device extents freed, which makes the disk space available again to the chunk allocator. This happens asynchronously: in the cleaner thread for sync discard and nodiscard, and (in a later patch) in the discard worker for async discard. Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Mark Harmstone <mark@harmstone.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/linux/i2c/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions