summaryrefslogtreecommitdiff
path: root/fs/btrfs/export.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2025-09-17 19:53:54 +0200
committerDavid Sterba <dsterba@suse.com>2025-09-23 08:49:26 +0200
commit9264d004a6c9788354b45553b9e4fe910e71b387 (patch)
treec3df36b361ab8669e6d9063d5e632957150f886f /fs/btrfs/export.c
parent4ca6f24a52c4e94bd09f70cf132d0a38db7996b0 (diff)
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/export.c')
-rw-r--r--fs/btrfs/export.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c
index 7fc8a3200b40..d062ac521051 100644
--- a/fs/btrfs/export.c
+++ b/fs/btrfs/export.c
@@ -174,7 +174,7 @@ struct dentry *btrfs_get_parent(struct dentry *child)
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
if (ret < 0)
goto fail;
- if (ret == 0) {
+ if (unlikely(ret == 0)) {
/*
* Key with offset of -1 found, there would have to exist an
* inode with such number or a root with such id.