From 8ebb6244180d30d1d465eb8981a3faacfbf9b328 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 19 Mar 1996 20:59:55 +0000 Subject: (diskfs_S_dir_lookup): Check cache before normal diskfs_lookup call. --- libdiskfs/dir-lookup.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'libdiskfs') 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; -- cgit v1.2.3