From 3c6e5f6d47dd8c86b9b5d1aaca9d9042c500f511 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 17 Jul 2005 09:56:25 +0000 Subject: r8521: Another micro-step: Don't pass down a flag where not necessary. Volker (This used to be commit 5f51b72ec7abea3588f76d22a8daa434cdf90eb0) --- source3/smbd/oplock.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 2e6789267b..6ee2454fab 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -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. */ -- cgit