/* number of open connections */
static int num_connections_open = 0;
-#ifdef USE_OPLOCKS
/* Oplock ipc UDP socket. */
int oplock_sock = -1;
uint16 oplock_port = 0;
/* Current number of oplocks we have outstanding. */
int32 global_oplocks_open = 0;
-#endif /* USE_OPLOCKS */
BOOL global_oplock_break = False;
{
min_share_mode_entry *share_entry = &old_shares[i];
-#ifdef USE_OPLOCKS
/*
* Break oplocks before checking share modes. See comment in
* open_file_shared for details.
broke_oplock = True;
break;
}
-#endif /* USE_OPLOCKS */
/* someone else has a share lock on it, check to see
if we can too */
{
min_share_mode_entry *share_entry = &old_shares[i];
-#ifdef USE_OPLOCKS
/*
* By observation of NetBench, oplocks are broken *before* share
* modes are checked. This allows a file to be closed by the client
broke_oplock = True;
break;
}
-#endif /* USE_OPLOCKS */
/* someone else has a share lock on it, check to see
if we can too */
if (lp_share_modes(SNUM(cnum)))
{
uint16 port = 0;
-#ifdef USE_OPLOCKS
/* JRA. Currently this only services Exlcusive and batch
oplocks (no other opens on this file). This needs to
be extended to level II oplocks (multiple reader
port = 0;
oplock_request = 0;
}
-#else /* USE_OPLOCKS */
- oplock_request = 0;
- port = 0;
-#endif /* USE_OPLOCKS */
set_share_mode(token, fnum, port, oplock_request);
}
trans_num++;
}
-#ifdef USE_OPLOCKS
/****************************************************************************
open the oplock IPC socket communication
****************************************************************************/
return True;
}
-#endif /* USE_OPLOCKS */
-
/****************************************************************************
check if a snum is in use
****************************************************************************/
int counter;
int last_keepalive=0;
int service_load_counter = 0;
-#ifdef USE_OPLOCKS
BOOL got_smb = False;
-#endif /* USE_OPLOCKS */
if (deadtime <= 0)
deadtime = DEFAULT_SMBD_TIMEOUT;
errno = 0;
for (counter=SMBD_SELECT_LOOP;
-#ifdef USE_OPLOCKS
!receive_message_or_smb(Client,oplock_sock,
InBuffer,BUFFER_SIZE,SMBD_SELECT_LOOP*1000,&got_smb);
-#else /* USE_OPLOCKS */
- !receive_smb(Client,InBuffer,SMBD_SELECT_LOOP*1000);
-#endif /* USE_OPLOCKS */
counter += SMBD_SELECT_LOOP)
{
int i;
}
}
-#ifdef USE_OPLOCKS
if(got_smb)
-#endif /* USE_OPLOCKS */
process_smb(InBuffer, OutBuffer);
-#ifdef USE_OPLOCKS
else
process_local_message(oplock_sock, InBuffer, BUFFER_SIZE);
-#endif /* USE_OPLOCKS */
}
}
DEBUG(2,("%s changed root to %s\n",timestring(),lp_rootdir()));
}
-#ifdef USE_OPLOCKS
/* Setup the oplock IPC socket. */
if(!open_oplock_ipc())
exit(1);
-#endif /* USE_OPLOCKS */
process();
close_sockets();