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

Commit 30d90494 authored by Al Viro's avatar Al Viro
Browse files

kill struct opendata



Just pass struct file *.  Methods are happier that way...
There's no need to return struct file * from finish_open() now,
so let it return int.  Next: saner prototypes for parts in
namei.c

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent a4a3bdd7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ ata *);
	int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
	void (*update_time)(struct inode *, struct timespec *, int);
	int (*atomic_open)(struct inode *, struct dentry *,
				struct opendata *, unsigned open_flag,
				struct file *, unsigned open_flag,
				umode_t create_mode, int *opened);

locking rules:
+1 −1
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ struct inode_operations {
	int (*removexattr) (struct dentry *, const char *);
	void (*update_time)(struct inode *, struct timespec *, int);
	int (*atomic_open)(struct inode *, struct dentry *,
				struct opendata *, unsigned open_flag,
				struct file *, unsigned open_flag,
				umode_t create_mode, int *opened);
};

+6 −9
Original line number Diff line number Diff line
@@ -858,12 +858,11 @@ error:

static int
v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
		     struct opendata *od, unsigned flags, umode_t mode,
		     struct file *file, unsigned flags, umode_t mode,
		     int *opened)
{
	int err;
	u32 perm;
	struct file *filp;
	struct v9fs_inode *v9inode;
	struct v9fs_session_info *v9ses;
	struct p9_fid *fid, *inode_fid;
@@ -880,7 +879,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,

	/* Only creates */
	if (!(flags & O_CREAT) || dentry->d_inode) {
		finish_no_open(od, res);
		finish_no_open(file, res);
		return 1;
	}

@@ -918,16 +917,14 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
		v9inode->writeback_fid = (void *) inode_fid;
	}
	mutex_unlock(&v9inode->v_mutex);
	filp = finish_open(od, dentry, generic_file_open, opened);
	if (IS_ERR(filp)) {
		err = PTR_ERR(filp);
	err = finish_open(file, dentry, generic_file_open, opened);
	if (err)
		goto error;
	}

	filp->private_data = fid;
	file->private_data = fid;
#ifdef CONFIG_9P_FSCACHE
	if (v9ses->cache)
		v9fs_cache_inode_set_cookie(dentry->d_inode, filp);
		v9fs_cache_inode_set_cookie(dentry->d_inode, file);
#endif

	*opened |= FILE_CREATED;
+6 −9
Original line number Diff line number Diff line
@@ -242,14 +242,13 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,

static int
v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
			  struct opendata *od, unsigned flags, umode_t omode,
			  struct file *file, unsigned flags, umode_t omode,
			  int *opened)
{
	int err = 0;
	gid_t gid;
	umode_t mode;
	char *name = NULL;
	struct file *filp;
	struct p9_qid qid;
	struct inode *inode;
	struct p9_fid *fid = NULL;
@@ -270,7 +269,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,

	/* Only creates */
	if (!(flags & O_CREAT) || dentry->d_inode) {
		finish_no_open(od, res);
		finish_no_open(file, res);
		return 1;
	}

@@ -357,15 +356,13 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
	}
	mutex_unlock(&v9inode->v_mutex);
	/* Since we are opening a file, assign the open fid to the file */
	filp = finish_open(od, dentry, generic_file_open, opened);
	if (IS_ERR(filp)) {
		err = PTR_ERR(filp);
	err = finish_open(file, dentry, generic_file_open, opened);
	if (err)
		goto err_clunk_old_fid;
	}
	filp->private_data = ofid;
	file->private_data = ofid;
#ifdef CONFIG_9P_FSCACHE
	if (v9ses->cache)
		v9fs_cache_inode_set_cookie(inode, filp);
		v9fs_cache_inode_set_cookie(inode, file);
#endif
	*opened |= FILE_CREATED;
out:
+4 −4
Original line number Diff line number Diff line
@@ -635,7 +635,7 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry,
}

int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
		     struct opendata *od, unsigned flags, umode_t mode,
		     struct file *file, unsigned flags, umode_t mode,
		     int *opened)
{
	int err;
@@ -649,7 +649,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
		if (err < 0)
			return err;

		return ceph_lookup_open(dir, dentry, od, flags, mode, opened);
		return ceph_lookup_open(dir, dentry, file, flags, mode, opened);
	}

	if (d_unhashed(dentry)) {
@@ -663,12 +663,12 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,

	/* We don't deal with positive dentries here */
	if (dentry->d_inode) {
		finish_no_open(od, res);
		finish_no_open(file, res);
		return 1;
	}

	*opened |= FILE_CREATED;
	err = ceph_lookup_open(dir, dentry, od, flags, mode, opened);
	err = ceph_lookup_open(dir, dentry, file, flags, mode, opened);
	dput(res);

	return err;
Loading