From 5e5e320d361afcb4d9503354b3912b4c7a672197 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 27 Aug 1998 20:38:53 +0000 Subject: 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) --- source3/include/includes.h | 4 ++++ source3/include/proto.h | 4 +++- source3/include/smb.h | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'source3/include') 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 */ -- cgit