]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: tag as unlikely branches that call extent_io_tree_panic()
authorFilipe Manana <fdmanana@suse.com>
Wed, 11 Mar 2026 12:07:03 +0000 (12:07 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:56:03 +0000 (18:56 +0200)
commit0f7c10d662ac4fcd749543568d15cd65325feef9
tree33ae61328ffd878596e456df0146bc489e4e24ba
parent598c10a9e9e80d776f32a2174f6dced705b74178
btrfs: tag as unlikely branches that call extent_io_tree_panic()

It's unexpected to ever call extent_io_tree_panic() so surround with
'unlikely' every if statement condition that leads to it, making it
explicit to a reader and to hint the compiler to potentially generate
better code.

On x86_64, using gcc 14.2.0-19 from Debian, this resulted in a slightly
decrease of the btrfs module's text size.

Before:

  $ size fs/btrfs/btrfs.ko
     text    data     bss     dec     hex filename
  1999832  174320   15592 2189744  2169b0 fs/btrfs/btrfs.ko

After:

  $ size fs/btrfs/btrfs.ko
     text    data     bss     dec     hex filename
  1999768  174320   15592 2189680  216970 fs/btrfs/btrfs.ko

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