switch simple cases of fget_light to fdget
[deliverable/linux.git] / arch / powerpc / platforms / cell / spu_syscalls.c
index 714bbfc3162c9be85568b4f268e827311f91281f..db4e638cf4081cd813eeed56d7203548eda19134 100644 (file)
@@ -69,8 +69,6 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags,
        umode_t, mode, int, neighbor_fd)
 {
        long ret;
-       struct file *neighbor;
-       int fput_needed;
        struct spufs_calls *calls;
 
        calls = spufs_calls_get();
@@ -78,11 +76,11 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags,
                return -ENOSYS;
 
        if (flags & SPU_CREATE_AFFINITY_SPU) {
+               struct fd neighbor = fdget(neighbor_fd);
                ret = -EBADF;
-               neighbor = fget_light(neighbor_fd, &fput_needed);
-               if (neighbor) {
-                       ret = calls->create_thread(name, flags, mode, neighbor);
-                       fput_light(neighbor, fput_needed);
+               if (neighbor.file) {
+                       ret = calls->create_thread(name, flags, mode, neighbor.file);
+                       fdput(neighbor);
                }
        } else
                ret = calls->create_thread(name, flags, mode, NULL);
@@ -94,8 +92,7 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags,
 asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
 {
        long ret;
-       struct file *filp;
-       int fput_needed;
+       struct fd arg;
        struct spufs_calls *calls;
 
        calls = spufs_calls_get();
@@ -103,10 +100,10 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
                return -ENOSYS;
 
        ret = -EBADF;
-       filp = fget_light(fd, &fput_needed);
-       if (filp) {
-               ret = calls->spu_run(filp, unpc, ustatus);
-               fput_light(filp, fput_needed);
+       arg = fdget(fd);
+       if (arg.file) {
+               ret = calls->spu_run(arg.file, unpc, ustatus);
+               fdput(arg);
        }
 
        spufs_calls_put(calls);
This page took 0.025558 seconds and 5 git commands to generate.