[PATCH] files: lock-free fd look-up
[linux-2.6.git] / arch / mips / kernel / irixioctl.c
index 4cd3d38a22c254ce7fec677d85ca766d2986f07e..3cdc22346f4c75a69729810a668c0cb4aaafaf14 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/syscalls.h>
 #include <linux/tty.h>
 #include <linux/file.h>
+#include <linux/rcupdate.h>
 
 #include <asm/uaccess.h>
 #include <asm/ioctl.h>
@@ -33,7 +34,7 @@ static struct tty_struct *get_tty(int fd)
        struct file *filp;
        struct tty_struct *ttyp = NULL;
 
-       spin_lock(&current->files->file_lock);
+       rcu_read_lock();
        filp = fcheck(fd);
        if(filp && filp->private_data) {
                ttyp = (struct tty_struct *) filp->private_data;
@@ -41,7 +42,7 @@ static struct tty_struct *get_tty(int fd)
                if(ttyp->magic != TTY_MAGIC)
                        ttyp =NULL;
        }
-       spin_unlock(&current->files->file_lock);
+       rcu_read_unlock();
        return ttyp;
 }