* this file is not used and the syscalls directly enter the fs code */
asmlinkage long sys_spu_create(const char __user *name,
- unsigned int flags, mode_t mode)
+ unsigned int flags, mode_t mode, int neighbor_fd)
{
long ret;
+ struct module *owner = spufs_calls.owner;
+ struct file *neighbor;
+ int fput_needed;
ret = -ENOSYS;
- if (try_module_get(spufs_calls.owner)) {
- ret = spufs_calls.create_thread(name, flags, mode);
- module_put(spufs_calls.owner);
+ if (owner && try_module_get(owner)) {
+ if (flags & SPU_CREATE_AFFINITY_SPU) {
+ neighbor = fget_light(neighbor_fd, &fput_needed);
+ if (neighbor) {
+ ret = spufs_calls.create_thread(name, flags,
+ mode, neighbor);
+ fput_light(neighbor, fput_needed);
+ }
+ }
+ else {
+ ret = spufs_calls.create_thread(name, flags,
+ mode, NULL);
+ }
+ module_put(owner);
}
return ret;
}
long ret;
struct file *filp;
int fput_needed;
+ struct module *owner = spufs_calls.owner;
ret = -ENOSYS;
- if (try_module_get(spufs_calls.owner)) {
+ if (owner && try_module_get(owner)) {
ret = -EBADF;
filp = fget_light(fd, &fput_needed);
if (filp) {
ret = spufs_calls.spu_run(filp, unpc, ustatus);
fput_light(filp, fput_needed);
}
- module_put(spufs_calls.owner);
+ module_put(owner);
}
return ret;
}