From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
NFS maillist <nfs@lists.sourceforge.net>
Subject: [PATCH] Support for cached lookups via readdirplus [5/6]
Date: Sun, 28 Jul 2002 17:26:31 +0200 [thread overview]
Message-ID: <15684.3367.337559.979006@charged.uio.no> (raw)
Enable lookups of negative dentries using READDIRPLUS.
If we find that the entire READDIR cache has been read, and we've seen
that no pages are missing, and that the EOF has been reached, then we
assume that the file does not exist.
Cheers,
Trond
diff -u --recursive --new-file linux-2.5.29-rdplus4/fs/nfs/dir.c linux-2.5.29-rdplus5/fs/nfs/dir.c
--- linux-2.5.29-rdplus4/fs/nfs/dir.c Sat Jul 27 19:15:50 2002
+++ linux-2.5.29-rdplus5/fs/nfs/dir.c Sat Jul 27 19:15:41 2002
@@ -614,9 +614,11 @@
d_add(dentry, inode);
nfs_renew_times(dentry);
error = 0;
+ goto out;
}
- goto out;
- }
+ nfs_zap_caches(dir);
+ } else if (error == -ENOENT)
+ goto no_entry;
error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, &fhandle, &fattr);
if (error == -ENOENT)
@@ -674,10 +676,10 @@
int res;
if (!NFS_USE_READDIRPLUS(dir))
- return -ENOENT;
+ return -ENOTSUPP;
server = NFS_SERVER(dir);
if (server->flags & NFS_MOUNT_NOAC)
- return -ENOENT;
+ return -EIO;
nfs_revalidate_inode(server, dir);
entry.fh = fh;
@@ -698,15 +700,19 @@
}
page_cache_release(page);
- if (res == 0)
- goto out_found;
- if (res != -EAGAIN)
- break;
+ switch (res) {
+ case 0:
+ fattr->timestamp = timestamp;
+ return 0;
+ case -ENOENT:
+ return -ENOENT;
+ case -EAGAIN:
+ continue;
+ default:
+ }
+ break;
}
- return -ENOENT;
- out_found:
- fattr->timestamp = timestamp;
- return 0;
+ return -EIO;
}
/*
reply other threads:[~2002-07-28 15:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=15684.3367.337559.979006@charged.uio.no \
--to=trond.myklebust@fys.uio.no \
--cc=linux-kernel@vger.kernel.org \
--cc=nfs@lists.sourceforge.net \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®