]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: touch predicts in do_dentry_open()
authorMateusz Guzik <mjguzik@gmail.com>
Sun, 9 Nov 2025 12:52:54 +0000 (13:52 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 12 Nov 2025 11:19:09 +0000 (12:19 +0100)
Helps out some of the asm, the routine is still a mess.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://patch.msgid.link/20251109125254.1288882-1-mjguzik@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/open.c

index 3d64372ecc675e4795eb0a0deda10f8f67b95640..e3c737ede4e4941fd8f9f38ebb6e19ff7ae40f5c 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -940,7 +940,7 @@ static int do_dentry_open(struct file *f,
        }
 
        error = security_file_open(f);
-       if (error)
+       if (unlikely(error))
                goto cleanup_all;
 
        /*
@@ -950,11 +950,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 */