summaryrefslogtreecommitdiff
path: root/fs/btrfs/zstd.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2025-09-17 19:53:55 +0200
committerDavid Sterba <dsterba@suse.com>2025-09-23 08:49:26 +0200
commitcc53bd2085c8fa7b199a9a8e10e634b62a6d3fa8 (patch)
treee109a51a63115104c3769dff9a9beac8acec879b /fs/btrfs/zstd.c
parent9264d004a6c9788354b45553b9e4fe910e71b387 (diff)
btrfs: add unlikely annotations to branches leading to EIO
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 EIO is one of them. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/zstd.c')
-rw-r--r--fs/btrfs/zstd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c
index 8f7c8d27c9ca..c9cddcfa337b 100644
--- a/fs/btrfs/zstd.c
+++ b/fs/btrfs/zstd.c
@@ -654,7 +654,7 @@ int zstd_decompress_bio(struct list_head *ws, struct compressed_bio *cb)
if (workspace->in_buf.pos == workspace->in_buf.size) {
kunmap_local(workspace->in_buf.src);
folio_in_index++;
- if (folio_in_index >= total_folios_in) {
+ if (unlikely(folio_in_index >= total_folios_in)) {
workspace->in_buf.src = NULL;
ret = -EIO;
goto done;