svn commit: samba r17254 - in branches/SAMBA_3_0/source/smbd: .

vlendec at samba.org vlendec at samba.org
Wed Jul 26 08:08:48 GMT 2006


Author: vlendec
Date: 2006-07-26 08:08:48 +0000 (Wed, 26 Jul 2006)
New Revision: 17254

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17254

Log:
Simple flattening of an if-statement, no logic change.

Jeremy, I'm sure you will look at this nevertheless :-)

Volker
Modified:
   branches/SAMBA_3_0/source/smbd/open.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/open.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/open.c	2006-07-26 07:01:35 UTC (rev 17253)
+++ branches/SAMBA_3_0/source/smbd/open.c	2006-07-26 08:08:48 UTC (rev 17254)
@@ -625,6 +625,8 @@
 	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 @@
 		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,



More information about the samba-cvs mailing list