summaryrefslogtreecommitdiffstats
path: root/drivers/misc/cxl
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-07-11 20:19:04 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 16:02:57 +0200
commitc9c554f21490bbc96cc554f80024d27d09670480 (patch)
treef680bcb2253cf658a7a925d0eb20f2dff71c1f1f /drivers/misc/cxl
parentmake sure do_dentry_open() won't return positive as an error (diff)
downloadlinux-c9c554f21490bbc96cc554f80024d27d09670480.tar.xz
linux-c9c554f21490bbc96cc554f80024d27d09670480.zip
alloc_file(): switch to passing O_... flags instead of FMODE_... mode
... so that it could set both ->f_flags and ->f_mode, without callers having to set ->f_flags manually. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/misc/cxl')
-rw-r--r--drivers/misc/cxl/api.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
index 6b16946f9b05..0b5cb6cf91a0 100644
--- a/drivers/misc/cxl/api.c
+++ b/drivers/misc/cxl/api.c
@@ -102,12 +102,11 @@ static struct file *cxl_getfile(const char *name,
path.mnt = mntget(cxl_vfs_mount);
d_instantiate(path.dentry, inode);
- file = alloc_file(&path, OPEN_FMODE(flags), fops);
+ file = alloc_file(&path, flags & (O_ACCMODE | O_NONBLOCK), fops);
if (IS_ERR(file)) {
path_put(&path);
goto err_fs;
}
- file->f_flags = flags & (O_ACCMODE | O_NONBLOCK);
file->private_data = priv;
return file;