aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2025-04-17 16:22:50 +0100
committerDavid Sterba <dsterba@suse.com>2025-05-15 14:30:52 +0200
commitb61dd9b1cb9caf0cb3caddd9af868a786883d8a7 (patch)
tree419b3a5e1b9091e3f6be9ef0aca7459c82edf9b7 /tools/perf/scripts/python/export-to-postgresql.py
parentbtrfs: simplify last record detection at set_extent_bit() (diff)
downloadlinux-rng-b61dd9b1cb9caf0cb3caddd9af868a786883d8a7.tar.xz
linux-rng-b61dd9b1cb9caf0cb3caddd9af868a786883d8a7.zip
btrfs: avoid repeated extent state processing when setting extent bits
When setting bits for an extent range, if we find an extent state with its start offset greater than current start offset, we insert a new extent state to cover the gap, with its end offset computed and stored in the @this_end local variable, and after the insertion we update the current start offset to @this_end + 1. However if the insert_state() call resulted in an extent state merge then the end offset of the merged extent may be greater than @this_end and if that's the case, since we jump to the 'search_again' label, we'll do a full tree search that will leave us in the same extent state - this is harmless but wastes time by doing a pointless tree search and extent state processing. So improve on this by updating the current start offset to the end offset of the inserted state plus 1. This also removes the use of the @this_end variable and directly set the value in the prealloc extent state to avoid any confusion and misuse in the future. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions