]> www.infradead.org Git - nvme.git/commit
btrfs: avoid removal and re-insertion of split ordered extent
authorFilipe Manana <fdmanana@suse.com>
Mon, 3 Jun 2024 16:02:26 +0000 (17:02 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Jul 2024 13:33:23 +0000 (15:33 +0200)
commitcb3cd62454eab7ebf833aeb04ca7458c656d30cf
tree0e76d259febe86e99671b1834036f58d57a668e2
parentc18ca3c960171e0fb22e498dbf233e0cc521a31c
btrfs: avoid removal and re-insertion of split ordered extent

At btrfs_split_ordered_extent(), we are removing and re-inserting the
ordered extent that we are trimming, but we don't need to since the
trimming doesn't change its position in the red black tree because we
don't have overlapping ordered extents (that would imply double allocation
of extents) and we know the split length is smaller than the ordered
extent's num_bytes field (we checked that early in the function).

So drop the remove and re-insert code for the slit ordered extent.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ordered-data.c