summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2012-03-30 15:51:25 +0200
committerJeremy Allison <jra@samba.org>2012-04-11 11:11:39 -0700
commit1d9a3d488db2a9575ea1dc954c4d14b7d0a20204 (patch)
tree7562a3bfbbd07f4548f1879d2ca4a2b9fa66801b /source3
parent639a775866230fd1fb1a44d0f4e27522d9ade93a (diff)
downloadsamba-1d9a3d488db2a9575ea1dc954c4d14b7d0a20204.tar.gz
samba-1d9a3d488db2a9575ea1dc954c4d14b7d0a20204.tar.bz2
samba-1d9a3d488db2a9575ea1dc954c4d14b7d0a20204.zip
s3:smbd add seperate function to initialize kernel oplocks
Signed-off-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-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 */