summaryrefslogtreecommitdiff
path: root/source/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-08-27 20:38:53 +0000
committerJeremy Allison <jra@samba.org>1998-08-27 20:38:53 +0000
commitd0e48a2d8072c3e77a57ac6a2fb5044c05f03b41 (patch)
tree8f51fb0e5b4ce8b76b4b2b834b1f8aa5246daaa8 /source/include
parentcdc38c276d8344127c9edf35f24754c098a90754 (diff)
downloadsamba-d0e48a2d8072c3e77a57ac6a2fb5044c05f03b41.tar.gz
This is the stat cache code - seems to work fine (needs heavy
NetBench testing though.... :-). Attempts to efficiently reduce the number of stat() calls Samba does. Jeremy.
Diffstat (limited to 'source/include')
-rw-r--r--source/include/includes.h4
-rw-r--r--source/include/proto.h4
-rw-r--r--source/include/smb.h8
3 files changed, 15 insertions, 1 deletions
diff --git a/source/include/includes.h b/source/include/includes.h
index 38f07191647..4efa475424b 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -419,6 +419,10 @@ union semun {
#define HAVE_NETGROUP 1
#endif
+#if defined (HAVE_NETGROUP) && defined(HAVE_RPCSVC_YPCLNT_H)
+#include "rpcsvc/ypclnt.h"
+#endif
+
#ifndef ALLOW_CHANGE_PASSWORD
#if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
#define ALLOW_CHANGE_PASSWORD 1
diff --git a/source/include/proto.h b/source/include/proto.h
index a96092511f4..85e00b375bc 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -2000,7 +2000,9 @@ void sync_file(connection_struct *conn, files_struct *fsp);
BOOL fname_equal(char *name1, char *name2);
BOOL mangled_equal(char *name1, char *name2);
-BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, BOOL *bad_path);
+void print_stat_cache_statistics(void);
+BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component,
+ BOOL *bad_path, struct stat *pst);
BOOL check_name(char *name,connection_struct *conn);
BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache);
diff --git a/source/include/smb.h b/source/include/smb.h
index 31e3b645b11..b615d097083 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -908,6 +908,14 @@ struct bitmap {
#define IS_VETO_PATH(conn,path) ((conn) && is_in_path((path),(conn)->veto_list))
#define IS_VETO_OPLOCK_PATH(conn,path) ((conn) && is_in_path((path),(conn)->veto_oplock_list))
+/*
+ * Used by the stat cache code to check if a returned
+ * stat structure is valid.
+ */
+
+#define VALID_STAT(st) (st.st_nlink != 0)
+#define VALID_STAT_OF_DIR(st) (VALID_STAT(st) && S_ISDIR(st.st_mode))
+
#define SMBENCRYPT() (lp_encrypted_passwords())
/* the basic packet size, assuming no words or bytes */