aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-02-10 04:44:27 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:24 -0500
commit9683da91e2db323ee728041576e29ad7fa9547b9 (patch)
tree2f069f830727382bd8581691195aaa9addfdd9de /arch/um
parent6c59e2f593d0c00c78ec48146de6eaf52a342dd5 (diff)
[PATCH] uml: AIO locking and tidying
Comment the lack of locking of data that's set up once at boot time. Also fixed a couple of bogus printks. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/os-Linux/aio.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c
index f897140cc4ae..6ff12743a0bd 100644
--- a/arch/um/os-Linux/aio.c
+++ b/arch/um/os-Linux/aio.c
@@ -24,9 +24,6 @@ struct aio_thread_req {
24 struct aio_context *aio; 24 struct aio_context *aio;
25}; 25};
26 26
27static int aio_req_fd_r = -1;
28static int aio_req_fd_w = -1;
29
30#if defined(HAVE_AIO_ABI) 27#if defined(HAVE_AIO_ABI)
31#include <linux/aio_abi.h> 28#include <linux/aio_abi.h>
32 29
@@ -111,6 +108,7 @@ static int do_aio(aio_context_t ctx, enum aio_type type, int fd, char *buf,
111 return err; 108 return err;
112} 109}
113 110
111/* Initialized in an initcall and unchanged thereafter */
114static aio_context_t ctx = 0; 112static aio_context_t ctx = 0;
115 113
116static int aio_thread(void *arg) 114static int aio_thread(void *arg)
@@ -137,7 +135,7 @@ static int aio_thread(void *arg)
137 err = os_write_file(reply_fd, &reply, sizeof(reply)); 135 err = os_write_file(reply_fd, &reply, sizeof(reply));
138 if(err != sizeof(reply)) 136 if(err != sizeof(reply))
139 printk("aio_thread - write failed, fd = %d, " 137 printk("aio_thread - write failed, fd = %d, "
140 "err = %d\n", aio_req_fd_r, -err); 138 "err = %d\n", reply_fd, -err);
141 } 139 }
142 } 140 }
143 return 0; 141 return 0;
@@ -182,6 +180,11 @@ out:
182 return err; 180 return err;
183} 181}
184 182
183/* These are initialized in initcalls and not changed */
184static int aio_req_fd_r = -1;
185static int aio_req_fd_w = -1;
186static int aio_pid = -1;
187
185static int not_aio_thread(void *arg) 188static int not_aio_thread(void *arg)
186{ 189{
187 struct aio_thread_req req; 190 struct aio_thread_req req;
@@ -208,14 +211,12 @@ static int not_aio_thread(void *arg)
208 err = os_write_file(req.aio->reply_fd, &reply, sizeof(reply)); 211 err = os_write_file(req.aio->reply_fd, &reply, sizeof(reply));
209 if(err != sizeof(reply)) 212 if(err != sizeof(reply))
210 printk("not_aio_thread - write failed, fd = %d, " 213 printk("not_aio_thread - write failed, fd = %d, "
211 "err = %d\n", aio_req_fd_r, -err); 214 "err = %d\n", req.aio->reply_fd, -err);
212 } 215 }
213 216
214 return 0; 217 return 0;
215} 218}
216 219
217static int aio_pid = -1;
218
219static int init_aio_24(void) 220static int init_aio_24(void)
220{ 221{
221 unsigned long stack; 222 unsigned long stack;
@@ -308,6 +309,7 @@ static int submit_aio_26(enum aio_type type, int io_fd, char *buf, int len,
308} 309}
309#endif 310#endif
310 311
312/* Initialized in an initcall and unchanged thereafter */
311static int aio_24 = DEFAULT_24_AIO; 313static int aio_24 = DEFAULT_24_AIO;
312 314
313static int __init set_aio_24(char *name, int *add) 315static int __init set_aio_24(char *name, int *add)