Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9951934d authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

Merge branch 'for-ovl' of...

Merge branch 'for-ovl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs into overlayfs-next

This gives us the open_with_fake_path() helper that is needed for stacked
open files in overlay and mmap in particular.
parents 67810693 2abc77af
Loading
Loading
Loading
Loading
+1 −15
Original line number Diff line number Diff line
@@ -553,24 +553,13 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,

	/* Clone the lessor file to create a new file for us */
	DRM_DEBUG_LEASE("Allocating lease file\n");
	path_get(&lessor_file->f_path);
	lessee_file = alloc_file(&lessor_file->f_path,
				 lessor_file->f_mode,
				 fops_get(lessor_file->f_inode->i_fop));

	lessee_file = file_clone_open(lessor_file);
	if (IS_ERR(lessee_file)) {
		ret = PTR_ERR(lessee_file);
		goto out_lessee;
	}

	/* Initialize the new file for DRM */
	DRM_DEBUG_LEASE("Initializing the file with %p\n", lessee_file->f_op->open);
	ret = lessee_file->f_op->open(lessee_file->f_inode, lessee_file);
	if (ret)
		goto out_lessee_file;

	lessee_priv = lessee_file->private_data;

	/* Change the file to a master one */
	drm_master_put(&lessee_priv->master);
	lessee_priv->master = lessee;
@@ -588,9 +577,6 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev,
	DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl succeeded\n");
	return 0;

out_lessee_file:
	fput(lessee_file);

out_lessee:
	drm_master_put(&lessee);

+5 −6
Original line number Diff line number Diff line
@@ -102,16 +102,15 @@ 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);
	if (IS_ERR(file))
		goto err_dput;
	file->f_flags = flags & (O_ACCMODE | O_NONBLOCK);
	file = alloc_file(&path, flags & (O_ACCMODE | O_NONBLOCK), fops);
	if (IS_ERR(file)) {
		path_put(&path);
		goto err_fs;
	}
	file->private_data = priv;

	return file;

err_dput:
	path_put(&path);
err_inode:
	iput(inode);
err_fs:
+3 −5
Original line number Diff line number Diff line
@@ -129,20 +129,18 @@ 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",
			__func__, rc);
		goto err5;
		path_put(&path);
		goto err3;
	}

	file->f_flags = flags & (O_ACCMODE | O_NONBLOCK);
	file->private_data = priv;
out:
	return file;
err5:
	path_put(&path);
err4:
	iput(inode);
err3:
+2 −6
Original line number Diff line number Diff line
@@ -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)
{
+1 −2
Original line number Diff line number Diff line
@@ -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