cm_racingRevokes_t *rp;
lock_ObtainWrite(&cm_callbackLock);
+
+ osi_Log3(afsd_logp, "RecordRacingRevoke Volume %d Flags %lX activeCalls %d",
+ fidp->volume, cancelFlags, cm_activeCallbackGrantingCalls);
+
if (cm_activeCallbackGrantingCalls > 0) {
rp = malloc(sizeof(*rp));
memset(rp, 0, sizeof(*rp));
*/
void cm_CallbackNotifyChange(cm_scache_t *scp)
{
+ osi_Log2(afsd_logp, "CallbackNotifyChange FileType %d Flags %lX",
+ scp->fileType, scp->flags);
+
if (scp->fileType == CM_SCACHETYPE_DIRECTORY) {
if (scp->flags & CM_SCACHEFLAG_ANYWATCH)
smb_NotifyChange(0,
tfid.unique = fidp->Unique;
hash = CM_SCACHE_HASH(&tfid);
- osi_Log3(afsd_logp, "Revoke callback vol %d vn %d un %d",
+ osi_Log3(afsd_logp, "RevokeCallback vol %d vn %d un %d",
fidp->Volume, fidp->Vnode, fidp->Unique);
/* do this first, so that if we're executing a callback granting call
scp->fid.unique == tfid.unique) {
scp->refCount++;
lock_ReleaseWrite(&cm_scacheLock);
- osi_Log1(afsd_logp, "Revoke scp %x", scp);
+ osi_Log1(afsd_logp, "Discarding SCache scp %x", scp);
lock_ObtainMutex(&scp->mx);
cm_DiscardSCache(scp);
lock_ReleaseMutex(&scp->mx);
cm_scache_t *scp;
cm_fid_t tfid;
+ osi_Log1(afsd_logp, "RevokeVolumeCallback %d", fidp->Volume);
+
/* do this first, so that if we're executing a callback granting call
* at this moment, we kill it before it can be merged in. Otherwise,
* it could complete while we're doing the scan below, and get missed
tfid.volume = fidp->Volume;
cm_RecordRacingRevoke(&tfid, CM_RACINGFLAG_CANCELVOL);
- osi_Log1(afsd_logp, "Revoke Volume %d", fidp->Volume);
lock_ObtainWrite(&cm_scacheLock);
for(hash = 0; hash < cm_hashTableSize; hash++) {
scp->refCount++;
lock_ReleaseWrite(&cm_scacheLock);
lock_ObtainMutex(&scp->mx);
+ osi_Log1(afsd_logp, "Discarding SCache scp %x", scp);
cm_DiscardSCache(scp);
lock_ReleaseMutex(&scp->mx);
cm_CallbackNotifyChange(scp);
int i;
AFSFid *tfidp;
+ osi_Log0(afsd_logp, "SRXAFSCB_CallBack");
+
for(i=0; i < (long) fidsArrayp->AFSCBFids_len; i++) {
tfidp = &fidsArrayp->AFSCBFids_val[i];
- if (tfidp->Volume == 0) continue; /* means don't do anything */
+ if (tfidp->Volume == 0)
+ continue; /* means don't do anything */
else if (tfidp->Vnode == 0)
cm_RevokeVolumeCallback(callp, tfidp);
- else cm_RevokeCallback(callp, tfidp);
+ else
+ cm_RevokeCallback(callp, tfidp);
}
return 0;
int hash;
int discarded;
+ osi_Log0(afsd_logp, "SRXAFSCB_InitCallBackState");
+
if ((rx_ConnectionOf(callp)) && (rx_PeerOf(rx_ConnectionOf(callp)))) {
taddr.sin_family = AF_INET;
taddr.sin_addr.s_addr = rx_HostOf(rx_PeerOf(rx_ConnectionOf(callp)));
if (scp->cbServerp != NULL) {
/* we have a callback, now decide if we should clear it */
if (scp->cbServerp == tsp || tsp == NULL) {
+ osi_Log1(afsd_logp, "Discarding SCache scp %x", scp);
cm_DiscardSCache(scp);
discarded = 1;
}
/* just returns if we're up */
SRXAFSCB_Probe(struct rx_call *callp)
{
+ osi_Log0(afsd_logp, "SRXAFSCB_Probe - not implemented");
return 0;
}
SRXAFSCB_GetCE64(struct rx_call *callp, long index, AFSDBCacheEntry *cep)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_GetCE64 - not implemented");
return RXGEN_OPCODE;
}
SRXAFSCB_GetLock(struct rx_call *callp, long index, AFSDBLock *lockp)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_GetLock - not implemented");
return RXGEN_OPCODE;
}
SRXAFSCB_GetCE(struct rx_call *callp, long index, AFSDBCacheEntry *cep)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_GetCE - not implemented");
return RXGEN_OPCODE;
}
SRXAFSCB_XStatsVersion(struct rx_call *callp, long *vp)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_XStatsVersion - not implemented");
*vp = -1;
return RXGEN_OPCODE;
}
AFSCB_CollData *datap)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_GetXStats - not implemented");
return RXGEN_OPCODE;
}
SRXAFSCB_InitCallBackState2(struct rx_call *callp, struct interfaceAddr* addr)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_InitCallBackState2 - not implemented");
return RXGEN_OPCODE;
}
SRXAFSCB_WhoAreYou(struct rx_call *callp, struct interfaceAddr* addr)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_WhoAreYou - not implemented");
return RXGEN_OPCODE;
}
SRXAFSCB_InitCallBackState3(struct rx_call *callp, afsUUID* serverUuid)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_InitCallBackState3 - not implemented");
return RXGEN_OPCODE;
}
SRXAFSCB_ProbeUuid(struct rx_call *callp, afsUUID* clientUuid)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_ProbeUuid - not implemented");
return RXGEN_OPCODE;
}
afs_int32 *a_srvr_addr,
afs_int32 *a_srvr_rank)
{
+ osi_Log0(afsd_logp, "SRXAFSCB_GetServerPrefs - not implemented");
+
*a_srvr_addr = 0xffffffff;
*a_srvr_rank = 0xffffffff;
return 0;
{
char *t_name;
+ osi_Log0(afsd_logp, "SRXAFSCB_GetCellServDB - not implemented");
+
t_name = (char *)malloc(AFSNAMEMAX);
t_name[0] = '\0';
*a_name = t_name;
{
char *t_name;
+ osi_Log0(afsd_logp, "SRXAFSCB_GetLocalCell");
+
if (cm_rootCellp) {
t_name = (char *)malloc(strlen(cm_rootCellp->namep)+1);
strcpy(t_name, cm_rootCellp->namep);
size_t allocsize;
extern cm_initparams_v1 cm_initParams;
+ osi_Log0(afsd_logp, "SRXAFSCB_GetCacheConfig - version 1 only");
+
/*
* Currently only support version 1
*/
*/
if (scp && cbrp->callbackCount != cm_callbackCount
&& revp->callbackCount > cbrp->callbackCount
- && (
- (scp->fid.volume == revp->fid.volume &&
+ && (( scp->fid.volume == revp->fid.volume &&
scp->fid.vnode == revp->fid.vnode &&
scp->fid.unique == revp->fid.unique)
||
long sflags;
cm_fid_t sfid;
+ osi_Log2(afsd_logp, "GetCallback scp %x flags %lX", scp, flags);
+
#ifdef AFS_FREELANCE_CLIENT
// yj
// The case where a callback is needed on /afs is handled
return 0;
}
- if (scp->fid.cell==0x1 && scp->fid.volume==AFS_FAKE_ROOT_VOL_ID) {
+ if (scp->fid.cell==AFS_FAKE_ROOT_CELL_ID && scp->fid.volume==AFS_FAKE_ROOT_VOL_ID) {
osi_Log0(afsd_logp,"cm_getcallback should NEVER EVER get here... ");
}
// yj: end of getcallback modifications ---------------
cm_scache_t *scp;
long now;
+ osi_Log0(afsd_logp, "CheckCBExpiration");
+
now = osi_Time();
lock_ObtainWrite(&cm_scacheLock);
for(i=0; i<cm_hashTableSize; i++) {
lock_ReleaseWrite(&cm_scacheLock);
lock_ObtainMutex(&scp->mx);
if (scp->cbServerp && now > scp->cbExpires) {
+ osi_Log1(afsd_logp, "Discarding SCache scp %x", scp);
cm_DiscardSCache(scp);
}
lock_ReleaseMutex(&scp->mx);
char **a_name, serverList *a_hosts)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_GetCellByNum - not implemented");
return RXGEN_OPCODE;
}
char **a_name, serverList *a_hosts)
{
/* XXXX */
+ osi_Log0(afsd_logp, "SRXAFSCB_TellMeAboutYourself - not implemented");
return RXGEN_OPCODE;
}
NCB *NCBs[NCBmax];
struct smb_packet *bufs[NCBmax];
-#define Sessionmax MAXIMUM_WAIT_OBJECTS
+#define Sessionmax MAXIMUM_WAIT_OBJECTS - 4
EVENT_HANDLE SessionEvents[Sessionmax];
unsigned short LSNs[Sessionmax];
int lanas[Sessionmax];
for(uidp = vcp->usersp; uidp; uidp = uidp->nextp) {
if (uid == uidp->userID) {
uidp->refCount++;
- osi_LogEvent("AFS smb_FindUID (Find by UID)",NULL," VCP[%x] found-uid[%d] name[%s]",(int)vcp,uidp->userID,(uidp->unp) ? uidp->unp->name : "");
+ osi_LogEvent("AFS smb_FindUID (Find by UID)",NULL," VCP[%x] found-uid[%d] name[%s]",
+ (int)vcp, uidp->userID,
+ osi_LogSaveString(smb_logp, (uidp->unp) ? uidp->unp->name : ""));
break;
}
}
sprintf(eventName,"fid_t event vcp=%d fid=%d", vcp->vcID, fid);
event = thrd_CreateEvent(NULL, FALSE, TRUE, eventName);
if ( GetLastError() == ERROR_ALREADY_EXISTS ) {
- afsi_log("Event Object Already Exists: %s", eventName);
+ osi_Log1(smb_logp, "Event Object Already Exists: %s", osi_LogSaveString(smb_logp, eventName));
thrd_CloseHandle(event);
fid++;
if (fid == 0)
signed int retval =
__dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */
if (retval == -1) {
- afsi_log("Cannot allocate %d paragraphs of DOS memory",
+ osi_Log1(smb_logp, "Cannot allocate %d paragraphs of DOS memory",
npar);
osi_panic("",__FILE__,__LINE__);
}
else {
- afsi_log("Allocated %d paragraphs of DOS mem at 0x%X",
+ osi_Log2(smb_logp, "Allocated %d paragraphs of DOS mem at 0x%X",
npar, retval);
seg = retval;
}
signed int retval =
__dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */
if (retval == -1) {
- afsi_log("Cannot allocate %d paragraphs of DOS mem in GetNCB",
+ osi_Log1(smb_logp, "Cannot allocate %d paragraphs of DOS mem in GetNCB",
npar);
osi_panic("",__FILE__,__LINE__);
} else {
- afsi_log("Allocated %d paragraphs of DOS mem at 0x%X in GetNCB",
+ osi_Log2(smb_logp, "Allocated %d paragraphs of DOS mem at 0x%X in GetNCB",
npar, retval);
seg = retval;
}
sprintf(s, "Bad SMB param %d out of %d, ncb len %d",
parm, parmCount, smbp->ncb_length);
- osi_Log0(smb_logp, s);
+ osi_Log0(smb_logp, osi_LogSaveString(smb_logp, s));
#endif /* !DJGPP */
osi_panic(s, __FILE__, __LINE__);
}
sprintf(s, "Bad SMB param %d offset %d out of %d, "
"ncb len %d",
parm, offset, parmCount, smbp->ncb_length);
- osi_Log0(smb_logp, s);
+ osi_Log0(smb_logp, osi_LogSaveString(smb_logp, s));
#endif /* !DJGPP */
osi_panic(s, __FILE__, __LINE__);
fid.unique = ntohl(dep->fid.unique);
fileType = cm_FindFileType(&fid);
osi_Log2(smb_logp, "smb_ReceiveCoreSearchDir: file %s "
- "has filetype %d", dep->name,
+ "has filetype %d", osi_LogSaveString(smb_logp, dep->name),
fileType);
if (fileType == CM_SCACHETYPE_DIRECTORY)
goto nextEntry;
/* Check if the file already exists; if so return error */
code = cm_Lookup(newDscp,newLastNamep,CM_FLAG_CHECKPATH,userp,&req,&tmpscp);
if ((code != CM_ERROR_NOSUCHFILE) && (code != CM_ERROR_NOSUCHPATH) && (code != CM_ERROR_NOSUCHVOLUME) ) {
- osi_Log2(afsd_logp, " lookup returns %ld for [%s]", code,
+ osi_Log2(smb_logp, " lookup returns %ld for [%s]", code,
osi_LogSaveString(afsd_logp, newLastNamep));
/* Check if the old and the new names differ only in case. If so return
}
} else {
/* file exist, do not rename, also fixes move */
- osi_Log0(afsd_logp, "Can't rename. Target already exists");
+ osi_Log0(smb_logp, "Can't rename. Target already exists");
code = CM_ERROR_EXISTS;
}
if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numNCBs))
{
int abandonIdx = code - WAIT_ABANDONED_0;
- afsi_log("Error: smb_ClientWaiter event %d abandoned, errno %d\n", abandonIdx, GetLastError());
+ osi_Log2(smb_logp, "Error: smb_ClientWaiter event %d abandoned, errno %d\n", abandonIdx, GetLastError());
}
if (code == WAIT_IO_COMPLETION)
{
- afsi_log("Error: smb_ClientWaiter WAIT_IO_COMPLETION\n");
+ osi_Log0(smb_logp, "Error: smb_ClientWaiter WAIT_IO_COMPLETION\n");
continue;
}
if (code == WAIT_TIMEOUT)
{
- afsi_log("Error: smb_ClientWaiter WAIT_TIMEOUT, errno %d\n", GetLastError());
+ osi_Log1(smb_logp, "Error: smb_ClientWaiter WAIT_TIMEOUT, errno %d\n", GetLastError());
}
if (code == WAIT_FAILED)
{
- afsi_log("Error: smb_ClientWaiter WAIT_FAILED, errno %d\n", GetLastError());
+ osi_Log1(smb_logp, "Error: smb_ClientWaiter WAIT_FAILED, errno %d\n", GetLastError());
}
idx = code - WAIT_OBJECT_0;
if (idx < 0 || idx > (sizeof(NCBevents) / sizeof(NCBevents[0])))
{
/* this is fatal - log as much as possible */
- afsi_log("Fatal: NCBevents idx [ %d ] out of range.\n", idx);
+ osi_Log1(smb_logp, "Fatal: NCBevents idx [ %d ] out of range.\n", idx);
osi_assert(0);
}
if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numSessions))
{
int abandonIdx = code - WAIT_ABANDONED_0;
- afsi_log("Error: smb_ServerWaiter (SessionEvents) event %d abandoned, errno %d\n", abandonIdx, GetLastError());
+ osi_Log2(smb_logp, "Error: smb_ServerWaiter (SessionEvents) event %d abandoned, errno %d\n", abandonIdx, GetLastError());
}
if (code == WAIT_IO_COMPLETION)
{
- afsi_log("Error: smb_ServerWaiter (SessionEvents) WAIT_IO_COMPLETION\n");
+ osi_Log0(smb_logp, "Error: smb_ServerWaiter (SessionEvents) WAIT_IO_COMPLETION\n");
continue;
}
if (code == WAIT_TIMEOUT)
{
- afsi_log("Error: smb_ServerWaiter (SessionEvents) WAIT_TIMEOUT, errno %d\n", GetLastError());
+ osi_Log1(smb_logp, "Error: smb_ServerWaiter (SessionEvents) WAIT_TIMEOUT, errno %d\n", GetLastError());
}
if (code == WAIT_FAILED)
{
- afsi_log("Error: smb_ServerWaiter (SessionEvents) WAIT_FAILED, errno %d\n", GetLastError());
+ osi_Log1(smb_logp, "Error: smb_ServerWaiter (SessionEvents) WAIT_FAILED, errno %d\n", GetLastError());
}
idx_session = code - WAIT_OBJECT_0;
if (idx_session < 0 || idx_session > (sizeof(SessionEvents) / sizeof(SessionEvents[0])))
{
/* this is fatal - log as much as possible */
- afsi_log("Fatal: session idx [ %d ] out of range.\n", idx_session);
+ osi_Log1(smb_logp, "Fatal: session idx [ %d ] out of range.\n", idx_session);
osi_assert(0);
}
if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numNCBs))
{
int abandonIdx = code - WAIT_ABANDONED_0;
- afsi_log("Error: smb_ClientWaiter (NCBavails) event %d abandoned, errno %d\n", abandonIdx, GetLastError());
+ osi_Log2(smb_logp, "Error: smb_ClientWaiter (NCBavails) event %d abandoned, errno %d\n", abandonIdx, GetLastError());
}
if (code == WAIT_IO_COMPLETION)
{
- afsi_log("Error: smb_ClientWaiter (NCBavails) WAIT_IO_COMPLETION\n");
+ osi_Log0(smb_logp, "Error: smb_ClientWaiter (NCBavails) WAIT_IO_COMPLETION\n");
continue;
}
if (code == WAIT_TIMEOUT)
{
- afsi_log("Error: smb_ClientWaiter (NCBavails) WAIT_TIMEOUT, errno %d\n", GetLastError());
+ osi_Log1(smb_logp, "Error: smb_ClientWaiter (NCBavails) WAIT_TIMEOUT, errno %d\n", GetLastError());
}
if (code == WAIT_FAILED)
{
- afsi_log("Error: smb_ClientWaiter (NCBavails) WAIT_FAILED, errno %d\n", GetLastError());
+ osi_Log1(smb_logp, "Error: smb_ClientWaiter (NCBavails) WAIT_FAILED, errno %d\n", GetLastError());
}
idx_NCB = code - WAIT_OBJECT_0;
if (idx_NCB < 0 || idx_NCB > (sizeof(NCBsessions) / sizeof(NCBsessions[0])))
{
/* this is fatal - log as much as possible */
- afsi_log("Fatal: idx_NCB [ %d ] out of range.\n", idx_NCB);
+ osi_Log1(smb_logp, "Fatal: idx_NCB [ %d ] out of range.\n", idx_NCB);
osi_assert(0);
}
if (code >= WAIT_ABANDONED_0 && code < (WAIT_ABANDONED_0 + numNCBs))
{
int abandonIdx = code - WAIT_ABANDONED_0;
- afsi_log("Error: smb_Server ( NCBreturns[%d] ) event %d abandoned, errno %d\n", myIdx, abandonIdx, GetLastError());
+ osi_Log3(smb_logp, "Error: smb_Server ( NCBreturns[%d] ) event %d abandoned, errno %d\n", myIdx, abandonIdx, GetLastError());
}
if (code == WAIT_IO_COMPLETION)
{
- afsi_log("Error: smb_Server ( NCBreturns[%d] ) WAIT_IO_COMPLETION\n", myIdx);
+ osi_Log1(smb_logp, "Error: smb_Server ( NCBreturns[%d] ) WAIT_IO_COMPLETION\n", myIdx);
continue;
}
if (code == WAIT_TIMEOUT)
{
- afsi_log("Error: smb_Server ( NCBreturns[%d] ) WAIT_TIMEOUT, errno %d\n", myIdx, GetLastError());
+ osi_Log2(smb_logp, "Error: smb_Server ( NCBreturns[%d] ) WAIT_TIMEOUT, errno %d\n", myIdx, GetLastError());
}
if (code == WAIT_FAILED)
{
- afsi_log("Error: smb_Server ( NCBreturns[%d] ) WAIT_FAILED, errno %d\n", myIdx, GetLastError());
+ osi_Log2(smb_logp, "Error: smb_Server ( NCBreturns[%d] ) WAIT_FAILED, errno %d\n", myIdx, GetLastError());
}
idx_NCB = code - WAIT_OBJECT_0;
if (idx_NCB < 0 || idx_NCB > (sizeof(NCBs) / sizeof(NCBs[0])))
{
/* this is fatal - log as much as possible */
- afsi_log("Fatal: idx_NCB [ %d ] out of range.\n", idx_NCB);
+ osi_Log1(smb_logp, "Fatal: idx_NCB [ %d ] out of range.\n", idx_NCB);
osi_assert(0);
}
/* Client closed session */
if (reportSessionStartups)
{
- afsi_log("session [ %d ] closed", idx_session);
+ osi_Log1(smb_logp, "session [ %d ] closed", idx_session);
}
dead_sessions[idx_session] = TRUE;
if (vcp)
/* A weird error code. Log it, sleep, and
* continue. */
if (vcp && vcp->errorCount++ > 3) {
- afsi_log("session [ %d ] closed, vcp->errorCount = %d", idx_session, vcp->errorCount);
+ osi_Log2(smb_logp, "session [ %d ] closed, vcp->errorCount = %d", idx_session, vcp->errorCount);
dead_sessions[idx_session] = TRUE;
}
else {
if (rwc.code == 0) {
rwevent = thrd_CreateEvent(NULL, FALSE, FALSE, TEXT("smb_Server() rwevent"));
if ( GetLastError() == ERROR_ALREADY_EXISTS )
- afsi_log("Event Object Already Exists: %s", eventName);
+ osi_Log1(smb_logp, "Event Object Already Exists: %s", osi_LogSaveString(smb_logp, eventName));
ncbp->ncb_command = NCBRECV | ASYNCH;
ncbp->ncb_lsn = (unsigned char) vcp->lsn;
ncbp->ncb_lana_num = vcp->lana;
sprintf(eventName,"NCBavails[%d]", idx);
NCBavails[idx] = thrd_CreateEvent(NULL, FALSE, TRUE, eventName);
if ( GetLastError() == ERROR_ALREADY_EXISTS )
- afsi_log("Event Object Already Exists: %s", eventName);
+ osi_Log1(smb_logp, "Event Object Already Exists: %s", osi_LogSaveString(smb_logp, eventName));
#ifndef DJGPP
sprintf(eventName,"NCBevents[%d]", idx);
NCBevents[idx] = thrd_CreateEvent(NULL, TRUE, FALSE, eventName);
if ( GetLastError() == ERROR_ALREADY_EXISTS )
- afsi_log("Event Object Already Exists: %s", eventName);
+ osi_Log1(smb_logp, "Event Object Already Exists: %s", osi_LogSaveString(smb_logp, eventName));
#endif /* !DJGPP */
sprintf(eventName,"NCBReturns[0<=i<smb_NumServerThreads][%d]", idx);
retHandle = thrd_CreateEvent(NULL, FALSE, FALSE, eventName);
if ( GetLastError() == ERROR_ALREADY_EXISTS )
- afsi_log("Event Object Already Exists: %s", eventName);
+ osi_Log1(smb_logp, "Event Object Already Exists: %s", osi_LogSaveString(smb_logp, eventName));
for (i=0; i<smb_NumServerThreads; i++)
NCBreturns[i][idx] = retHandle;
bufp = GetPacket();
"%s\n",
ncbp->ncb_lsn,ncbp->ncb_lana_num, rname);
#endif
- afsi_log("New session(ncb_lsn,ncb_lana_num) (%d,%d) starting from host %s, %d ongoing ops",
- ncbp->ncb_lsn,ncbp->ncb_lana_num, rname, ongoingOps);
+ osi_Log4(smb_logp, "New session(ncb_lsn,ncb_lana_num) (%d,%d) starting from host %s, %d ongoing ops",
+ ncbp->ncb_lsn,ncbp->ncb_lana_num, osi_LogSaveString(smb_logp, rname), ongoingOps);
if (reportSessionStartups) {
#ifndef DJGPP
1, 0, ptbuf, NULL);
DeregisterEventSource(h);
#else /* DJGPP */
- afsi_log("NCBLISTEN completed, call from %s",rname);
- osi_Log1(smb_logp, "SMB session startup, %d ongoing ops",
- ongoingOps);
time(&now);
fprintf(stderr, "%s: New session %d starting from host %s\n",
asctime(localtime(&now)), ncbp->ncb_lsn, rname);
fflush(stderr);
#endif /* !DJGPP */
}
+ osi_Log1(smb_logp, "NCBLISTEN completed, call from %s", osi_LogSaveString(smb_logp, rname));
+ osi_Log1(smb_logp, "SMB session startup, %d ongoing ops",
+ ongoingOps);
/* now ncbp->ncb_lsn is the connection ID */
vcp = smb_FindVC(ncbp->ncb_lsn, SMB_FLAG_CREATE, ncbp->ncb_lana_num);
/* But don't look at session[0], it is reserved */
for (i = 1; i < numSessions; i++) {
if (dead_sessions[i]) {
- afsi_log("connecting to dead session [ %d ]", i);
+ osi_Log1(smb_logp, "connecting to dead session [ %d ]", i);
dead_sessions[i] = FALSE;
break;
}
sprintf(eventName, "SessionEvents[%d]", i);
SessionEvents[i] = thrd_CreateEvent(NULL, FALSE, TRUE, eventName);
if ( GetLastError() == ERROR_ALREADY_EXISTS )
- afsi_log("Event Object Already Exists: %s", eventName);
+ osi_Log1(smb_logp, "Event Object Already Exists: %s", osi_LogSaveString(smb_logp, eventName));
numSessions++;
- afsi_log("increasing numNCBs [ %d ] numSessions [ %d ]", numNCBs, numSessions);
+ osi_Log2(smb_logp, "increasing numNCBs [ %d ] numSessions [ %d ]", numNCBs, numSessions);
thrd_SetEvent(SessionEvents[0]);
} else {
thrd_SetEvent(SessionEvents[i]);
code = Netbios(ncbp);
if (code != 0) {
sprintf(s, "Netbios NCBENUM error code %d", code);
- afsi_log(s);
+ osi_Log0(smb_logp, osi_LogSaveString(smb_logp, s));
osi_panic(s, __FILE__, __LINE__);
}
}
code = ncbp->ncb_retcode;
if (code != 0) {
sprintf(s, "Netbios NCBRESET lana %d error code %d", lana_list.lana[i], code);
- afsi_log(s);
+ osi_Log0(smb_logp, osi_LogSaveString(smb_logp, s));
lana_list.lana[i] = 255; /* invalid lana */
} else {
sprintf(s, "Netbios NCBRESET lana %d succeeded", lana_list.lana[i]);
- afsi_log(s);
+ osi_Log0(smb_logp, osi_LogSaveString(smb_logp, s));
}
}
#else
memset(smb_sharename,' ',NCBNAMSZ);
memcpy(smb_sharename,smb_localNamep,len);
sprintf(s, "lana_list.length %d", lana_list.length);
- afsi_log(s);
+ osi_Log0(smb_logp, osi_LogSaveString(smb_logp, s));
/* Keep the name so we can unregister it later */
for (l = 0; l < lana_list.length; l++) {
code = Netbios(ncbp, dos_ncb);
#endif /* !DJGPP */
- afsi_log("Netbios NCBADDNAME lana=%d code=%d retcode=%d complete=%d",
+ osi_Log3(smb_logp, "Netbios NCBADDNAME lana=%d code=%d retcode=%d complete=%d",
lana, code, ncbp->ncb_retcode,ncbp->ncb_cmd_cplt);
{
char name[NCBNAMSZ+1];
name[NCBNAMSZ]=0;
memcpy(name,ncbp->ncb_name,NCBNAMSZ);
- afsi_log("Netbios NCBADDNAME added new name >%s<",name);
+ osi_Log1(smb_logp, "Netbios NCBADDNAME added new name >%s<",osi_LogSaveString(smb_logp, name));
}
if (code == 0) code = ncbp->ncb_retcode;
if (code == 0) {
- afsi_log("Netbios NCBADDNAME succeeded on lana %d\n", lana);
+ osi_Log1(smb_logp, "Netbios NCBADDNAME succeeded on lana %d\n", lana);
#ifdef DJGPP
/* we only use one LANA with djgpp */
lana_list.lana[0] = lana;
}
else {
sprintf(s, "Netbios NCBADDNAME lana %d error code %d", lana, code);
- afsi_log(s);
+ osi_Log0(smb_logp, osi_LogSaveString(smb_logp, s));
if (code == NRC_BRIDGE) { /* invalid LANA num */
lana_list.lana[l] = 255;
continue;
}
else if (code == NRC_DUPNAME) {
- afsi_log("Name already exists; try to delete it");
+ osi_Log0(smb_logp, "Name already exists; try to delete it");
memset(ncbp, 0, sizeof(*ncbp));
ncbp->ncb_command = NCBDELNAME;
memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
if (code == 0) code = ncbp->ncb_retcode;
else {
sprintf(s, "Netbios NCBDELNAME lana %d error code %d\n", lana, code);
- afsi_log(s);
+ osi_Log0(smb_logp, s);
}
if (code != 0 || delname_tried) {
lana_list.lana[l] = 255;
}
else {
sprintf(s, "Netbios NCBADDNAME lana %d error code %d", lana, code);
- afsi_log(s);
+ osi_Log0(smb_logp, osi_LogSaveString(smb_logp, s));
lana_list.lana[l] = 255; /* invalid lana */
osi_panic(s, __FILE__, __LINE__);
}