summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2012-03-30 15:31:19 +0200
committerJeremy Allison <jra@samba.org>2012-04-11 11:11:39 -0700
commit2a36408d4020b67d94f8750951bfead069ca1206 (patch)
treeddcd813e5b39b93cf161f2e37b1a18234837e44b
parent30203bda66259d78f07233854118f0f4a3ee673c (diff)
downloadsamba-2a36408d4020b67d94f8750951bfead069ca1206.tar.gz
samba-2a36408d4020b67d94f8750951bfead069ca1206.tar.bz2
samba-2a36408d4020b67d94f8750951bfead069ca1206.zip
s3:param convert kernel oplocks to share parameter
Signed-off-by: Jeremy Allison <jra@samba.org>
-rw-r--r--lib/param/param_functions.c1
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/param/loadparm.c11
-rw-r--r--source3/smbd/oplock.c2
4 files changed, 7 insertions, 9 deletions
diff --git a/lib/param/param_functions.c b/lib/param/param_functions.c
index ee865fd97c..cd85cb0d2d 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 34c9fe8e53..d32d2e8823 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 5d8c3a7680..41c29cb0b8 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 f760171c3a..d523da644d 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