Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

pull unlock+dput() out into do_spu_create()

... and cleaning spufs_create() a bit, while we are at it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information...
commit 25b2692a8ace4c2684d3899a0bfe55f8c4248899 1 parent 1ba44cc
Al Viro authored
25 arch/powerpc/platforms/cell/spufs/inode.c
@@ -582,39 +582,32 @@ static struct file_system_type spufs_type;
582 582 long spufs_create(struct path *path, struct dentry *dentry,
583 583 unsigned int flags, umode_t mode, struct file *filp)
584 584 {
  585 + struct inode *dir = path->dentry->d_inode;
585 586 int ret;
586 587
587   - ret = -EINVAL;
588 588 /* check if we are on spufs */
589 589 if (path->dentry->d_sb->s_type != &spufs_type)
590   - goto out;
  590 + return -EINVAL;
591 591
592 592 /* don't accept undefined flags */
593 593 if (flags & (~SPU_CREATE_FLAG_ALL))
594   - goto out;
  594 + return -EINVAL;
595 595
596 596 /* only threads can be underneath a gang */
597   - if (path->dentry != path->dentry->d_sb->s_root) {
598   - if ((flags & SPU_CREATE_GANG) ||
599   - !SPUFS_I(path->dentry->d_inode)->i_gang)
600   - goto out;
601   - }
  597 + if (path->dentry != path->dentry->d_sb->s_root)
  598 + if ((flags & SPU_CREATE_GANG) || !SPUFS_I(dir)->i_gang)
  599 + return -EINVAL;
602 600
603 601 mode &= ~current_umask();
604 602
605 603 if (flags & SPU_CREATE_GANG)
606   - ret = spufs_create_gang(path->dentry->d_inode,
607   - dentry, path->mnt, mode);
  604 + ret = spufs_create_gang(dir, dentry, path->mnt, mode);
608 605 else
609   - ret = spufs_create_context(path->dentry->d_inode,
610   - dentry, path->mnt, flags, mode,
  606 + ret = spufs_create_context(dir, dentry, path->mnt, flags, mode,
611 607 filp);
612 608 if (ret >= 0)
613   - fsnotify_mkdir(path->dentry->d_inode, dentry);
  609 + fsnotify_mkdir(dir, dentry);
614 610
615   -out:
616   - mutex_unlock(&path->dentry->d_inode->i_mutex);
617   - dput(dentry);
618 611 return ret;
619 612 }
620 613
2  arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -70,6 +70,8 @@ static long do_spu_create(const char __user *pathname, unsigned int flags,
70 70 ret = PTR_ERR(dentry);
71 71 if (!IS_ERR(dentry)) {
72 72 ret = spufs_create(&path, dentry, flags, mode, neighbor);
  73 + mutex_unlock(&path.dentry->d_inode->i_mutex);
  74 + dput(dentry);
73 75 path_put(&path);
74 76 }
75 77

0 comments on commit 25b2692

Please sign in to comment.
Something went wrong with that request. Please try again.