#include <linux/module.h>
#include <linux/mount.h>
#include <linux/namei.h>
+#include <linux/slab.h>
#include <asm/uaccess.h>
u32 npc, status;
ret = -EFAULT;
- if (get_user(npc, unpc) || get_user(status, ustatus))
+ if (get_user(npc, unpc))
goto out;
/* check if this file was created by spu_create */
if (filp->f_op != &spufs_context_fops)
goto out;
- i = SPUFS_I(filp->f_dentry->d_inode);
- ret = spufs_run_spu(filp, i->i_ctx, &npc, &status);
+ i = SPUFS_I(filp->f_path.dentry->d_inode);
+ ret = spufs_run_spu(i->i_ctx, &npc, &status);
- if (put_user(npc, unpc) || put_user(status, ustatus))
+ if (put_user(npc, unpc))
ret = -EFAULT;
-out:
- return ret;
-}
-
-#ifndef MODULE
-asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
-{
- int fput_needed;
- struct file *filp;
- long ret;
-
- ret = -EBADF;
- filp = fget_light(fd, &fput_needed);
- if (filp) {
- ret = do_spu_run(filp, unpc, ustatus);
- fput_light(filp, fput_needed);
- }
+ if (ustatus && put_user(status, ustatus))
+ ret = -EFAULT;
+out:
return ret;
}
-#endif
-asmlinkage long sys_spu_create(const char __user *pathname,
- unsigned int flags, mode_t mode)
+static long do_spu_create(const char __user *pathname, unsigned int flags,
+ mode_t mode, struct file *neighbor)
{
char *tmp;
int ret;
if (!IS_ERR(tmp)) {
struct nameidata nd;
- ret = path_lookup(tmp, LOOKUP_PARENT|
- LOOKUP_OPEN|LOOKUP_CREATE, &nd);
+ ret = path_lookup(tmp, LOOKUP_PARENT, &nd);
if (!ret) {
- ret = spufs_create_thread(&nd, flags, mode);
- path_release(&nd);
+ nd.flags |= LOOKUP_OPEN | LOOKUP_CREATE;
+ ret = spufs_create(&nd, flags, mode, neighbor);
+ path_put(&nd.path);
}
putname(tmp);
}
}
struct spufs_calls spufs_calls = {
- .create_thread = sys_spu_create,
+ .create_thread = do_spu_create,
.spu_run = do_spu_run,
+ .coredump_extra_notes_size = spufs_coredump_extra_notes_size,
+ .coredump_extra_notes_write = spufs_coredump_extra_notes_write,
+ .notify_spus_active = do_notify_spus_active,
.owner = THIS_MODULE,
};