]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/cell/spufs/syscalls.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6] / arch / powerpc / platforms / cell / spufs / syscalls.c
index 3f71bb5e9d8ec3d877e9aaba30fcc6cf8a957fae..8e37bdf4dfdad4e7633540126a0227a35df7b2da 100644 (file)
@@ -29,7 +29,9 @@
  * value of the spu_status register after the SPU has stopped.
  *
  */
-long do_spu_run(struct file *filp, __u32 __user *unpc, __u32 __user *ustatus)
+static long do_spu_run(struct file *filp,
+                       __u32 __user *unpc,
+                       __u32 __user *ustatus)
 {
        long ret;
        struct spufs_inode_info *i;
@@ -39,16 +41,14 @@ long do_spu_run(struct file *filp, __u32 __user *unpc, __u32 __user *ustatus)
        if (get_user(npc, unpc))
                goto out;
 
+       /* check if this file was created by spu_create */
        ret = -EINVAL;
-       if (filp->f_vfsmnt->mnt_sb->s_magic != SPUFS_MAGIC)
+       if (filp->f_op != &spufs_context_fops)
                goto out;
 
-       i = SPUFS_I(filp->f_dentry->d_inode);
+       i = SPUFS_I(filp->f_path.dentry->d_inode);
        ret = spufs_run_spu(filp, i->i_ctx, &npc, &status);
 
-       if (ret ==-EAGAIN || ret == -EIO)
-               ret = status;
-
        if (put_user(npc, unpc))
                ret = -EFAULT;
 
@@ -90,7 +90,7 @@ asmlinkage long sys_spu_create(const char __user *pathname,
                ret = path_lookup(tmp, LOOKUP_PARENT|
                                LOOKUP_OPEN|LOOKUP_CREATE, &nd);
                if (!ret) {
-                       ret = spufs_create_thread(&nd, pathname, flags, mode);
+                       ret = spufs_create(&nd, flags, mode);
                        path_release(&nd);
                }
                putname(tmp);