提交 9683da91 编写于 作者: J Jeff Dike 提交者: Linus Torvalds

[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: NJeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6c59e2f5
...@@ -24,9 +24,6 @@ struct aio_thread_req { ...@@ -24,9 +24,6 @@ struct aio_thread_req {
struct aio_context *aio; struct aio_context *aio;
}; };
static int aio_req_fd_r = -1;
static int aio_req_fd_w = -1;
#if defined(HAVE_AIO_ABI) #if defined(HAVE_AIO_ABI)
#include <linux/aio_abi.h> #include <linux/aio_abi.h>
...@@ -111,6 +108,7 @@ static int do_aio(aio_context_t ctx, enum aio_type type, int fd, char *buf, ...@@ -111,6 +108,7 @@ static int do_aio(aio_context_t ctx, enum aio_type type, int fd, char *buf,
return err; return err;
} }
/* Initialized in an initcall and unchanged thereafter */
static aio_context_t ctx = 0; static aio_context_t ctx = 0;
static int aio_thread(void *arg) static int aio_thread(void *arg)
...@@ -137,7 +135,7 @@ static int aio_thread(void *arg) ...@@ -137,7 +135,7 @@ static int aio_thread(void *arg)
err = os_write_file(reply_fd, &reply, sizeof(reply)); err = os_write_file(reply_fd, &reply, sizeof(reply));
if(err != sizeof(reply)) if(err != sizeof(reply))
printk("aio_thread - write failed, fd = %d, " printk("aio_thread - write failed, fd = %d, "
"err = %d\n", aio_req_fd_r, -err); "err = %d\n", reply_fd, -err);
} }
} }
return 0; return 0;
...@@ -182,6 +180,11 @@ static int do_not_aio(struct aio_thread_req *req) ...@@ -182,6 +180,11 @@ static int do_not_aio(struct aio_thread_req *req)
return err; return err;
} }
/* These are initialized in initcalls and not changed */
static int aio_req_fd_r = -1;
static int aio_req_fd_w = -1;
static int aio_pid = -1;
static int not_aio_thread(void *arg) static int not_aio_thread(void *arg)
{ {
struct aio_thread_req req; struct aio_thread_req req;
...@@ -208,14 +211,12 @@ static int not_aio_thread(void *arg) ...@@ -208,14 +211,12 @@ static int not_aio_thread(void *arg)
err = os_write_file(req.aio->reply_fd, &reply, sizeof(reply)); err = os_write_file(req.aio->reply_fd, &reply, sizeof(reply));
if(err != sizeof(reply)) if(err != sizeof(reply))
printk("not_aio_thread - write failed, fd = %d, " printk("not_aio_thread - write failed, fd = %d, "
"err = %d\n", aio_req_fd_r, -err); "err = %d\n", req.aio->reply_fd, -err);
} }
return 0; return 0;
} }
static int aio_pid = -1;
static int init_aio_24(void) static int init_aio_24(void)
{ {
unsigned long stack; unsigned long stack;
...@@ -308,6 +309,7 @@ static int submit_aio_26(enum aio_type type, int io_fd, char *buf, int len, ...@@ -308,6 +309,7 @@ static int submit_aio_26(enum aio_type type, int io_fd, char *buf, int len,
} }
#endif #endif
/* Initialized in an initcall and unchanged thereafter */
static int aio_24 = DEFAULT_24_AIO; static int aio_24 = DEFAULT_24_AIO;
static int __init set_aio_24(char *name, int *add) static int __init set_aio_24(char *name, int *add)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册