extern int serverLogSyslogFacility;
extern char *serverLogSyslogTag;
#endif
-extern void vFSLog(const char *format, va_list args);
+extern void vFSLog(const char *format, va_list args)
+ AFS_ATTRIBUTE_FORMAT(__printf__, 1, 0);
+
extern void SetLogThreadNumProgram(int (*func) (void) );
-/*@printflike@*/ extern void FSLog(const char *format, ...);
+extern void FSLog(const char *format, ...)
+ AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
+
#define ViceLog(level, str) do { if ((level) <= LogLevel) (FSLog str); } while (0)
#define vViceLog(level, str) do { if ((level) <= LogLevel) (vFSLog str); } while (0)
extern int
afs_vsnprintf( /*@out@ */ char *p, size_t avail, const char *fmt,
va_list ap)
+ AFS_ATTRIBUTE_FORMAT(__printf__, 3, 0)
/*@requires maxSet(p) >= (avail-1)@ */
/*@modifies p@ */ ;
extern /*@printflike@ */ int
-afs_snprintf( /*@out@ */ char *p, size_t avail,
- const char *fmt, ...)
+afs_snprintf( /*@out@ */ char *p, size_t avail, const char *fmt, ...)
+ AFS_ATTRIBUTE_FORMAT(__printf__, 3, 4)
/*@requires maxSet(p) >= (avail-1)@ */
/*@modifies p@ */ ;
extern int
-afs_vasnprintf (char **ret, size_t max_sz, const char *format, va_list args);
+afs_vasnprintf (char **ret, size_t max_sz, const char *format, va_list args)
+ AFS_ATTRIBUTE_FORMAT(__printf__, 3, 0);
extern int
-afs_vasprintf (char **ret, const char *format, va_list args);
+afs_vasprintf (char **ret, const char *format, va_list args)
+ AFS_ATTRIBUTE_FORMAT(__printf__, 2, 0);
extern int
-afs_asprintf (char **ret, const char *format, ...);
+afs_asprintf (char **ret, const char *format, ...)
+ AFS_ATTRIBUTE_FORMAT(__printf__, 2, 3);
extern int
-afs_asnprintf (char **ret, size_t max_sz, const char *format, ...);
+afs_asnprintf (char **ret, size_t max_sz, const char *format, ...)
+ AFS_ATTRIBUTE_FORMAT(__printf__, 3, 4);
/* special version of ctime that clobbers a *different static variable, so
* that ViceLog can call ctime and not cause buffer confusion.
if (ahost != thost) {
/* host/client recycle */
char hoststr[16], hoststr2[16];
- ViceLog(0, ("CallPostamble: ahost %s:%d (%x) != thost "
- "%s:%d (%x)\n",
+ ViceLog(0, ("CallPostamble: ahost %s:%d (%p) != thost "
+ "%s:%d (%p)\n",
afs_inet_ntoa_r(ahost->host, hoststr),
ntohs(ahost->port),
ahost,
h_Release_r(ahost);
} else {
char hoststr[16];
- ViceLog(0, ("CallPostamble: null ahost for thost %s:%d (%x)\n",
+ ViceLog(0, ("CallPostamble: null ahost for thost %s:%d (%p)\n",
afs_inet_ntoa_r(thost->host, hoststr),
ntohs(thost->port),
thost));
if (Pos == 0) CopyOnWrite_off0++;
if (CoW_len > CopyOnWrite_maxsize) CopyOnWrite_maxsize = CoW_len;
- ViceLog(1, ("StoreData : calling CopyOnWrite on vnode %lu.%lu (%s) off 0x%llx size 0x%llx\n",
- V_id(volptr), targetptr->vnodeNumber, V_name(volptr), 0, Pos));
+ ViceLog(1, ("StoreData : calling CopyOnWrite on vnode %u.%u (%s) "
+ "off 0x0 size 0x%llx\n",
+ afs_printable_VolumeId_u(V_id(volptr)),
+ afs_printable_VnodeId_u(targetptr->vnodeNumber),
+ V_name(volptr), Pos));
if ((errorCode = CopyOnWrite(targetptr, volptr, 0, Pos))) {
ViceLog(25, ("StoreData : CopyOnWrite failed\n"));
volptr->partition->flags &= ~PART_DONTUPDATE;
if (origfdP) { /* finish CopyOnWrite */
if ( (CoW_off = Pos + Length) < NewLength) {
errorCode = CopyOnWrite2(origfdP, fdP, CoW_off, CoW_len = NewLength - CoW_off);
- ViceLog(1, ("StoreData : CopyOnWrite2 on vnode %lu.%lu (%s) off 0x%llx size 0x%llx returns %d\n",
- V_id(volptr), targetptr->vnodeNumber, V_name(volptr), CoW_off, CoW_len, errorCode));
+ ViceLog(1, ("StoreData : CopyOnWrite2 on vnode %u.%u (%s) "
+ "off 0x%llx size 0x%llx returns %d\n",
+ afs_printable_VolumeId_u(V_id(volptr)),
+ afs_printable_VnodeId_u(targetptr->vnodeNumber),
+ V_name(volptr), CoW_off, CoW_len, errorCode));
}
FDH_CLOSE(origfdP);
}
if (!hp || !idx) {
ViceLog(0,
- ("BCB: INTERNAL ERROR: hp=%x, cba=%x, thead=%u\n",
+ ("BCB: INTERNAL ERROR: hp=%p, cba=%p, thead=%u\n",
hp, cba, idx));
} else {
/*
if (MultiBreakCallBackAlternateAddress(hp, afidp)) {
if (ShowProblems) {
ViceLog(7,
- ("BCB: Failed on file %u.%u.%u, Host %x (%s:%d) is down\n",
+ ("BCB: Failed on file %u.%u.%u, "
+ "Host %p (%s:%d) is down\n",
afidp->AFSCBFids_val->Volume,
afidp->AFSCBFids_val->Vnode,
afidp->AFSCBFids_val->Unique,
char hoststr[16];
ViceLog(7,
- ("BCB: BreakCallBack(Host %x all but %s:%d, (%u,%u,%u))\n",
+ ("BCB: BreakCallBack(Host %p all but %s:%d, (%u,%u,%u))\n",
xhost, afs_inet_ntoa_r(xhost->host, hoststr), ntohs(xhost->port),
fid->Volume, fid->Vnode, fid->Unique));
ViceLog(0, ("BCB: BOGUS! cb->hhead is NULL!\n"));
} else if (thishost->hostFlags & VENUSDOWN) {
ViceLog(7,
- ("BCB: %x (%s:%d) is down; delaying break call back\n",
+ ("BCB: %p (%s:%d) is down; delaying break call back\n",
thishost, afs_inet_ntoa_r(thishost->host, hoststr),
ntohs(thishost->port)));
cb->status = CB_DELAYED;
pcb = FindCBPtr(fe, host);
if (!*pcb) {
ViceLog(8,
- ("DCB: No call back for host %x (%s:%d), (%u, %u, %u)\n",
+ ("DCB: No call back for host %p (%s:%d), (%u, %u, %u)\n",
host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port),
fid->Volume, fid->Vnode, fid->Unique));
h_Unlock_r(host);
if (code) {
if (ShowProblems) {
ViceLog(0,
- ("CB: Call back connect back failed (in break delayed) for Host %x (%s:%d)\n",
+ ("CB: Call back connect back failed (in break delayed) "
+ "for Host %p (%s:%d)\n",
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port)));
}
host->hostFlags |= VENUSDOWN;
} else {
ViceLog(25,
- ("InitCallBackState success on %x (%s:%d)\n",
- host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port)));
+ ("InitCallBackState success on %p (%s:%d)\n",
+ host, afs_inet_ntoa_r(host->host, hoststr),
+ ntohs(host->port)));
/* reset was done successfully */
host->hostFlags |= RESETDONE;
host->hostFlags &= ~VENUSDOWN;
int i;
if (ShowProblems) {
ViceLog(0,
- ("CB: XCallBackBulk failed, Host %x (%s:%d); callback list follows:\n",
+ ("CB: XCallBackBulk failed, Host %p (%s:%d); "
+ "callback list follows:\n",
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port)));
}
for (i = 0; i < nfids; i++) {
if (ShowProblems) {
ViceLog(0,
- ("CB: Host %x (%s:%d), file %u.%u.%u (part of bulk callback)\n",
+ ("CB: Host %p (%s:%d), file %u.%u.%u "
+ "(part of bulk callback)\n",
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port), fids[i].Volume,
fids[i].Vnode, fids[i].Unique));
/* Do not care if the host is now HOSTDELETED */
if (ShowProblems) {
ViceLog(0,
- ("BVCB: volume callback for Host %x (%s:%d) failed\n",
+ ("BVCB: volume callback for Host %p (%s:%d) failed\n",
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port)));
}
/* leave hold for MultiBreakVolumeCallBack to clear */
} else {
ViceLog(125,
- ("Found host %x (%s:%d) non-DELAYED cb for %u:%u:%u\n",
+ ("Found host %p (%s:%d) non-DELAYED cb for %u:%u:%u\n",
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port), fe->vnode, fe->unique, fe->volid));
}
struct rx_connection *cb_conn = NULL;
ViceLog(5,
- ("GSS: Delete longest inactive host %x (%s:%d)\n",
+ ("GSS: Delete longest inactive host %p (%s:%d)\n",
hp, afs_inet_ntoa_r(hp->host, hoststr), ntohs(hp->port)));
h_Hold_r(hp);
if ((fe->firstcb && !fe->ncbs) ||
(!fe->firstcb && fe->ncbs)) {
- ViceLog(0, ("cb_stateVerifyFE: error: fe->firstcb does not agree with fe->ncbs (fei=%d, fe->firstcb=%d, fe->ncbs=%d)\n",
- fetoi(fe), fe->firstcb, fe->ncbs));
+ ViceLog(0, ("cb_stateVerifyFE: error: fe->firstcb does not agree with fe->ncbs (fei=%lu, fe->firstcb=%lu, fe->ncbs=%lu)\n",
+ afs_printable_uint32_lu(fetoi(fe)),
+ afs_printable_uint32_lu(fe->firstcb),
+ afs_printable_uint32_lu(fe->ncbs)));
ret = 1;
}
if (cb_stateVerifyFCBList(state, fe)) {
- ViceLog(0, ("cb_stateVerifyFE: error: FCBList failed verification (fei=%d)\n", fetoi(fe)));
+ ViceLog(0, ("cb_stateVerifyFE: error: FCBList failed verification (fei=%lu)\n",
+ afs_printable_uint32_lu(fetoi(fe))));
ret = 1;
}
assert(j); /* at least one alternate address */
ViceLog(125,
- ("Starting multibreakcall back on all addr for host %x (%s:%d)\n",
+ ("Starting multibreakcall back on all addr for host %p (%s:%d)\n",
host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port)));
H_UNLOCK;
multi_Rx(conns, j) {
assert(j); /* at least one alternate address */
ViceLog(125,
- ("Starting multiprobe on all addr for host %x (%s:%d)\n",
+ ("Starting multiprobe on all addr for host %p (%s:%d)\n",
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port)));
H_UNLOCK;
/* call back indices to pointers, and vice-versa */
#define itocb(i) ((i)?CB+(i):0)
-#define cbtoi(cbp) (!(cbp)?0:(cbp)-CB)
+#define cbtoi(cbp) ((afs_uint32)(!(cbp)?0:(cbp)-CB))
/* file entry indices to pointers, and vice-versa */
#define itofe(i) ((i)?FE+(i):0)
-#define fetoi(fep) (!(fep)?0:(fep)-FE)
+#define fetoi(fep) ((afs_uint32)(!(fep)?0:(fep)-FE))
/* Timeouts: there are 128 possible timeout values in effect at any
* given time. Each timeout represents timeouts in an interval of 128
code = afsconf_GetCellInfo(tdir, cellstr, "afsprot", &info);
if (code) {
- ViceLog(0, ("hpr_Initialize: Could not locate cell %s in %s/%s", cellstr, confDir, AFSDIR_CELLSERVDB_FILE));
+ ViceLog(0, ("hpr_Initialize: Could not locate cell %s in %s/%s",
+ cellstr, confDir->name, AFSDIR_CELLSERVDB_FILE));
afsconf_Close(tdir);
return code;
}
*/
host->hcpsfailed = 1;
ViceLog(0,
- ("Warning: GetHostCPS failed (%d) for %x (%s:%d); will retry\n",
+ ("Warning: GetHostCPS failed (%d) for %p (%s:%d); will retry\n",
code, host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port)));
} else {
host->hcpsfailed = 0;
ViceLog(1,
- ("gethost: GetHostCPS failed (%d) for %x (%s:%d); ignored\n",
+ ("gethost: GetHostCPS failed (%d) for %p (%s:%d); ignored\n",
code, host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port)));
}
if (host->hcps.prlist_val)
if (code < 0) {
char hoststr[16];
ViceLog(0,
- ("Warning: h_TossStuff_r failed: Host %" AFS_PTR_FMT " (%s:%d) client %x was locked.\n",
+ ("Warning: h_TossStuff_r failed: Host %p (%s:%d) "
+ "client %p was locked.\n",
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port), client));
return;
if (client->refCount) {
char hoststr[16];
ViceLog(0,
- ("Warning: h_TossStuff_r failed: Host %" AFS_PTR_FMT " (%s:%d) client %x refcount %d.\n",
+ ("Warning: h_TossStuff_r failed: Host %p (%s:%d) "
+ "client %p refcount %d.\n",
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port), client, client->refCount));
/* This is the same thing we do if the host is locked */
return;
afsUUID_to_string(uuid, uuid2, 127);
ViceLog(125,
- ("h_AddHostToUuidHashTable_r: host %" AFS_PTR_FMT " (%s:%d) added as uuid %s\n",
+ ("h_AddHostToUuidHashTable_r: host %p (%s:%d) added as uuid %s\n",
host, afs_inet_ntoa_r(chain->hostPtr->host, hoststr),
- ntohs(chain->hostPtr->port), uuid));
+ ntohs(chain->hostPtr->port), uuid2));
}
/* deletes a HashChain structure corresponding to this host */
if (host->interface)
afsUUID_to_string(&host->interface->uuid, uuid2, 127);
ViceLog(0,
- ("CB: new identity for host %" AFS_PTR_FMT " (%s:%d), deleting(%x %x %s %s)\n",
+ ("CB: new identity for host %p (%s:%d), "
+ "deleting(%x %p %s %s)\n",
host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port),
identP->valid, host->interface,
identP->valid ? uuid1 : "no_uuid",
if (*aval == AnonymousID) {
ViceLog(2,
("MapName: NameToId on %s returns anonymousID\n",
- lnames.namelist_val));
+ lnames.namelist_val[0]));
}
free(lids.idlist_val); /* return parms are not malloced in stub if server proc aborts */
} else {
ViceLog(0,
("MapName: NameToId on '%s' is unknown\n",
- lnames.namelist_val));
+ lnames.namelist_val[0]));
code = -1;
}
}
if (!oldClient->deleted) {
/* if we didn't create it, it's not ours to put back */
if (created) {
- ViceLog(0, ("FindClient: stillborn client %x(%x); conn %x (host %s:%d) had client %x(%x)\n",
+ ViceLog(0, ("FindClient: stillborn client %p(%x); "
+ "conn %p (host %s:%d) had client %p(%x)\n",
client, client->sid, tcon,
afs_inet_ntoa_r(rxr_HostOf(tcon), hoststr),
ntohs(rxr_PortOf(tcon)),
H_LOCK;
client = oldClient;
} else {
- ViceLog(0, ("FindClient: deleted client %x(%x) already had conn %x (host %s:%d), stolen by client %x(%x)\n",
+ ViceLog(0, ("FindClient: deleted client %p(%x) already had "
+ "conn %p (host %s:%d), stolen by client %p(%x)\n",
oldClient, oldClient->sid, tcon,
afs_inet_ntoa_r(rxr_HostOf(tcon), hoststr),
ntohs(rxr_PortOf(tcon)),
client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
if (client == NULL) {
ViceLog(0,
- ("GetClient: no client in conn %x (host %s:%d), VBUSYING\n",
+ ("GetClient: no client in conn %p (host %s:%d), VBUSYING\n",
tcon, afs_inet_ntoa_r(rxr_HostOf(tcon), hoststr),
ntohs(rxr_PortOf(tcon))));
H_UNLOCK;
}
if (rxr_CidOf(tcon) != client->sid || rxr_GetEpoch(tcon) != client->VenusEpoch) {
ViceLog(0,
- ("GetClient: tcon %x tcon sid %d client sid %d\n",
+ ("GetClient: tcon %p tcon sid %d client sid %d\n",
tcon, rxr_CidOf(tcon), client->sid));
H_UNLOCK;
return VBUSY;
pthread_setspecific(rx_thread_id_key, (void *)(intptr_t)rxi_pthread_hinum);
MUTEX_EXIT(&rx_stats_mutex);
ViceLog(0,
- ("Set thread id %d for '%s'\n",
+ ("Set thread id %p for '%s'\n",
pthread_getspecific(rx_thread_id_key), s));
#endif
}
ViceLog(0, ("Read on parms failed with errno = %d\n", errno));
} else {
ViceLog(0,
- ("Read on parms failed; expected %d bytes but read %d\n",
- sbuf.st_size, i));
+ ("Read on parms failed; expected %ld bytes but read %d\n",
+ (long) sbuf.st_size, i));
}
free(parms);
return;
#define V_pref(vp,nearInode) nearInode = 0
#endif /* NEARINODE_HINT */
+hdr_static_inline(unsigned int)
+afs_printable_VolumeId_u(VolumeId d) { return (unsigned int) d; }
+
+hdr_static_inline(unsigned int)
+afs_printable_VnodeId_u(VnodeId d) { return (unsigned int) d; }
+
#endif /* __volume_h */