aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-22 04:40:19 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:33:39 -0400
commit30d904947459cca2beb69e0110716f5248b31f2a (patch)
tree024e2a913266377d234147b14b7eb37017546173 /fs/9p
parenta4a3bdd778715999ddfeefdc52ab76254580fa76 (diff)
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: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/vfs_inode.c15
-rw-r--r--fs/9p/vfs_inode_dotl.c15
2 files changed, 12 insertions, 18 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 62ce8daefa95..2b05651e0c3d 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -858,12 +858,11 @@ error:
858 858
859static int 859static int
860v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry, 860v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
861 struct opendata *od, unsigned flags, umode_t mode, 861 struct file *file, unsigned flags, umode_t mode,
862 int *opened) 862 int *opened)
863{ 863{
864 int err; 864 int err;
865 u32 perm; 865 u32 perm;
866 struct file *filp;
867 struct v9fs_inode *v9inode; 866 struct v9fs_inode *v9inode;
868 struct v9fs_session_info *v9ses; 867 struct v9fs_session_info *v9ses;
869 struct p9_fid *fid, *inode_fid; 868 struct p9_fid *fid, *inode_fid;
@@ -880,7 +879,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
880 879
881 /* Only creates */ 880 /* Only creates */
882 if (!(flags & O_CREAT) || dentry->d_inode) { 881 if (!(flags & O_CREAT) || dentry->d_inode) {
883 finish_no_open(od, res); 882 finish_no_open(file, res);
884 return 1; 883 return 1;
885 } 884 }
886 885
@@ -918,16 +917,14 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
918 v9inode->writeback_fid = (void *) inode_fid; 917 v9inode->writeback_fid = (void *) inode_fid;
919 } 918 }
920 mutex_unlock(&v9inode->v_mutex); 919 mutex_unlock(&v9inode->v_mutex);
921 filp = finish_open(od, dentry, generic_file_open, opened); 920 err = finish_open(file, dentry, generic_file_open, opened);
922 if (IS_ERR(filp)) { 921 if (err)
923 err = PTR_ERR(filp);
924 goto error; 922 goto error;
925 }
926 923
927 filp->private_data = fid; 924 file->private_data = fid;
928#ifdef CONFIG_9P_FSCACHE 925#ifdef CONFIG_9P_FSCACHE
929 if (v9ses->cache) 926 if (v9ses->cache)
930 v9fs_cache_inode_set_cookie(dentry->d_inode, filp); 927 v9fs_cache_inode_set_cookie(dentry->d_inode, file);
931#endif 928#endif
932 929
933 *opened |= FILE_CREATED; 930 *opened |= FILE_CREATED;
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 69f05109f75d..cfaebdef9743 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -242,14 +242,13 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
242 242
243static int 243static int
244v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry, 244v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
245 struct opendata *od, unsigned flags, umode_t omode, 245 struct file *file, unsigned flags, umode_t omode,
246 int *opened) 246 int *opened)
247{ 247{
248 int err = 0; 248 int err = 0;
249 gid_t gid; 249 gid_t gid;
250 umode_t mode; 250 umode_t mode;
251 char *name = NULL; 251 char *name = NULL;
252 struct file *filp;
253 struct p9_qid qid; 252 struct p9_qid qid;
254 struct inode *inode; 253 struct inode *inode;
255 struct p9_fid *fid = NULL; 254 struct p9_fid *fid = NULL;
@@ -270,7 +269,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
270 269
271 /* Only creates */ 270 /* Only creates */
272 if (!(flags & O_CREAT) || dentry->d_inode) { 271 if (!(flags & O_CREAT) || dentry->d_inode) {
273 finish_no_open(od, res); 272 finish_no_open(file, res);
274 return 1; 273 return 1;
275 } 274 }
276 275
@@ -357,15 +356,13 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
357 } 356 }
358 mutex_unlock(&v9inode->v_mutex); 357 mutex_unlock(&v9inode->v_mutex);
359 /* Since we are opening a file, assign the open fid to the file */ 358 /* Since we are opening a file, assign the open fid to the file */
360 filp = finish_open(od, dentry, generic_file_open, opened); 359 err = finish_open(file, dentry, generic_file_open, opened);
361 if (IS_ERR(filp)) { 360 if (err)
362 err = PTR_ERR(filp);
363 goto err_clunk_old_fid; 361 goto err_clunk_old_fid;
364 } 362 file->private_data = ofid;
365 filp->private_data = ofid;
366#ifdef CONFIG_9P_FSCACHE 363#ifdef CONFIG_9P_FSCACHE
367 if (v9ses->cache) 364 if (v9ses->cache)
368 v9fs_cache_inode_set_cookie(inode, filp); 365 v9fs_cache_inode_set_cookie(inode, file);
369#endif 366#endif
370 *opened |= FILE_CREATED; 367 *opened |= FILE_CREATED;
371out: 368out: