Re: [PATCH 1/2] fs: reorganize path_openat()

From: stsp
Date: Wed Apr 24 2024 - 06:58:58 EST


24.04.2024 12:17, David Laight пишет:
You probably ought to merge the two 'unlikely' tests.
Otherwise there'll be two conditionals in the 'hot path'.
(There probably always were.)
So something like:
if (unlikely(op->open_flag & (__O_TMPFILE | O_PATH))) {
file = alloc_empty_file(op->open_flag, current_cred());
if (IS_ERR(file))
return file;
if (op->open_flag & __O_TMFILE)
error = do_tmpfile(nd, flags, op, file);
else
error = do_o_path(nd, flags, file);
} else {

Posted v4 with this code verbatim.

Copying op->open_flag to a local may also generate better code.
Done this as well.

Thank you.