diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-28 12:52:22 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 22:20:08 -0400 |
commit | 2903ff019b346ab8d36ebbf54853c3aaf6590608 (patch) | |
tree | 962d94054765bb37bc00e977c3036e65c5fd91fe /arch/powerpc/platforms/cell | |
parent | a5b470ba06aa3f96999ede5feba178df6bdb134a (diff) |
switch simple cases of fget_light to fdget
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/powerpc/platforms/cell')
-rw-r--r-- | arch/powerpc/platforms/cell/spu_syscalls.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c index 714bbfc3162..db4e638cf40 100644 --- a/arch/powerpc/platforms/cell/spu_syscalls.c +++ b/arch/powerpc/platforms/cell/spu_syscalls.c | |||
@@ -69,8 +69,6 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags, | |||
69 | umode_t, mode, int, neighbor_fd) | 69 | umode_t, mode, int, neighbor_fd) |
70 | { | 70 | { |
71 | long ret; | 71 | long ret; |
72 | struct file *neighbor; | ||
73 | int fput_needed; | ||
74 | struct spufs_calls *calls; | 72 | struct spufs_calls *calls; |
75 | 73 | ||
76 | calls = spufs_calls_get(); | 74 | calls = spufs_calls_get(); |
@@ -78,11 +76,11 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags, | |||
78 | return -ENOSYS; | 76 | return -ENOSYS; |
79 | 77 | ||
80 | if (flags & SPU_CREATE_AFFINITY_SPU) { | 78 | if (flags & SPU_CREATE_AFFINITY_SPU) { |
79 | struct fd neighbor = fdget(neighbor_fd); | ||
81 | ret = -EBADF; | 80 | ret = -EBADF; |
82 | neighbor = fget_light(neighbor_fd, &fput_needed); | 81 | if (neighbor.file) { |
83 | if (neighbor) { | 82 | ret = calls->create_thread(name, flags, mode, neighbor.file); |
84 | ret = calls->create_thread(name, flags, mode, neighbor); | 83 | fdput(neighbor); |
85 | fput_light(neighbor, fput_needed); | ||
86 | } | 84 | } |
87 | } else | 85 | } else |
88 | ret = calls->create_thread(name, flags, mode, NULL); | 86 | ret = calls->create_thread(name, flags, mode, NULL); |
@@ -94,8 +92,7 @@ SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags, | |||
94 | asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus) | 92 | asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus) |
95 | { | 93 | { |
96 | long ret; | 94 | long ret; |
97 | struct file *filp; | 95 | struct fd arg; |
98 | int fput_needed; | ||
99 | struct spufs_calls *calls; | 96 | struct spufs_calls *calls; |
100 | 97 | ||
101 | calls = spufs_calls_get(); | 98 | calls = spufs_calls_get(); |
@@ -103,10 +100,10 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus) | |||
103 | return -ENOSYS; | 100 | return -ENOSYS; |
104 | 101 | ||
105 | ret = -EBADF; | 102 | ret = -EBADF; |
106 | filp = fget_light(fd, &fput_needed); | 103 | arg = fdget(fd); |
107 | if (filp) { | 104 | if (arg.file) { |
108 | ret = calls->spu_run(filp, unpc, ustatus); | 105 | ret = calls->spu_run(arg.file, unpc, ustatus); |
109 | fput_light(filp, fput_needed); | 106 | fdput(arg); |
110 | } | 107 | } |
111 | 108 | ||
112 | spufs_calls_put(calls); | 109 | spufs_calls_put(calls); |