summaryrefslogtreecommitdiff
path: root/source3/smbd/blocking.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-08 12:03:45 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-08 12:22:21 +0100
commit3dde0cbb769b92d922be13677ad076cae9b6a693 (patch)
tree78594e39465f545c7252eaef7bc469ceb80c4d71 /source3/smbd/blocking.c
parentdefb574c2573a73335a2735e89e4cb5f96c4c069 (diff)
downloadsamba-3dde0cbb769b92d922be13677ad076cae9b6a693.tar.gz
samba-3dde0cbb769b92d922be13677ad076cae9b6a693.tar.bz2
samba-3dde0cbb769b92d922be13677ad076cae9b6a693.zip
s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure. metze
Diffstat (limited to 'source3/smbd/blocking.c')
-rw-r--r--source3/smbd/blocking.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index 2b90d24c87..cccc5ce727 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -18,6 +18,8 @@
*/
#include "includes.h"
+#include "smbd/globals.h"
+
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_LOCKING
@@ -41,15 +43,6 @@ typedef struct blocking_lock_record {
struct smb_request *req;
} blocking_lock_record;
-/* dlink list we store pending lock records on. */
-static blocking_lock_record *blocking_lock_queue;
-
-/* dlink list we move cancelled lock records onto. */
-static blocking_lock_record *blocking_lock_cancelled_queue;
-
-/* The event that makes us process our blocking lock queue */
-static struct timed_event *brl_timeout;
-
/****************************************************************************
Determine if this is a secondary element of a chained SMB.
**************************************************************************/
@@ -148,7 +141,6 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
uint64_t count,
uint32_t blocking_pid)
{
- static bool set_lock_msg;
blocking_lock_record *blr;
NTSTATUS status;
@@ -211,10 +203,10 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
recalc_brl_timeout();
/* Ensure we'll receive messages when this is unlocked. */
- if (!set_lock_msg) {
+ if (!blocking_lock_unlock_state) {
messaging_register(smbd_messaging_context(), NULL,
MSG_SMB_UNLOCK, received_unlock_msg);
- set_lock_msg = True;
+ blocking_lock_unlock_state = true;
}
DEBUG(3,("push_blocking_lock_request: lock request blocked with "
@@ -784,17 +776,16 @@ bool blocking_lock_cancel(files_struct *fsp,
unsigned char locktype,
NTSTATUS err)
{
- static bool initialized;
char msg[MSG_BLOCKING_LOCK_CANCEL_SIZE];
blocking_lock_record *blr;
- if (!initialized) {
+ if (!blocking_lock_cancel_state) {
/* Register our message. */
messaging_register(smbd_messaging_context(), NULL,
MSG_SMB_BLOCKING_LOCK_CANCEL,
process_blocking_lock_cancel_message);
- initialized = True;
+ blocking_lock_cancel_state = True;
}
for (blr = blocking_lock_queue; blr; blr = blr->next) {