diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-01-23 10:08:44 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-01-27 15:28:10 +0100 |
commit | 52f6a4436f9da439fc687894b329898833af7ff8 (patch) | |
tree | 7d42835050b9876ae520fa4e02a9f697052bb79c /source3/smbd/process.c | |
parent | 4a2271349503933776f9d2791edfcb874a2c7261 (diff) | |
download | samba-52f6a4436f9da439fc687894b329898833af7ff8.tar.gz samba-52f6a4436f9da439fc687894b329898833af7ff8.tar.bz2 samba-52f6a4436f9da439fc687894b329898833af7ff8.zip |
s3:smbd: make kernel oplocks event driven
And use signal events for Linux oplocks.
metze
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r-- | source3/smbd/process.c | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 9527d94825..d617ef1915 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -742,46 +742,6 @@ void smbd_setup_sig_hup_handler(void) } } -/**************************************************************************** - Do all async processing in here. This includes kernel oplock messages, change - notify events etc. -****************************************************************************/ - -static void async_processing(void) -{ - DEBUG(10,("async_processing: Doing async processing.\n")); - - process_aio_queue(); - - process_kernel_oplocks(smbd_messaging_context()); - - /* Do the aio check again after receive_local_message as it does a - select and may have eaten our signal. */ - /* Is this till true? -- vl */ - process_aio_queue(); -} - -/**************************************************************************** - Do a select on an two fd's - with timeout. - - If a local udp message has been pushed onto the - queue (this can only happen during oplock break - processing) call async_processing() - - If a pending smb message has been pushed onto the - queue (this can only happen during oplock break - processing) return this next. - - If the first smbfd is ready then read an smb from it. - if the second (loopback UDP) fd is ready then read a message - from it and setup the buffer header to identify the length - and from address. - Returns False on timeout or error. - Else returns True. - -The timeout is in milliseconds -****************************************************************************/ - static NTSTATUS smbd_server_connection_loop_once(struct smbd_server_connection *conn) { fd_set r_fds, w_fds; @@ -800,26 +760,6 @@ static NTSTATUS smbd_server_connection_loop_once(struct smbd_server_connection * FD_ZERO(&w_fds); /* - * Ensure we process oplock break messages by preference. - * We have to do this before the select, after the select - * and if the select returns EINTR. This is due to the fact - * that the selects called from async_processing can eat an EINTR - * caused by a signal (we can't take the break message there). - * This is hideously complex - *MUST* be simplified for 3.0 ! JRA. - */ - - if (oplock_message_waiting()) { - DEBUG(10,("receive_message_or_smb: oplock_message is waiting.\n")); - async_processing(); - /* - * After async processing we must go and do the select again, as - * the state of the flag in fds for the server file descriptor is - * indeterminate - we may have done I/O on it in the oplock processing. JRA. - */ - return NT_STATUS_RETRY; - } - - /* * Are there any timed events waiting ? If so, ensure we don't * select for longer than it would take to wait for them. */ @@ -852,20 +792,6 @@ static NTSTATUS smbd_server_connection_loop_once(struct smbd_server_connection * return NT_STATUS_RETRY; } - /* if we get EINTR then maybe we have received an oplock - signal - treat this as select returning 1. This is ugly, but - is the best we can do until the oplock code knows more about - signals */ - if (selrtn == -1 && errno == EINTR) { - async_processing(); - /* - * After async processing we must go and do the select again, as - * the state of the flag in fds for the server file descriptor is - * indeterminate - we may have done I/O on it in the oplock processing. JRA. - */ - return NT_STATUS_RETRY; - } - /* Check if error */ if (selrtn == -1) { /* something is wrong. Maybe the socket is dead? */ |