Loading drivers/misc/cxl/api.c +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading drivers/scsi/cxlflash/ocxl_hw.c +1 −2 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ static struct file *ocxlflash_getfile(struct device *dev, const char *name, path.mnt = mntget(ocxlflash_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)) { rc = PTR_ERR(file); dev_err(dev, "%s: alloc_file failed rc=%d\n", Loading @@ -138,7 +138,6 @@ static struct file *ocxlflash_getfile(struct device *dev, const char *name, goto err3; } file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); file->private_data = priv; out: return file; Loading fs/aio.c +2 −6 Original line number Diff line number Diff line Loading @@ -234,16 +234,12 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) path.mnt = mntget(aio_mnt); d_instantiate(path.dentry, inode); file = alloc_file(&path, FMODE_READ | FMODE_WRITE, &aio_ring_fops); if (IS_ERR(file)) { file = alloc_file(&path, O_RDWR, &aio_ring_fops); if (IS_ERR(file)) path_put(&path); return file; } file->f_flags = O_RDWR; return file; } static struct dentry *aio_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { Loading fs/anon_inodes.c +1 −2 Original line number Diff line number Diff line Loading @@ -102,12 +102,11 @@ struct file *anon_inode_getfile(const char *name, d_instantiate(path.dentry, anon_inode_inode); file = alloc_file(&path, OPEN_FMODE(flags), fops); file = alloc_file(&path, flags & (O_ACCMODE | O_NONBLOCK), fops); if (IS_ERR(file)) goto err_dput; file->f_mapping = anon_inode_inode->i_mapping; file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); file->private_data = priv; return file; Loading fs/file_table.c +9 −8 Original line number Diff line number Diff line Loading @@ -153,10 +153,10 @@ struct file *get_empty_filp(void) * alloc_file - allocate and initialize a 'struct file' * * @path: the (dentry, vfsmount) pair for the new file * @mode: the mode with which the new file will be opened * @flags: O_... flags with which the new file will be opened * @fop: the 'struct file_operations' for the new file */ struct file *alloc_file(const struct path *path, fmode_t mode, struct file *alloc_file(const struct path *path, int flags, const struct file_operations *fop) { struct file *file; Loading @@ -165,19 +165,20 @@ struct file *alloc_file(const struct path *path, fmode_t mode, if (IS_ERR(file)) return file; file->f_mode = OPEN_FMODE(flags); file->f_flags = flags; file->f_path = *path; file->f_inode = path->dentry->d_inode; file->f_mapping = path->dentry->d_inode->i_mapping; file->f_wb_err = filemap_sample_wb_err(file->f_mapping); if ((mode & FMODE_READ) && if ((file->f_mode & FMODE_READ) && likely(fop->read || fop->read_iter)) mode |= FMODE_CAN_READ; if ((mode & FMODE_WRITE) && file->f_mode |= FMODE_CAN_READ; if ((file->f_mode & FMODE_WRITE) && likely(fop->write || fop->write_iter)) mode |= FMODE_CAN_WRITE; file->f_mode = mode; file->f_mode |= FMODE_CAN_WRITE; file->f_op = fop; if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) if ((file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) i_readcount_inc(path->dentry->d_inode); return file; } Loading Loading
drivers/misc/cxl/api.c +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading
drivers/scsi/cxlflash/ocxl_hw.c +1 −2 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ static struct file *ocxlflash_getfile(struct device *dev, const char *name, path.mnt = mntget(ocxlflash_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)) { rc = PTR_ERR(file); dev_err(dev, "%s: alloc_file failed rc=%d\n", Loading @@ -138,7 +138,6 @@ static struct file *ocxlflash_getfile(struct device *dev, const char *name, goto err3; } file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); file->private_data = priv; out: return file; Loading
fs/aio.c +2 −6 Original line number Diff line number Diff line Loading @@ -234,16 +234,12 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) path.mnt = mntget(aio_mnt); d_instantiate(path.dentry, inode); file = alloc_file(&path, FMODE_READ | FMODE_WRITE, &aio_ring_fops); if (IS_ERR(file)) { file = alloc_file(&path, O_RDWR, &aio_ring_fops); if (IS_ERR(file)) path_put(&path); return file; } file->f_flags = O_RDWR; return file; } static struct dentry *aio_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { Loading
fs/anon_inodes.c +1 −2 Original line number Diff line number Diff line Loading @@ -102,12 +102,11 @@ struct file *anon_inode_getfile(const char *name, d_instantiate(path.dentry, anon_inode_inode); file = alloc_file(&path, OPEN_FMODE(flags), fops); file = alloc_file(&path, flags & (O_ACCMODE | O_NONBLOCK), fops); if (IS_ERR(file)) goto err_dput; file->f_mapping = anon_inode_inode->i_mapping; file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); file->private_data = priv; return file; Loading
fs/file_table.c +9 −8 Original line number Diff line number Diff line Loading @@ -153,10 +153,10 @@ struct file *get_empty_filp(void) * alloc_file - allocate and initialize a 'struct file' * * @path: the (dentry, vfsmount) pair for the new file * @mode: the mode with which the new file will be opened * @flags: O_... flags with which the new file will be opened * @fop: the 'struct file_operations' for the new file */ struct file *alloc_file(const struct path *path, fmode_t mode, struct file *alloc_file(const struct path *path, int flags, const struct file_operations *fop) { struct file *file; Loading @@ -165,19 +165,20 @@ struct file *alloc_file(const struct path *path, fmode_t mode, if (IS_ERR(file)) return file; file->f_mode = OPEN_FMODE(flags); file->f_flags = flags; file->f_path = *path; file->f_inode = path->dentry->d_inode; file->f_mapping = path->dentry->d_inode->i_mapping; file->f_wb_err = filemap_sample_wb_err(file->f_mapping); if ((mode & FMODE_READ) && if ((file->f_mode & FMODE_READ) && likely(fop->read || fop->read_iter)) mode |= FMODE_CAN_READ; if ((mode & FMODE_WRITE) && file->f_mode |= FMODE_CAN_READ; if ((file->f_mode & FMODE_WRITE) && likely(fop->write || fop->write_iter)) mode |= FMODE_CAN_WRITE; file->f_mode = mode; file->f_mode |= FMODE_CAN_WRITE; file->f_op = fop; if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) if ((file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) i_readcount_inc(path->dentry->d_inode); return file; } Loading