diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-07-26 08:08:48 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:38:22 -0500 |
commit | 31802698db7e2b48f01bbb0ce540e38653cd8517 (patch) | |
tree | 1ae1e9a0e3d7f95ea65197e5bcc4adeaf48e19e5 | |
parent | 999b1e01e1ee55338ff96ddf80c3852038216108 (diff) | |
download | samba-31802698db7e2b48f01bbb0ce540e38653cd8517.tar.gz samba-31802698db7e2b48f01bbb0ce540e38653cd8517.tar.bz2 samba-31802698db7e2b48f01bbb0ce540e38653cd8517.zip |
r17254: Simple flattening of an if-statement, no logic change.
Jeremy, I'm sure you will look at this nevertheless :-)
Volker
(This used to be commit 3ef34468b55771b6f6b54454fa6c9decc183c565)
-rw-r--r-- | source3/smbd/open.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 9bd4e36d5a..ef59da6447 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -625,6 +625,8 @@ static BOOL delay_for_oplocks(struct share_mode_lock *lck, BOOL valid_entry = False; BOOL delay_it = False; BOOL have_level2 = False; + BOOL ret; + char msg[MSG_SMB_SHARE_MODE_ENTRY_SIZE]; if (oplock_request & INTERNAL_OPEN_ONLY) { fsp->oplock_type = NO_OPLOCK; @@ -688,34 +690,38 @@ static BOOL delay_for_oplocks(struct share_mode_lock *lck, fsp->oplock_type = FAKE_LEVEL_II_OPLOCK; } - if (delay_it) { - BOOL ret; - char msg[MSG_SMB_SHARE_MODE_ENTRY_SIZE]; + if (!delay_it) { + return False; + } - DEBUG(10, ("Sending break request to PID %s\n", - procid_str_static(&exclusive->pid))); - exclusive->op_mid = get_current_mid(); + /* + * Send a break message to the oplock holder and delay the open for + * our client. + */ - /* Create the message. */ - share_mode_entry_to_message(msg, exclusive); + DEBUG(10, ("Sending break request to PID %s\n", + procid_str_static(&exclusive->pid))); + exclusive->op_mid = get_current_mid(); - /* Add in the FORCE_OPLOCK_BREAK_TO_NONE bit in the message if set. We don't - want this set in the share mode struct pointed to by lck. */ + /* Create the message. */ + share_mode_entry_to_message(msg, exclusive); - if (oplock_request & FORCE_OPLOCK_BREAK_TO_NONE) { - SSVAL(msg,6,exclusive->op_type | FORCE_OPLOCK_BREAK_TO_NONE); - } + /* Add in the FORCE_OPLOCK_BREAK_TO_NONE bit in the message if set. We + don't want this set in the share mode struct pointed to by lck. */ - become_root(); - ret = message_send_pid(exclusive->pid, MSG_SMB_BREAK_REQUEST, - msg, MSG_SMB_SHARE_MODE_ENTRY_SIZE, True); - unbecome_root(); - if (!ret) { - DEBUG(3, ("Could not send oplock break message\n")); - } + if (oplock_request & FORCE_OPLOCK_BREAK_TO_NONE) { + SSVAL(msg,6,exclusive->op_type | FORCE_OPLOCK_BREAK_TO_NONE); } - return delay_it; + become_root(); + ret = message_send_pid(exclusive->pid, MSG_SMB_BREAK_REQUEST, + msg, MSG_SMB_SHARE_MODE_ENTRY_SIZE, True); + unbecome_root(); + if (!ret) { + DEBUG(3, ("Could not send oplock break message\n")); + } + + return True; } static BOOL request_timed_out(struct timeval request_time, |