]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: move unlikely checks around btrfs_is_shutdown() into the helper
authorFilipe Manana <fdmanana@suse.com>
Wed, 17 Dec 2025 13:15:42 +0000 (13:15 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:49:12 +0000 (07:49 +0100)
commit7d7608cc9ad8acc0d03dd85175558cb2cd634f86
treec0e6729d429d9f1cfeaf23619e037a6bcc290f12
parent858f32937c8ad5519c5daa9d5498963fe0bd0139
btrfs: move unlikely checks around btrfs_is_shutdown() into the helper

Instead of surrounding every caller of btrfs_is_shutdown() with unlikely,
move the unlikely into the helper itself, like we do in other places in
btrfs and is common in the kernel outside btrfs too. Also make the fs_info
argument of btrfs_is_shutdown() const.

On a x86_84 box using gcc 14.2.0-19 from Debian, this resulted in a slight
reduction of the module's text size.

Before:

  $ size fs/btrfs/btrfs.ko
     text    data     bss     dec     hex filename
  1939044  172568   15592 2127204  207564 fs/btrfs/btrfs.ko

After:

  $ size fs/btrfs/btrfs.ko
     text    data     bss     dec     hex filename
  1938876  172568   15592 2127036  2074bc 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/file.c
fs/btrfs/fs.h
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/reflink.c