* [PATCH] Support for cached lookups via readdirplus [5/6]
@ 2002-07-28 15:26 Trond Myklebust
0 siblings, 0 replies; only message in thread
From: Trond Myklebust @ 2002-07-28 15:26 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Linux Kernel, NFS maillist
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;
}
/*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-07-28 15:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-28 15:26 [PATCH] Support for cached lookups via readdirplus [5/6] Trond Myklebust
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®