diff options
author | Dipankar Sarma <dipankar@in.ibm.com> | 2005-09-09 16:04:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:57:55 -0400 |
commit | b835996f628eadb55c5fb222ba46fe9395bf73c7 (patch) | |
tree | d63d80585d197e1ffc299af4a0034049790fb197 /arch/mips/kernel/irixioctl.c | |
parent | ab2af1f5005069321c5d130f09cce577b03f43ef (diff) |
[PATCH] files: lock-free fd look-up
With the use of RCU in files structure, the look-up of files using fds can now
be lock-free. The lookup is protected by rcu_read_lock()/rcu_read_unlock().
This patch changes the readers to use lock-free lookup.
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Ravikiran Thirumalai <kiran_th@gmail.com>
Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/mips/kernel/irixioctl.c')
-rw-r--r-- | arch/mips/kernel/irixioctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/mips/kernel/irixioctl.c b/arch/mips/kernel/irixioctl.c index 4cd3d38a22c2..3cdc22346f4c 100644 --- a/arch/mips/kernel/irixioctl.c +++ b/arch/mips/kernel/irixioctl.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/syscalls.h> | 14 | #include <linux/syscalls.h> |
15 | #include <linux/tty.h> | 15 | #include <linux/tty.h> |
16 | #include <linux/file.h> | 16 | #include <linux/file.h> |
17 | #include <linux/rcupdate.h> | ||
17 | 18 | ||
18 | #include <asm/uaccess.h> | 19 | #include <asm/uaccess.h> |
19 | #include <asm/ioctl.h> | 20 | #include <asm/ioctl.h> |
@@ -33,7 +34,7 @@ static struct tty_struct *get_tty(int fd) | |||
33 | struct file *filp; | 34 | struct file *filp; |
34 | struct tty_struct *ttyp = NULL; | 35 | struct tty_struct *ttyp = NULL; |
35 | 36 | ||
36 | spin_lock(¤t->files->file_lock); | 37 | rcu_read_lock(); |
37 | filp = fcheck(fd); | 38 | filp = fcheck(fd); |
38 | if(filp && filp->private_data) { | 39 | if(filp && filp->private_data) { |
39 | ttyp = (struct tty_struct *) filp->private_data; | 40 | ttyp = (struct tty_struct *) filp->private_data; |
@@ -41,7 +42,7 @@ static struct tty_struct *get_tty(int fd) | |||
41 | if(ttyp->magic != TTY_MAGIC) | 42 | if(ttyp->magic != TTY_MAGIC) |
42 | ttyp =NULL; | 43 | ttyp =NULL; |
43 | } | 44 | } |
44 | spin_unlock(¤t->files->file_lock); | 45 | rcu_read_unlock(); |
45 | return ttyp; | 46 | return ttyp; |
46 | } | 47 | } |
47 | 48 | ||