[PATCH] fs: touch predicts in do_dentry_open()
From: Mateusz Guzik
Date: Sun Nov 09 2025 - 07:53:14 EST
Helps out some of the asm, the routine is still a mess.
Signed-off-by: Mateusz Guzik <mjguzik@xxxxxxxxx>
---
fs/open.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/open.c b/fs/open.c
index 1d73a17192da..2a2cf9007900 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -937,7 +937,7 @@ static int do_dentry_open(struct file *f,
}
error = security_file_open(f);
- if (error)
+ if (unlikely(error))
goto cleanup_all;
/*
@@ -947,11 +947,11 @@ static int do_dentry_open(struct file *f,
* pseudo file, this call will not change the mode.
*/
error = fsnotify_open_perm_and_set_mode(f);
- if (error)
+ if (unlikely(error))
goto cleanup_all;
error = break_lease(file_inode(f), f->f_flags);
- if (error)
+ if (unlikely(error))
goto cleanup_all;
/* normally all 3 are set; ->open() can clear them if needed */
--
2.48.1