summaryrefslogtreecommitdiff
path: root/source3/smbd/statcache.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-09-09 04:07:32 +0000
committerGerald Carter <jerry@samba.org>2003-09-09 04:07:32 +0000
commit4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8 (patch)
treedd0a9f32d9933e1f75d919b5083e007d7453f9c4 /source3/smbd/statcache.c
parent3d7cb49747a9a7f5cdec0ee05c6270ec3604202f (diff)
downloadsamba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.tar.gz
samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.tar.bz2
samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.zip
sync 3.0 into HEAD for the last time
(This used to be commit c17a7dc9a190156a069da3e861c18fd3f81224ad)
Diffstat (limited to 'source3/smbd/statcache.c')
-rw-r--r--source3/smbd/statcache.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c
index fbebdb240f..948173687d 100644
--- a/source3/smbd/statcache.c
+++ b/source3/smbd/statcache.c
@@ -66,11 +66,12 @@ void stat_cache_add( const char *full_orig_name, const char *orig_translated_pat
return;
/*
- * Don't cache trivial valid directory entries.
+ * Don't cache trivial valid directory entries such as . and ..
*/
- if((*full_orig_name == '\0') || (strcmp(full_orig_name, ".") == 0) ||
- (strcmp(full_orig_name, "..") == 0))
+ if((*full_orig_name == '\0') || (full_orig_name[0] == '.' &&
+ ((full_orig_name[1] == '\0') ||
+ (full_orig_name[1] == '.' && full_orig_name[1] == '\0'))))
return;
/*
@@ -216,10 +217,10 @@ BOOL stat_cache_lookup(connection_struct *conn, pstring name, pstring dirpath,
/*
* Don't lookup trivial valid directory entries.
*/
- if((*name == '\0') || (strcmp(name, ".") == 0) || (strcmp(name, "..") == 0)) {
- DO_PROFILE_INC(statcache_misses);
+ if((*name == '\0') || (name[0] == '.' &&
+ ((name[1] == '\0') ||
+ (name[1] == '.' && name[1] == '\0'))))
return False;
- }
if (case_sensitive) {
chk_name = strdup(name);
@@ -247,6 +248,7 @@ BOOL stat_cache_lookup(connection_struct *conn, pstring name, pstring dirpath,
while (1) {
hash_elem = hash_lookup(&stat_cache, chk_name);
if(hash_elem == NULL) {
+ DEBUG(10,("stat_cache_lookup: lookup failed for name [%s]\n", chk_name ));
/*
* Didn't find it - remove last component for next try.
*/
@@ -276,6 +278,7 @@ BOOL stat_cache_lookup(connection_struct *conn, pstring name, pstring dirpath,
}
} else {
scp = (stat_cache_entry *)(hash_elem->value);
+ DEBUG(10,("stat_cache_lookup: lookup succeeded for name [%s] -> [%s]\n", chk_name, scp->translated_path ));
DO_PROFILE_INC(statcache_hits);
if(SMB_VFS_STAT(conn,scp->translated_path, pst) != 0) {
/* Discard this entry - it doesn't exist in the filesystem. */