diff options
| author | David Sterba <[email protected]> | 2025-09-17 17:53:56 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2025-09-23 06:49:26 +0000 |
| commit | a929904cf73b650f49cc60941e6e618240096fcb (patch) | |
| tree | ccd334a2f3c97a0f4de83211d7d032b8cf743c1e /lib/test_fortify/write_overflow-strlcpy-src.c | |
| parent | btrfs: add unlikely annotations to branches leading to EIO (diff) | |
| download | kernel-a929904cf73b650f49cc60941e6e618240096fcb.tar.gz kernel-a929904cf73b650f49cc60941e6e618240096fcb.zip | |
btrfs: add unlikely annotations to branches leading to transaction abort
The unlikely() annotation is a static prediction hint that compiler may
use to reorder code out of hot path. We use it elsewhere (namely
tree-checker.c) for error branches that almost never happen.
Transaction abort is one such error, the btrfs_abort_transaction()
inlines code to check the state and print a warning, this ought to be
out of the hot path.
The most common pattern is when transaction abort is called after
checking a return value and the control flow leads to a quick return.
In other cases it may not be necessary to add unlikely() e.g. when the
function returns anyway or the control flow is not changed noticeably.
Reviewed-by: Filipe Manana <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy-src.c')
0 files changed, 0 insertions, 0 deletions
