summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-07-17 09:56:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:00:07 -0500
commit3c6e5f6d47dd8c86b9b5d1aaca9d9042c500f511 (patch)
tree6afafcbf2d282a609a6e5a004462d787fe58b259 /source3/smbd
parentf5bf5765af07f04ff6fcf5615c2e09fc468aff5f (diff)
downloadsamba-3c6e5f6d47dd8c86b9b5d1aaca9d9042c500f511.tar.gz
samba-3c6e5f6d47dd8c86b9b5d1aaca9d9042c500f511.tar.bz2
samba-3c6e5f6d47dd8c86b9b5d1aaca9d9042c500f511.zip
r8521: Another micro-step: Don't pass down a flag where not necessary.
Volker (This used to be commit 5f51b72ec7abea3588f76d22a8daa434cdf90eb0)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/oplock.c30
1 files 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. */