]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/ldt_64.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / ldt_64.c
index bc9ffd5c19cc6d19f628cd8e70c8b0390da2a642..60e57abb8e902cf0084a309b35e14a57d655f64f 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * linux/arch/x86_64/kernel/ldt.c
- *
  * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds
  * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
  * Copyright (C) 2002 Andi Kleen
@@ -98,13 +96,13 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
        struct mm_struct * old_mm;
        int retval = 0;
 
-       init_MUTEX(&mm->context.sem);
+       mutex_init(&mm->context.lock);
        mm->context.size = 0;
        old_mm = current->mm;
        if (old_mm && old_mm->context.size > 0) {
-               down(&old_mm->context.sem);
+               mutex_lock(&old_mm->context.lock);
                retval = copy_ldt(&mm->context, &old_mm->context);
-               up(&old_mm->context.sem);
+               mutex_unlock(&old_mm->context.lock);
        }
        return retval;
 }
@@ -135,7 +133,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount)
        if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES)
                bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES;
 
-       down(&mm->context.sem);
+       mutex_lock(&mm->context.lock);
        size = mm->context.size*LDT_ENTRY_SIZE;
        if (size > bytecount)
                size = bytecount;
@@ -143,7 +141,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount)
        err = 0;
        if (copy_to_user(ptr, mm->context.ldt, size))
                err = -EFAULT;
-       up(&mm->context.sem);
+       mutex_unlock(&mm->context.lock);
        if (err < 0)
                goto error_return;
        if (size != bytecount) {
@@ -195,7 +193,7 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode)
                        goto out;
        }
 
-       down(&mm->context.sem);
+       mutex_lock(&mm->context.lock);
        if (ldt_info.entry_number >= (unsigned)mm->context.size) {
                error = alloc_ldt(&current->mm->context, ldt_info.entry_number+1, 1);
                if (error < 0)
@@ -225,7 +223,7 @@ install:
        error = 0;
 
 out_unlock:
-       up(&mm->context.sem);
+       mutex_unlock(&mm->context.lock);
 out:
        return error;
 }