Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83935
b: refs/heads/master
c: 5811906
h: refs/heads/master
i:
  83933: 28d0ef3
  83931: 31d6a6d
  83927: f2724f6
  83919: a8cc5c5
  83903: 1261ac7
v: v3
  • Loading branch information
Andre Detsch authored and Paul Mackerras committed Feb 6, 2008
1 parent 7ec00ea commit 3af9764
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 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: 60cf54db47727935af1c439f59c636a96a8cbd4b
refs/heads/master: 58119068cb27ef7513f80aff44b62a3a8f40ef5f
29 changes: 21 additions & 8 deletions trunk/arch/powerpc/platforms/cell/spufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static struct spu_context *
spufs_assert_affinity(unsigned int flags, struct spu_gang *gang,
struct file *filp)
{
struct spu_context *tmp, *neighbor;
struct spu_context *tmp, *neighbor, *err;
int count, node;
int aff_supp;

Expand Down Expand Up @@ -354,11 +354,15 @@ spufs_assert_affinity(unsigned int flags, struct spu_gang *gang,
if (!list_empty(&neighbor->aff_list) && !(neighbor->aff_head) &&
!list_is_last(&neighbor->aff_list, &gang->aff_list_head) &&
!list_entry(neighbor->aff_list.next, struct spu_context,
aff_list)->aff_head)
return ERR_PTR(-EEXIST);
aff_list)->aff_head) {
err = ERR_PTR(-EEXIST);
goto out_put_neighbor;
}

if (gang != neighbor->gang)
return ERR_PTR(-EINVAL);
if (gang != neighbor->gang) {
err = ERR_PTR(-EINVAL);
goto out_put_neighbor;
}

count = 1;
list_for_each_entry(tmp, &gang->aff_list_head, aff_list)
Expand All @@ -372,11 +376,17 @@ spufs_assert_affinity(unsigned int flags, struct spu_gang *gang,
break;
}

if (node == MAX_NUMNODES)
return ERR_PTR(-EEXIST);
if (node == MAX_NUMNODES) {
err = ERR_PTR(-EEXIST);
goto out_put_neighbor;
}
}

return neighbor;

out_put_neighbor:
put_spu_context(neighbor);
return err;
}

static void
Expand Down Expand Up @@ -454,9 +464,12 @@ spufs_create_context(struct inode *inode, struct dentry *dentry,
if (ret)
goto out_aff_unlock;

if (affinity)
if (affinity) {
spufs_set_affinity(flags, SPUFS_I(dentry->d_inode)->i_ctx,
neighbor);
if (neighbor)
put_spu_context(neighbor);
}

/*
* get references for dget and mntget, will be released
Expand Down

0 comments on commit 3af9764

Please sign in to comment.