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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user