diff options
| author | David Sterba <dsterba@suse.com> | 2025-09-17 19:53:54 +0200 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-09-23 08:49:26 +0200 |
| commit | 9264d004a6c9788354b45553b9e4fe910e71b387 (patch) | |
| tree | c3df36b361ab8669e6d9063d5e632957150f886f /fs/btrfs/lzo.c | |
| parent | btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions (diff) | |
| download | linux-9264d004a6c9788354b45553b9e4fe910e71b387.tar.gz linux-9264d004a6c9788354b45553b9e4fe910e71b387.zip | |
btrfs: add unlikely annotations to branches leading to EUCLEAN
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, where
EUCLEAN (a corruption) is one of them.
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/lzo.c')
| -rw-r--r-- | fs/btrfs/lzo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c index b93bdac91b30..4758f66da449 100644 --- a/fs/btrfs/lzo.c +++ b/fs/btrfs/lzo.c @@ -458,16 +458,16 @@ int lzo_decompress(struct list_head *ws, const u8 *data_in, size_t max_segment_len = workspace_buf_length(fs_info); int ret = 0; - if (srclen < LZO_LEN || srclen > max_segment_len + LZO_LEN * 2) + if (unlikely(srclen < LZO_LEN || srclen > max_segment_len + LZO_LEN * 2)) return -EUCLEAN; in_len = read_compress_length(data_in); - if (in_len != srclen) + if (unlikely(in_len != srclen)) return -EUCLEAN; data_in += LZO_LEN; in_len = read_compress_length(data_in); - if (in_len != srclen - LZO_LEN * 2) { + if (unlikely(in_len != srclen - LZO_LEN * 2)) { ret = -EUCLEAN; goto out; } |
