summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-09-30 01:05:51 +0000
committerJeremy Allison <jra@samba.org>1998-09-30 01:05:51 +0000
commit5a8458c377b6901b67a039eafbd5727ed1207cf3 (patch)
treed988e90d87ee84a39e557099623db3ca9d9634fa /source3/param
parent9a5f40cadfa827d56b3ca0ae4b792b860d332b4f (diff)
downloadsamba-5a8458c377b6901b67a039eafbd5727ed1207cf3.tar.gz
samba-5a8458c377b6901b67a039eafbd5727ed1207cf3.tar.bz2
samba-5a8458c377b6901b67a039eafbd5727ed1207cf3.zip
libsmb/clientgen.c: Fixed signed/unsigned compile warnings spotted by Herb.
param/loadparm.c: smbd/oplock.c: Allow kernel oplocks to be turned off in the smb.conf file. smbd/server.c: Move init_structs() to after the smb.conf file is loaded - preparation for making a "max open files" parameter. Jeremy. (This used to be commit 6a261517a09b005f502a37941431308fa8bf2c5c)
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 05ed6484ac..5cba2c95d5 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -915,10 +915,10 @@ static void init_globals(void)
Globals.bDNSproxy = True;
/*
- * smbd will check after starting to see if this value
- * should be set to "true" or not.
+ * smbd will check at runtime to see if this value
+ * will really be used or not.
*/
- lp_set_kernel_oplocks(False);
+ Globals.bKernelOplocks = True;
/*
* This must be done last as it checks the value in
@@ -1163,7 +1163,6 @@ FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug)
FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat)
FN_GLOBAL_BOOL(lp_nt_smb_support,&Globals.bNTSmbSupport)
FN_GLOBAL_BOOL(lp_stat_cache,&Globals.bStatCache)
-FN_GLOBAL_BOOL(lp_kernel_oplocks,&Globals.bKernelOplocks)
FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level)
FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl)
@@ -2668,10 +2667,32 @@ void lp_set_name_resolve_order(char *new_order)
}
/***********************************************************
- Set the real value of kernel oplocks (called by smbd).
+ Set the flag that says if kernel oplocks are available
+ (called by smbd).
************************************************************/
+static BOOL kernel_oplocks_available = False;
+
void lp_set_kernel_oplocks(BOOL val)
{
- Globals.bKernelOplocks = val;
+ /*
+ * Only set this to True if kerenl
+ * oplocks are really available and were
+ * turned on in the smb.conf file.
+ */
+
+ if(Globals.bKernelOplocks && val)
+ kernel_oplocks_available = True;
+ else
+ kernel_oplocks_available = False;
+}
+
+/***********************************************************
+ Return True if kernel oplocks are available and were turned
+ on in smb.conf.
+************************************************************/
+
+BOOL lp_kernel_oplocks(void)
+{
+ return kernel_oplocks_available;
}