linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: linux-kernel@vger.kernel.org
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>,
	Jens Axboe <axboe@suse.de>, Dave Miller <davem@redhat.com>,
	Hugh Dickins <hugh@veritas.com>,
	linux-mm@kvack.org, Christoph Lameter <clameter@sgi.com>,
	Ingo Molnar <mingo@elte.hu>
Subject: [PATCH 2/4] Remove duplication of fget()
Date: Thu, 22 Jun 2006 14:31:12 -0700 (PDT)	[thread overview]
Message-ID: <20060622213112.32391.816.sendpatchset@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20060622213102.32391.19996.sendpatchset@schroedinger.engr.sgi.com>

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 <clameter@sgi.com>

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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2006-06-22 21:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-22 21:31 [PATCH 0/4] struct file RCU optimizations V2 Christoph Lameter
2006-06-22 21:31 ` [PATCH 1/4] Create files_init_early() Christoph Lameter
2006-06-22 21:31 ` Christoph Lameter [this message]
2006-06-22 21:31 ` [PATCH 3/4] Use SLAB_DESTROY_BY_RCU Christoph Lameter
2006-06-22 21:31 ` [PATCH 4/4] Drop rcu field Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060622213112.32391.816.sendpatchset@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=axboe@suse.de \
    --cc=davem@redhat.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox