]> Gentwo Git Trees - linux/.git/commit
btrfs: annotate as unlikely fs aborted checks in space flushing code
authorFilipe Manana <fdmanana@suse.com>
Wed, 22 Oct 2025 18:15:00 +0000 (19:15 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:20:29 +0000 (22:20 +0100)
commit38e03b820e00196018a7ad2523a3c45653b4927d
tree92257f36c96a8e7ef38ffa0049d2269adf754356
parentf912f0af13aebfd5634ba68c1a077e9a59fca47a
btrfs: annotate as unlikely fs aborted checks in space flushing code

It's not expected to have the fs in an aborted state, so surround the
abortion checks with unlikely to make it clear it's unexpected and to
hint the compiler to generate better code.

Also at maybe_fail_all_tickets() untangle all repeated checks for the
abortion into a single if-then-else. This makes things more readable
and makes the compiler generate less code. On x86_64 with gcc 14.2.0-19
from Debian I got the following object size differences.

Before this change:

  $ size fs/btrfs/btrfs.ko
     text    data     bss     dec     hex filename
  2021606  179704   25088 2226398  21f8de fs/btrfs/btrfs.ko

After this change:

  $ size fs/btrfs/btrfs.ko
     text    data     bss     dec     hex filename
  2021458  179704   25088 2226250  21f84a fs/btrfs/btrfs.ko

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
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/space-info.c