Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320947
b: refs/heads/master
c: 1ba44cc
h: refs/heads/master
i:
  320945: 8bf89c7
  320943: 0b99678
v: v3
  • Loading branch information
Al Viro committed Jul 29, 2012
1 parent 2cc1b51 commit 2da6b60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 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: 66ec7b2cd0d84561ef3c420b5995d0c1dd2cf1c5
refs/heads/master: 1ba44cc970e40b544af7e76a19285d568b4f3ccc
33 changes: 10 additions & 23 deletions trunk/arch/powerpc/platforms/cell/spufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,28 +450,24 @@ spufs_create_context(struct inode *inode, struct dentry *dentry,
struct spu_context *neighbor;
struct path path = {.mnt = mnt, .dentry = dentry};

ret = -EPERM;
if ((flags & SPU_CREATE_NOSCHED) &&
!capable(CAP_SYS_NICE))
goto out_unlock;
return -EPERM;

ret = -EINVAL;
if ((flags & (SPU_CREATE_NOSCHED | SPU_CREATE_ISOLATE))
== SPU_CREATE_ISOLATE)
goto out_unlock;
return -EINVAL;

ret = -ENODEV;
if ((flags & SPU_CREATE_ISOLATE) && !isolated_loader)
goto out_unlock;
return -ENODEV;

gang = NULL;
neighbor = NULL;
affinity = flags & (SPU_CREATE_AFFINITY_MEM | SPU_CREATE_AFFINITY_SPU);
if (affinity) {
gang = SPUFS_I(inode)->i_gang;
ret = -EINVAL;
if (!gang)
goto out_unlock;
return -EINVAL;
mutex_lock(&gang->aff_mutex);
neighbor = spufs_assert_affinity(flags, gang, aff_filp);
if (IS_ERR(neighbor)) {
Expand All @@ -498,9 +494,6 @@ spufs_create_context(struct inode *inode, struct dentry *dentry,
out_aff_unlock:
if (affinity)
mutex_unlock(&gang->aff_mutex);
out_unlock:
mutex_unlock(&inode->i_mutex);
dput(dentry);
return ret;
}

Expand Down Expand Up @@ -573,18 +566,13 @@ static int spufs_create_gang(struct inode *inode,
int ret;

ret = spufs_mkgang(inode, dentry, mode & S_IRWXUGO);
if (ret)
goto out;

ret = spufs_gang_open(&path);
if (ret < 0) {
int err = simple_rmdir(inode, dentry);
WARN_ON(err);
if (!ret) {
ret = spufs_gang_open(&path);
if (ret < 0) {
int err = simple_rmdir(inode, dentry);
WARN_ON(err);
}
}

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

Expand Down Expand Up @@ -623,7 +611,6 @@ long spufs_create(struct path *path, struct dentry *dentry,
filp);
if (ret >= 0)
fsnotify_mkdir(path->dentry->d_inode, dentry);
return ret;

out:
mutex_unlock(&path->dentry->d_inode->i_mutex);
Expand Down

0 comments on commit 2da6b60

Please sign in to comment.