aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fcntl.c
diff options
context:
space:
mode:
authorDipankar Sarma <dipankar@in.ibm.com>2005-09-09 16:04:14 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:55 -0400
commitb835996f628eadb55c5fb222ba46fe9395bf73c7 (patch)
treed63d80585d197e1ffc299af4a0034049790fb197 /fs/fcntl.c
parentab2af1f5005069321c5d130f09cce577b03f43ef (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 'fs/fcntl.c')
-rw-r--r--fs/fcntl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c
index d2f3ed8acd93..863b46e0d78a 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -40,10 +40,10 @@ static inline int get_close_on_exec(unsigned int fd)
40 struct files_struct *files = current->files; 40 struct files_struct *files = current->files;
41 struct fdtable *fdt; 41 struct fdtable *fdt;
42 int res; 42 int res;
43 spin_lock(&files->file_lock); 43 rcu_read_lock();
44 fdt = files_fdtable(files); 44 fdt = files_fdtable(files);
45 res = FD_ISSET(fd, fdt->close_on_exec); 45 res = FD_ISSET(fd, fdt->close_on_exec);
46 spin_unlock(&files->file_lock); 46 rcu_read_unlock();
47 return res; 47 return res;
48} 48}
49 49