Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

btrfs: tag as unlikely error handling in run_one_delayed_ref()

We don't expect to get errors unless we have a corrupted fs, bad RAM or a
bug. So tag the error handling as unlikely.

This slightly reduces the module's text size on x86_64 using gcc 14.2.0-19
from Debian.

Before this change:

$ size fs/btrfs/btrfs.ko
text data bss dec hex filename
1939458 172512 15592 2127562 2076ca fs/btrfs/btrfs.ko

After this change:

$ size fs/btrfs/btrfs.ko
text data bss dec hex filename
1939398 172512 15592 2127502 20768e fs/btrfs/btrfs.ko

Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Filipe Manana and committed by
David Sterba
b322fa5f 271cbe76

+5 -3
+5 -3
fs/btrfs/extent-tree.c
··· 1785 1785 btrfs_err(fs_info, "unexpected delayed ref node type: %u", node->type); 1786 1786 } 1787 1787 1788 - if (ret && insert_reserved) 1789 - btrfs_pin_extent(trans, node->bytenr, node->num_bytes); 1790 - if (ret < 0) 1788 + if (unlikely(ret)) { 1789 + if (insert_reserved) 1790 + btrfs_pin_extent(trans, node->bytenr, node->num_bytes); 1791 1791 btrfs_err(fs_info, 1792 1792 "failed to run delayed ref for logical %llu num_bytes %llu type %u action %u ref_mod %d: %d", 1793 1793 node->bytenr, node->num_bytes, node->type, 1794 1794 node->action, node->ref_mod, ret); 1795 + } 1796 + 1795 1797 return ret; 1796 1798 } 1797 1799