diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/sys-i386/ldt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c index 505ed5c9a68d..a34263e6b08d 100644 --- a/arch/um/sys-i386/ldt.c +++ b/arch/um/sys-i386/ldt.c | |||
@@ -147,7 +147,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) | |||
147 | if (ptrace_ldt) | 147 | if (ptrace_ldt) |
148 | return read_ldt_from_host(ptr, bytecount); | 148 | return read_ldt_from_host(ptr, bytecount); |
149 | 149 | ||
150 | down(&ldt->semaphore); | 150 | mutex_lock(&ldt->lock); |
151 | if (ldt->entry_count <= LDT_DIRECT_ENTRIES) { | 151 | if (ldt->entry_count <= LDT_DIRECT_ENTRIES) { |
152 | size = LDT_ENTRY_SIZE*LDT_DIRECT_ENTRIES; | 152 | size = LDT_ENTRY_SIZE*LDT_DIRECT_ENTRIES; |
153 | if (size > bytecount) | 153 | if (size > bytecount) |
@@ -171,7 +171,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) | |||
171 | ptr += size; | 171 | ptr += size; |
172 | } | 172 | } |
173 | } | 173 | } |
174 | up(&ldt->semaphore); | 174 | mutex_unlock(&ldt->lock); |
175 | 175 | ||
176 | if (bytecount == 0 || err == -EFAULT) | 176 | if (bytecount == 0 || err == -EFAULT) |
177 | goto out; | 177 | goto out; |
@@ -229,7 +229,7 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int func) | |||
229 | } | 229 | } |
230 | 230 | ||
231 | if (!ptrace_ldt) | 231 | if (!ptrace_ldt) |
232 | down(&ldt->semaphore); | 232 | mutex_lock(&ldt->lock); |
233 | 233 | ||
234 | err = write_ldt_entry(mm_idp, func, &ldt_info, &addr, 1); | 234 | err = write_ldt_entry(mm_idp, func, &ldt_info, &addr, 1); |
235 | if (err) | 235 | if (err) |
@@ -289,7 +289,7 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int func) | |||
289 | err = 0; | 289 | err = 0; |
290 | 290 | ||
291 | out_unlock: | 291 | out_unlock: |
292 | up(&ldt->semaphore); | 292 | mutex_unlock(&ldt->lock); |
293 | out: | 293 | out: |
294 | return err; | 294 | return err; |
295 | } | 295 | } |
@@ -396,7 +396,7 @@ long init_new_ldt(struct mm_context *new_mm, struct mm_context *from_mm) | |||
396 | 396 | ||
397 | 397 | ||
398 | if (!ptrace_ldt) | 398 | if (!ptrace_ldt) |
399 | init_MUTEX(&new_mm->ldt.semaphore); | 399 | mutex_init(&new_mm->ldt.lock); |
400 | 400 | ||
401 | if (!from_mm) { | 401 | if (!from_mm) { |
402 | memset(&desc, 0, sizeof(desc)); | 402 | memset(&desc, 0, sizeof(desc)); |
@@ -456,7 +456,7 @@ long init_new_ldt(struct mm_context *new_mm, struct mm_context *from_mm) | |||
456 | * i.e., we have to use the stub for modify_ldt, which | 456 | * i.e., we have to use the stub for modify_ldt, which |
457 | * can't handle the big read buffer of up to 64kB. | 457 | * can't handle the big read buffer of up to 64kB. |
458 | */ | 458 | */ |
459 | down(&from_mm->ldt.semaphore); | 459 | mutex_lock(&from_mm->ldt.lock); |
460 | if (from_mm->ldt.entry_count <= LDT_DIRECT_ENTRIES) | 460 | if (from_mm->ldt.entry_count <= LDT_DIRECT_ENTRIES) |
461 | memcpy(new_mm->ldt.u.entries, from_mm->ldt.u.entries, | 461 | memcpy(new_mm->ldt.u.entries, from_mm->ldt.u.entries, |
462 | sizeof(new_mm->ldt.u.entries)); | 462 | sizeof(new_mm->ldt.u.entries)); |
@@ -475,7 +475,7 @@ long init_new_ldt(struct mm_context *new_mm, struct mm_context *from_mm) | |||
475 | } | 475 | } |
476 | } | 476 | } |
477 | new_mm->ldt.entry_count = from_mm->ldt.entry_count; | 477 | new_mm->ldt.entry_count = from_mm->ldt.entry_count; |
478 | up(&from_mm->ldt.semaphore); | 478 | mutex_unlock(&from_mm->ldt.lock); |
479 | } | 479 | } |
480 | 480 | ||
481 | out: | 481 | out: |