summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/oplock.c10
-rw-r--r--source3/smbd/proto.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index d523da644d..c619edc5b9 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -978,7 +978,13 @@ 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(-1)) {
+ return true;
+}
+
+void init_kernel_oplocks(struct smbd_server_connection *sconn)
+{
+ /* only initialize once */
+ if (koplocks == NULL) {
#if HAVE_KERNEL_OPLOCKS_IRIX
koplocks = irix_init_kernel_oplocks(sconn);
#elif HAVE_KERNEL_OPLOCKS_LINUX
@@ -988,6 +994,4 @@ bool init_oplocks(struct smbd_server_connection *sconn)
koplocks = onefs_init_kernel_oplocks(sconn);
#endif
}
-
- return True;
}
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 5ab5185087..f2040cdbac 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -673,6 +673,7 @@ void smbd_contend_level2_oplocks_end(files_struct *fsp,
void share_mode_entry_to_message(char *msg, const struct share_mode_entry *e);
void message_to_share_mode_entry(struct share_mode_entry *e, char *msg);
bool init_oplocks(struct smbd_server_connection *sconn);
+void init_kernel_oplocks(struct smbd_server_connection *sconn);
/* The following definitions come from smbd/oplock_irix.c */