summaryrefslogtreecommitdiff
path: root/source3/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
commit5e5e320d361afcb4d9503354b3912b4c7a672197 (patch)
tree77b9557fe080a5e15d077d8e9fec3bae993356f7 /source3/include
parent74a2764726ce1047c79c7eaa84628901462a9b10 (diff)
downloadsamba-5e5e320d361afcb4d9503354b3912b4c7a672197.tar.gz
samba-5e5e320d361afcb4d9503354b3912b4c7a672197.tar.bz2
samba-5e5e320d361afcb4d9503354b3912b4c7a672197.zip
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. (This used to be commit d0e48a2d8072c3e77a57ac6a2fb5044c05f03b41)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/includes.h4
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/include/smb.h8
3 files changed, 15 insertions, 1 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 38f0719164..4efa475424 100644
--- a/source3/include/includes.h
+++ b/source3/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/source3/include/proto.h b/source3/include/proto.h
index a96092511f..85e00b375b 100644
--- a/source3/include/proto.h
+++ b/source3/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/source3/include/smb.h b/source3/include/smb.h
index 31e3b645b1..b615d09708 100644
--- a/source3/include/smb.h
+++ b/source3/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 */