aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
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/fuse
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/fuse')
-rw-r--r--fs/fuse/dir.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 8a9ca09e87d4..110db5425dc1 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -370,7 +370,7 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
370 * 'mknod' + 'open' requests. 370 * 'mknod' + 'open' requests.
371 */ 371 */
372static int fuse_create_open(struct inode *dir, struct dentry *entry, 372static int fuse_create_open(struct inode *dir, struct dentry *entry,
373 struct opendata *od, unsigned flags, 373 struct file *file, unsigned flags,
374 umode_t mode, int *opened) 374 umode_t mode, int *opened)
375{ 375{
376 int err; 376 int err;
@@ -382,7 +382,6 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry,
382 struct fuse_open_out outopen; 382 struct fuse_open_out outopen;
383 struct fuse_entry_out outentry; 383 struct fuse_entry_out outentry;
384 struct fuse_file *ff; 384 struct fuse_file *ff;
385 struct file *file;
386 385
387 forget = fuse_alloc_forget(); 386 forget = fuse_alloc_forget();
388 err = -ENOMEM; 387 err = -ENOMEM;
@@ -450,14 +449,12 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry,
450 d_instantiate(entry, inode); 449 d_instantiate(entry, inode);
451 fuse_change_entry_timeout(entry, &outentry); 450 fuse_change_entry_timeout(entry, &outentry);
452 fuse_invalidate_attr(dir); 451 fuse_invalidate_attr(dir);
453 file = finish_open(od, entry, generic_file_open, opened); 452 err = finish_open(file, entry, generic_file_open, opened);
454 if (IS_ERR(file)) { 453 if (err) {
455 err = PTR_ERR(file);
456 fuse_sync_release(ff, flags); 454 fuse_sync_release(ff, flags);
457 } else { 455 } else {
458 file->private_data = fuse_file_get(ff); 456 file->private_data = fuse_file_get(ff);
459 fuse_finish_open(inode, file); 457 fuse_finish_open(inode, file);
460 err = 0;
461 } 458 }
462 return err; 459 return err;
463 460
@@ -473,7 +470,7 @@ out_err:
473 470
474static int fuse_mknod(struct inode *, struct dentry *, umode_t, dev_t); 471static int fuse_mknod(struct inode *, struct dentry *, umode_t, dev_t);
475static int fuse_atomic_open(struct inode *dir, struct dentry *entry, 472static int fuse_atomic_open(struct inode *dir, struct dentry *entry,
476 struct opendata *od, unsigned flags, 473 struct file *file, unsigned flags,
477 umode_t mode, int *opened) 474 umode_t mode, int *opened)
478{ 475{
479 int err; 476 int err;
@@ -498,7 +495,7 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry,
498 if (fc->no_create) 495 if (fc->no_create)
499 goto mknod; 496 goto mknod;
500 497
501 err = fuse_create_open(dir, entry, od, flags, mode, opened); 498 err = fuse_create_open(dir, entry, file, flags, mode, opened);
502 if (err == -ENOSYS) { 499 if (err == -ENOSYS) {
503 fc->no_create = 1; 500 fc->no_create = 1;
504 goto mknod; 501 goto mknod;
@@ -512,7 +509,7 @@ mknod:
512 if (err) 509 if (err)
513 goto out_dput; 510 goto out_dput;
514no_open: 511no_open:
515 finish_no_open(od, res); 512 finish_no_open(file, res);
516 return 1; 513 return 1;
517} 514}
518 515