Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320948
b: refs/heads/master
c: 25b2692
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 29, 2012
1 parent 2da6b60 commit 6c97c40
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ba44cc970e40b544af7e76a19285d568b4f3ccc
refs/heads/master: 25b2692a8ace4c2684d3899a0bfe55f8c4248899
25 changes: 9 additions & 16 deletions trunk/arch/powerpc/platforms/cell/spufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,39 +582,32 @@ static struct file_system_type spufs_type;
long spufs_create(struct path *path, struct dentry *dentry,
unsigned int flags, umode_t mode, struct file *filp)
{
struct inode *dir = path->dentry->d_inode;
int ret;

ret = -EINVAL;
/* check if we are on spufs */
if (path->dentry->d_sb->s_type != &spufs_type)
goto out;
return -EINVAL;

/* don't accept undefined flags */
if (flags & (~SPU_CREATE_FLAG_ALL))
goto out;
return -EINVAL;

/* only threads can be underneath a gang */
if (path->dentry != path->dentry->d_sb->s_root) {
if ((flags & SPU_CREATE_GANG) ||
!SPUFS_I(path->dentry->d_inode)->i_gang)
goto out;
}
if (path->dentry != path->dentry->d_sb->s_root)
if ((flags & SPU_CREATE_GANG) || !SPUFS_I(dir)->i_gang)
return -EINVAL;

mode &= ~current_umask();

if (flags & SPU_CREATE_GANG)
ret = spufs_create_gang(path->dentry->d_inode,
dentry, path->mnt, mode);
ret = spufs_create_gang(dir, dentry, path->mnt, mode);
else
ret = spufs_create_context(path->dentry->d_inode,
dentry, path->mnt, flags, mode,
ret = spufs_create_context(dir, dentry, path->mnt, flags, mode,
filp);
if (ret >= 0)
fsnotify_mkdir(path->dentry->d_inode, dentry);
fsnotify_mkdir(dir, dentry);

out:
mutex_unlock(&path->dentry->d_inode->i_mutex);
dput(dentry);
return ret;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/platforms/cell/spufs/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ static long do_spu_create(const char __user *pathname, unsigned int flags,
ret = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
ret = spufs_create(&path, dentry, flags, mode, neighbor);
mutex_unlock(&path.dentry->d_inode->i_mutex);
dput(dentry);
path_put(&path);
}

Expand Down

0 comments on commit 6c97c40

Please sign in to comment.