From 31802698db7e2b48f01bbb0ce540e38653cd8517 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 26 Jul 2006 08:08:48 +0000 Subject: 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) --- source3/smbd/open.c | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'source3') 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, -- cgit