r8521: Another micro-step: Don't pass down a flag where not necessary.
authorVolker Lendecke <vlendec@samba.org>
Sun, 17 Jul 2005 09:56:25 +0000 (09:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:00:07 +0000 (11:00 -0500)
Volker

source/smbd/oplock.c

index 2e6789267b19a817d11a9767f6947b3dcefdc768..6ee2454fab224067c6f36bf335f64d9a02f6191b 100644 (file)
@@ -526,24 +526,22 @@ static void prepare_break_message(char *outbuf, files_struct *fsp, BOOL level2)
  Function to do the waiting before sending a local break.
 ****************************************************************************/
 
-static void wait_before_sending_break(BOOL local_request)
+static void wait_before_sending_break(void)
 {
-       if(local_request) {
-               struct timeval cur_tv;
-               long wait_left = (long)lp_oplock_break_wait_time();
+       struct timeval cur_tv;
+       long wait_left = (long)lp_oplock_break_wait_time();
 
-               if (wait_left == 0)
-                       return;
+       if (wait_left == 0)
+               return;
 
-               GetTimeOfDay(&cur_tv);
+       GetTimeOfDay(&cur_tv);
 
-               wait_left -= ((cur_tv.tv_sec - smb_last_time.tv_sec)*1000) +
+       wait_left -= ((cur_tv.tv_sec - smb_last_time.tv_sec)*1000) +
                 ((cur_tv.tv_usec - smb_last_time.tv_usec)/1000);
 
-               if(wait_left > 0) {
-                       wait_left = MIN(wait_left, 1000);
-                       sys_usleep(wait_left * 1000);
-               }
+       if(wait_left > 0) {
+               wait_left = MIN(wait_left, 1000);
+               sys_usleep(wait_left * 1000);
        }
 }
 
@@ -633,7 +631,9 @@ static BOOL oplock_break_level2(files_struct *fsp, BOOL local_request)
                 * and has reported to cause problems on NT. JRA.
                 */
 
-               wait_before_sending_break(local_request);
+               if (local_request) {
+                       wait_before_sending_break();
+               }
 
                /* Prepare the SMBlockingX message. */
                prepare_break_message( outbuf, fsp, False);
@@ -770,7 +770,9 @@ static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, unsigned long file_id,
         * and has reported to cause problems on NT. JRA.
         */
 
-       wait_before_sending_break(local_request);
+       if (local_request) {
+               wait_before_sending_break();
+       }
 
        /* Prepare the SMBlockingX message. */