From 2a36408d4020b67d94f8750951bfead069ca1206 Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Fri, 30 Mar 2012 15:31:19 +0200 Subject: [PATCH] s3:param convert kernel oplocks to share parameter Signed-off-by: Jeremy Allison --- lib/param/param_functions.c | 1 + source3/include/proto.h | 2 +- source3/param/loadparm.c | 11 ++++------- source3/smbd/oplock.c | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/param/param_functions.c b/lib/param/param_functions.c index ee865fd97cf6..cd85cb0d2ddd 100644 --- a/lib/param/param_functions.c +++ b/lib/param/param_functions.c @@ -104,6 +104,7 @@ FN_LOCAL_PARM_BOOL(locking, bLocking) FN_LOCAL_PARM_INTEGER(strict_locking, iStrictLocking) FN_LOCAL_PARM_BOOL(posix_locking, bPosixLocking) FN_LOCAL_BOOL(share_modes, bShareModes) +FN_LOCAL_BOOL(kernel_oplocks, bKernelOplocks) FN_LOCAL_BOOL(level2_oplocks, bLevel2OpLocks) FN_LOCAL_BOOL(onlyuser, bOnlyUser) FN_LOCAL_PARM_BOOL(manglednames, bMangledNames) diff --git a/source3/include/proto.h b/source3/include/proto.h index 34c9fe8e5376..d32d2e8823a5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1226,7 +1226,6 @@ bool lp_client_plaintext_auth(void); bool lp_client_lanman_auth(void); bool lp_client_ntlmv2_auth(void); bool lp_host_msdfs(void); -bool lp_kernel_oplocks(void); bool lp_enhanced_browsing(void); bool lp_use_mmap(void); bool lp_unix_extensions(void); @@ -1355,6 +1354,7 @@ int lp_strict_locking(const struct share_params *p ); bool lp_posix_locking(const struct share_params *p ); bool lp_share_modes(int ); bool lp_oplocks(int ); +bool lp_kernel_oplocks(int ); bool lp_level2_oplocks(int ); bool lp_onlyuser(int ); bool lp_manglednames(const struct share_params *p ); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 5d8c3a7680d0..41c29cb0b892 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -230,6 +230,7 @@ static struct loadparm_service sDefault = .bPosixLocking = true, .bShareModes = true, .bOpLocks = true, + .bKernelOplocks = true, .bLevel2OpLocks = true, .bOnlyUser = false, .bMangledNames = true, @@ -3109,11 +3110,11 @@ static struct parm_struct parm_table[] = { { .label = "kernel oplocks", .type = P_BOOL, - .p_class = P_GLOBAL, - .offset = GLOBAL_VAR(bKernelOplocks), + .p_class = P_LOCAL, + .offset = LOCAL_VAR(bKernelOplocks), .special = NULL, .enum_list = NULL, - .flags = FLAG_ADVANCED | FLAG_GLOBAL, + .flags = FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL, }, { .label = "locking", @@ -4892,9 +4893,6 @@ static void init_globals(bool reinit_globals) Globals.bDNSproxy = true; - /* this just means to use them if they exist */ - Globals.bKernelOplocks = true; - Globals.bAllowTrustedDomains = true; string_set(&Globals.szIdmapBackend, "tdb"); @@ -5260,7 +5258,6 @@ FN_GLOBAL_BOOL(lp_client_plaintext_auth, bClientPlaintextAuth) FN_GLOBAL_BOOL(lp_client_lanman_auth, bClientLanManAuth) FN_GLOBAL_BOOL(lp_client_ntlmv2_auth, bClientNTLMv2Auth) FN_GLOBAL_BOOL(lp_host_msdfs, bHostMSDfs) -FN_GLOBAL_BOOL(lp_kernel_oplocks, bKernelOplocks) FN_GLOBAL_BOOL(lp_enhanced_browsing, enhanced_browsing) FN_GLOBAL_BOOL(lp_use_mmap, bUseMmap) FN_GLOBAL_BOOL(lp_unix_extensions, bUnixExtensions) diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index f760171c3a27..d523da644dfc 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -978,7 +978,7 @@ bool init_oplocks(struct smbd_server_connection *sconn) messaging_register(sconn->msg_ctx, sconn, MSG_SMB_OPEN_RETRY, process_open_retry_message); - if (lp_kernel_oplocks()) { + if (lp_kernel_oplocks(-1)) { #if HAVE_KERNEL_OPLOCKS_IRIX koplocks = irix_init_kernel_oplocks(sconn); #elif HAVE_KERNEL_OPLOCKS_LINUX -- 2.34.1