提交 e98fa281 编写于 作者: D Daniel Walker 提交者: Linus Torvalds

uml: mconsole mutex conversion

The plug_mem_mutex is already used as a mutex since it's using
DECLARE_MUTEX(), but the underlying construct is still a semaphore ..  This
patch switches it over to a struct mutex.
Signed-off-by: NDaniel Walker <dwalker@mvista.com>
Signed-off-by: NJeff Dike <jdike@linux.intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 01ac835f
......@@ -17,6 +17,7 @@
#include "linux/syscalls.h"
#include "linux/utsname.h"
#include "linux/workqueue.h"
#include "linux/mutex.h"
#include "asm/uaccess.h"
#include "init.h"
#include "irq_kern.h"
......@@ -360,7 +361,7 @@ struct unplugged_pages {
void *pages[UNPLUGGED_PER_PAGE];
};
static DECLARE_MUTEX(plug_mem_mutex);
static DEFINE_MUTEX(plug_mem_mutex);
static unsigned long long unplugged_pages_count = 0;
static LIST_HEAD(unplugged_pages);
static int unplug_index = UNPLUGGED_PER_PAGE;
......@@ -396,7 +397,7 @@ static int mem_config(char *str, char **error_out)
diff /= PAGE_SIZE;
down(&plug_mem_mutex);
mutex_lock(&plug_mem_mutex);
for (i = 0; i < diff; i++) {
struct unplugged_pages *unplugged;
void *addr;
......@@ -453,7 +454,7 @@ static int mem_config(char *str, char **error_out)
err = 0;
out_unlock:
up(&plug_mem_mutex);
mutex_unlock(&plug_mem_mutex);
out:
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册