summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-03-19 20:59:55 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-03-19 20:59:55 +0000
commit8ebb6244180d30d1d465eb8981a3faacfbf9b328 (patch)
tree19660653684ccef3a8d40f5fa3d4f34368098283 /libdiskfs
parent958479e856a937ab661bad3c2967e373e063cdb4 (diff)
(diskfs_S_dir_lookup): Check cache before normal diskfs_lookup call.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/dir-lookup.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c
index 59e850cd..8667fd3b 100644
--- a/libdiskfs/dir-lookup.c
+++ b/libdiskfs/dir-lookup.c
@@ -125,7 +125,24 @@ diskfs_S_dir_lookup (struct protid *dircred,
error = diskfs_lookup (dnp, path, CREATE, &np, ds, dircred);
}
else
- error = diskfs_lookup (dnp, path, LOOKUP, &np, 0, dircred);
+ {
+ /* XXX should be done in wrapper */
+ np = diskfs_check_cache (dnp, path);
+ if (np)
+ {
+ /* Verify that we were allowed in. XXX should be done
+ in wrapper for diskfs_lookup */
+ assert (S_ISDIR (dp->dn_stat.st_mode));
+ error = diskfs_access (dp, S_IEXEC, cred);
+ if (error)
+ {
+ diskfs_nrele (np);
+ np = 0;
+ }
+ }
+ else
+ error = diskfs_lookup (dnp, path, LOOKUP, &np, 0, dircred);
+ }
if (lastcomp && create && excl && (!error || error == EAGAIN))
error = EEXIST;