]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: unify types for binary search variables
authorDavid Sterba <dsterba@suse.com>
Tue, 6 Jan 2026 16:20:25 +0000 (17:20 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:56:07 +0000 (18:56 +0200)
The variables calculating where to jump next are using mixed in types
which requires some conversions on the instruction level. Using 'u32'
removes one call to 'movslq', making the main loop shorter.

This complements type conversion done in a724f313f84beb ("btrfs: do
unsigned integer division in the extent buffer binary search loop")

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c

index eae69e205b28824f1f51c02ac38c1c51bfb8bb9c..273865bd4be419b1c2743e335edc76e8865b91fa 100644 (file)
@@ -771,7 +771,7 @@ int btrfs_bin_search(const struct extent_buffer *eb, int first_slot,
                unsigned long offset;
                struct btrfs_disk_key *tmp;
                struct btrfs_disk_key unaligned;
-               int mid;
+               u32 mid;
 
                mid = (low + high) / 2;
                offset = p + mid * item_size;