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:
Al Viro
2018-07-11 14:19:04 -04:00
parent 6b4e8085c0
commit c9c554f214
12 changed files with 27 additions and 36 deletions

View File

@@ -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;