[PATCH 2/4] Remove duplication of fget()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



files rcu optimization: Remove duplicated fget from fget_light.

The code for fget is contained in fget_light. So call fget
instead.

Signed-off-by: Christoph Lameter <[email protected]>

Index: linux-2.6.17/fs/file_table.c
===================================================================
--- linux-2.6.17.orig/fs/file_table.c	2006-06-22 14:03:54.484771991 -0700
+++ linux-2.6.17/fs/file_table.c	2006-06-22 14:03:57.773630982 -0700
@@ -226,16 +226,9 @@ struct file fastcall *fget_light(unsigne
 	if (likely((atomic_read(&files->count) == 1))) {
 		file = fcheck_files(files, fd);
 	} else {
-		rcu_read_lock();
-		file = fcheck_files(files, fd);
-		if (file) {
-			if (atomic_inc_not_zero(&file->f_count))
-				*fput_needed = 1;
-			else
-				/* Didn't get the reference, someone's freed */
-				file = NULL;
-		}
-		rcu_read_unlock();
+		file = fget(fd);
+		if (file)
+			*fput_needed = 1;
 	}
 
 	return file;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux