mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fabian Frederick <Fabian.Frederick@skynet.be>
To: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.6.5-mm4] vfs_readdir optimizations
Date: Wed, 14 Apr 2004 21:47:13 +0200	[thread overview]
Message-ID: <1081972032.5445.30.camel@bluerhyme.real3> (raw)

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

-Remove unuseful gotos
-ENOENT case on DEADDIR

PS : mm5 doesn't appear on kernel.org main page.

Regards,
Fabian


[-- Attachment #2: readdir1.diff --]
[-- Type: text/x-patch, Size: 874 bytes --]

diff -Naur orig/fs/readdir.c edited/fs/readdir.c
--- orig/fs/readdir.c	2004-04-04 05:37:06.000000000 +0200
+++ edited/fs/readdir.c	2004-04-12 17:25:36.000000000 +0200
@@ -21,21 +21,16 @@
 {
 	struct inode *inode = file->f_dentry->d_inode;
 	int res = -ENOTDIR;
-	if (!file->f_op || !file->f_op->readdir)
-		goto out;
-
-	res = security_file_permission(file, MAY_READ);
-	if (res)
-		goto out;
-
-	down(&inode->i_sem);
-	res = -ENOENT;
-	if (!IS_DEADDIR(inode)) {
-		res = file->f_op->readdir(file, buf, filler);
-		file_accessed(file);
+	if (file->f_op && file->f_op->readdir){
+		if (!(res = security_file_permission(file, MAY_READ))){
+			down(&inode->i_sem);
+			if (!IS_DEADDIR(inode)) {
+				res = file->f_op->readdir(file, buf, filler);
+				file_accessed(file);
+			}else   res = -ENOENT;
+			up(&inode->i_sem);
+		}
 	}
-	up(&inode->i_sem);
-out:
 	return res;
 }
 

             reply	other threads:[~2004-04-14 19:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-14 19:47 Fabian Frederick [this message]
2004-04-14 20:15 ` Chris Wright

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=1081972032.5445.30.camel@bluerhyme.real3 \
    --to=fabian.frederick@skynet.be \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®