summaryrefslogtreecommitdiff
path: root/source3/smbd/statcache.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-10-06 18:13:52 +0000
committerJeremy Allison <jra@samba.org>2000-10-06 18:13:52 +0000
commitba00796e6dd13b87b7988a98e532676d9eab702c (patch)
tree6b53b1fae2ca229ab654bbff46b2e4dd7c4e489f /source3/smbd/statcache.c
parent08657e539e4cd4105057a9c12db30dbe4bbfcb1d (diff)
downloadsamba-ba00796e6dd13b87b7988a98e532676d9eab702c.tar.gz
samba-ba00796e6dd13b87b7988a98e532676d9eab702c.tar.bz2
samba-ba00796e6dd13b87b7988a98e532676d9eab702c.zip
Herb's warning fixes. Also the POSIX locking fix.
We now use our own vfs layer to do get/set acl calls (hurrah!). Jeremy. (This used to be commit dfe77c7046cbd65ee52aea7439f21503c1eac41d)
Diffstat (limited to 'source3/smbd/statcache.c')
-rw-r--r--source3/smbd/statcache.c33
1 files changed, 6 insertions, 27 deletions
diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c
index b66c5e2fe9..8d756a1d46 100644
--- a/source3/smbd/statcache.c
+++ b/source3/smbd/statcache.c
@@ -30,28 +30,6 @@ extern BOOL case_sensitive;
Stat cache code used in unix_convert.
*****************************************************************************/
-static int global_stat_cache_lookups;
-static int global_stat_cache_misses;
-static int global_stat_cache_hits;
-
-/****************************************************************************
- Stat cache statistics code.
-*****************************************************************************/
-
-void print_stat_cache_statistics(void)
-{
- double eff;
-
- if(global_stat_cache_lookups == 0)
- return;
-
- eff = (100.0* (double)global_stat_cache_hits)/(double)global_stat_cache_lookups;
-
- DEBUG(0,("stat cache stats: lookups = %d, hits = %d, misses = %d, \
-stat cache was %f%% effective.\n", global_stat_cache_lookups,
- global_stat_cache_hits, global_stat_cache_misses, eff ));
-}
-
typedef struct {
int name_len;
char names[2]; /* This is extended via malloc... */
@@ -175,13 +153,14 @@ BOOL stat_cache_lookup(connection_struct *conn, char *name, char *dirpath,
namelen = strlen(name);
*start = name;
- global_stat_cache_lookups++;
+
+ DO_PROFILE_INC(statcache_lookups);
/*
* Don't lookup trivial valid directory entries.
*/
if((*name == '\0') || (strcmp(name, ".") == 0) || (strcmp(name, "..") == 0)) {
- global_stat_cache_misses++;
+ DO_PROFILE_INC(statcache_misses);
return False;
}
@@ -202,17 +181,17 @@ BOOL stat_cache_lookup(connection_struct *conn, char *name, char *dirpath,
/*
* We reached the end of the name - no match.
*/
- global_stat_cache_misses++;
+ DO_PROFILE_INC(statcache_misses);
return False;
}
if((*chk_name == '\0') || (strcmp(chk_name, ".") == 0)
|| (strcmp(chk_name, "..") == 0)) {
- global_stat_cache_misses++;
+ DO_PROFILE_INC(statcache_misses);
return False;
}
} else {
scp = (stat_cache_entry *)(hash_elem->value);
- global_stat_cache_hits++;
+ DO_PROFILE_INC(statcache_hits);
trans_name = scp->names+scp->name_len+1;
if(conn->vfs_ops.stat(conn,dos_to_unix(trans_name,False), pst) != 0) {
/* Discard this entry - it doesn't exist in the filesystem. */