diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-07-16 02:38:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 12:05:38 -0400 |
commit | c43990162fc7f9d2f15a12797fdc6f9c0905f704 (patch) | |
tree | 64f8b776c4807da48971f3c24ca157c5e6ab921f /arch/um/os-Linux/aio.c | |
parent | 42a359e31a0e438b5b978a8f0fecdbd3c86bb033 (diff) |
uml: simplify helper stack handling
run_helper and run_helper_thread had arguments which were the same in all
callers. run_helper's stack_out was always NULL and run_helper_thread's
stack_order was always 0. These are now gone, and the constants folded
into the code.
Also fixed leaks of the helper stack in the AIO and SIGIO code.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/aio.c')
-rw-r--r-- | arch/um/os-Linux/aio.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c index 9bf944f6a1db..b126df4ea168 100644 --- a/arch/um/os-Linux/aio.c +++ b/arch/um/os-Linux/aio.c | |||
@@ -177,6 +177,7 @@ static int do_not_aio(struct aio_thread_req *req) | |||
177 | static int aio_req_fd_r = -1; | 177 | static int aio_req_fd_r = -1; |
178 | static int aio_req_fd_w = -1; | 178 | static int aio_req_fd_w = -1; |
179 | static int aio_pid = -1; | 179 | static int aio_pid = -1; |
180 | static unsigned long aio_stack; | ||
180 | 181 | ||
181 | static int not_aio_thread(void *arg) | 182 | static int not_aio_thread(void *arg) |
182 | { | 183 | { |
@@ -212,7 +213,6 @@ static int not_aio_thread(void *arg) | |||
212 | 213 | ||
213 | static int init_aio_24(void) | 214 | static int init_aio_24(void) |
214 | { | 215 | { |
215 | unsigned long stack; | ||
216 | int fds[2], err; | 216 | int fds[2], err; |
217 | 217 | ||
218 | err = os_pipe(fds, 1, 1); | 218 | err = os_pipe(fds, 1, 1); |
@@ -227,7 +227,7 @@ static int init_aio_24(void) | |||
227 | goto out_close_pipe; | 227 | goto out_close_pipe; |
228 | 228 | ||
229 | err = run_helper_thread(not_aio_thread, NULL, | 229 | err = run_helper_thread(not_aio_thread, NULL, |
230 | CLONE_FILES | CLONE_VM | SIGCHLD, &stack, 0); | 230 | CLONE_FILES | CLONE_VM | SIGCHLD, &aio_stack); |
231 | if(err < 0) | 231 | if(err < 0) |
232 | goto out_close_pipe; | 232 | goto out_close_pipe; |
233 | 233 | ||
@@ -252,7 +252,6 @@ out: | |||
252 | #define DEFAULT_24_AIO 0 | 252 | #define DEFAULT_24_AIO 0 |
253 | static int init_aio_26(void) | 253 | static int init_aio_26(void) |
254 | { | 254 | { |
255 | unsigned long stack; | ||
256 | int err; | 255 | int err; |
257 | 256 | ||
258 | if(io_setup(256, &ctx)){ | 257 | if(io_setup(256, &ctx)){ |
@@ -263,7 +262,7 @@ static int init_aio_26(void) | |||
263 | } | 262 | } |
264 | 263 | ||
265 | err = run_helper_thread(aio_thread, NULL, | 264 | err = run_helper_thread(aio_thread, NULL, |
266 | CLONE_FILES | CLONE_VM | SIGCHLD, &stack, 0); | 265 | CLONE_FILES | CLONE_VM | SIGCHLD, &aio_stack); |
267 | if(err < 0) | 266 | if(err < 0) |
268 | return err; | 267 | return err; |
269 | 268 | ||
@@ -365,8 +364,10 @@ __initcall(init_aio); | |||
365 | 364 | ||
366 | static void exit_aio(void) | 365 | static void exit_aio(void) |
367 | { | 366 | { |
368 | if(aio_pid != -1) | 367 | if (aio_pid != -1) { |
369 | os_kill_process(aio_pid, 1); | 368 | os_kill_process(aio_pid, 1); |
369 | free_stack(aio_stack, 0); | ||
370 | } | ||
370 | } | 371 | } |
371 | 372 | ||
372 | __uml_exitcall(exit_aio); | 373 | __uml_exitcall(exit_aio); |