Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83229
b: refs/heads/master
c: 01ac835
h: refs/heads/master
i:
  83227: 697ca41
v: v3
  • Loading branch information
Daniel Walker authored and Linus Torvalds committed Feb 5, 2008
1 parent 6266f86 commit 5a9eb42
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2278c5ac9d39699bac44250b9c532de0c02cb16a
refs/heads/master: 01ac835fdd121f36dded404af15225101f6ccee3
14 changes: 7 additions & 7 deletions trunk/arch/um/sys-i386/ldt.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount)
if (ptrace_ldt)
return read_ldt_from_host(ptr, bytecount);

down(&ldt->semaphore);
mutex_lock(&ldt->lock);
if (ldt->entry_count <= LDT_DIRECT_ENTRIES) {
size = LDT_ENTRY_SIZE*LDT_DIRECT_ENTRIES;
if (size > bytecount)
Expand All @@ -171,7 +171,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount)
ptr += size;
}
}
up(&ldt->semaphore);
mutex_unlock(&ldt->lock);

if (bytecount == 0 || err == -EFAULT)
goto out;
Expand Down Expand Up @@ -229,7 +229,7 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int func)
}

if (!ptrace_ldt)
down(&ldt->semaphore);
mutex_lock(&ldt->lock);

err = write_ldt_entry(mm_idp, func, &ldt_info, &addr, 1);
if (err)
Expand Down Expand Up @@ -289,7 +289,7 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int func)
err = 0;

out_unlock:
up(&ldt->semaphore);
mutex_unlock(&ldt->lock);
out:
return err;
}
Expand Down Expand Up @@ -396,7 +396,7 @@ long init_new_ldt(struct mm_context *new_mm, struct mm_context *from_mm)


if (!ptrace_ldt)
init_MUTEX(&new_mm->ldt.semaphore);
mutex_init(&new_mm->ldt.lock);

if (!from_mm) {
memset(&desc, 0, sizeof(desc));
Expand Down Expand Up @@ -456,7 +456,7 @@ long init_new_ldt(struct mm_context *new_mm, struct mm_context *from_mm)
* i.e., we have to use the stub for modify_ldt, which
* can't handle the big read buffer of up to 64kB.
*/
down(&from_mm->ldt.semaphore);
mutex_lock(&from_mm->ldt.lock);
if (from_mm->ldt.entry_count <= LDT_DIRECT_ENTRIES)
memcpy(new_mm->ldt.u.entries, from_mm->ldt.u.entries,
sizeof(new_mm->ldt.u.entries));
Expand All @@ -475,7 +475,7 @@ long init_new_ldt(struct mm_context *new_mm, struct mm_context *from_mm)
}
}
new_mm->ldt.entry_count = from_mm->ldt.entry_count;
up(&from_mm->ldt.semaphore);
mutex_unlock(&from_mm->ldt.lock);
}

out:
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/asm-um/ldt.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef __ASM_LDT_H
#define __ASM_LDT_H

#include "asm/semaphore.h"
#include <linux/mutex.h>
#include "asm/host_ldt.h"

extern void ldt_host_info(void);
Expand All @@ -27,7 +27,7 @@ struct ldt_entry {

typedef struct uml_ldt {
int entry_count;
struct semaphore semaphore;
struct mutex lock;
union {
struct ldt_entry * pages[LDT_PAGES_MAX];
struct ldt_entry entries[LDT_DIRECT_ENTRIES];
Expand Down

0 comments on commit 5a9eb42

Please sign in to comment.