summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-09-25 17:11:36 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2026-01-13 15:18:08 -0500
commit47b3b9bf93ec66ec2443f553c22e12e0475f1395 (patch)
treec527740dc29c6c8d016363738c35b0f337dcbed5 /fs
parent151e3257d61941ac07a7daacdb66ddc645f6ca34 (diff)
simplify the callers of file_open_name()
It accepts ERR_PTR() for name and does the right thing in that case. That allows to simplify the logics in callers, making them trivial to switch to CLASS(filename). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/open.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/open.c b/fs/open.c
index ac8dedea8daf..7254eda9f4a5 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -1398,14 +1398,8 @@ struct file *file_open_name(struct filename *name, int flags, umode_t mode)
*/
struct file *filp_open(const char *filename, int flags, umode_t mode)
{
- struct filename *name = getname_kernel(filename);
- struct file *file = ERR_CAST(name);
-
- if (!IS_ERR(name)) {
- file = file_open_name(name, flags, mode);
- putname(name);
- }
- return file;
+ CLASS(filename_kernel, name)(filename);
+ return file_open_name(name, flags, mode);
}
EXPORT_SYMBOL(filp_open);