[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>
This commit is contained in:

committed by
Linus Torvalds

parent
ab2af1f500
commit
b835996f62
@@ -1652,7 +1652,7 @@ static inline void flush_unauthorized_files(struct files_struct * files)
|
||||
continue;
|
||||
}
|
||||
if (devnull) {
|
||||
atomic_inc(&devnull->f_count);
|
||||
rcuref_inc(&devnull->f_count);
|
||||
} else {
|
||||
devnull = dentry_open(dget(selinux_null), mntget(selinuxfs_mount), O_RDWR);
|
||||
if (!devnull) {
|
||||
|
Reference in New Issue
Block a user