]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: simplify last record detection at btrfs_convert_extent_bit()
authorFilipe Manana <fdmanana@suse.com>
Wed, 16 Apr 2025 15:18:10 +0000 (16:18 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:51 +0000 (14:30 +0200)
commit0edc1a5c543c024934e7418aa76d2e8309e0303f
treefd3e04d1f91d7d4c07a2c3e274fb5919bbb7136a
parentbe2270262fa732660b3b568175701cd732eda1da
btrfs: simplify last record detection at btrfs_convert_extent_bit()

There's no need to compare the current extent state's end offset to
(u64)-1 to check if we have the last possible record and to check as
as well if after updating the start offset to the end offset of the
current record plus one we are still inside the target range.

Instead we can simplify and exit if the current extent state ends at or
after the target range and then remove the check for the (u64)-1 as well
as the check to see if the updated start offset (to last_end + 1) is still
inside the target range.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-io-tree.c