/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
/*
* NEW callback package callback.c (replaces vicecb.c)
* Updated call back routines, NOW with:
- *
+ *
* Faster DeleteVenus (Now called DeleteAllCallBacks)
* Call back breaking for volumes
* Adaptive timeouts on call backs
* nblocks must be < 65536
* Space used is nblocks*16 bytes
* Note that space will be reclaimed by breaking callbacks of old hosts
- *
+ *
* time = AddCallBack(host, fid)
* Add a call back.
* Returns the expiration time at the workstation.
- *
+ *
* BreakCallBack(host, fid)
* Break all call backs for fid, except for the specified host.
* Delete all of them.
- *
+ *
* BreakVolumeCallBacksLater(volume)
* Break all call backs on volume, using single call to each host
* Delete all the call backs.
- *
+ *
* DeleteCallBack(host,fid)
* Delete (do not break) single call back for fid.
- *
+ *
* DeleteFileCallBacks(fid)
* Delete (do not break) all call backs for fid.
*
* DeleteAllCallBacks(host)
* Delete (do not break) all call backs for host.
- *
+ *
* CleanupTimedOutCallBacks()
* Delete all timed out call back entries
* Must be called periodically by file server.
- *
+ *
* BreakDelayedCallBacks(host)
* Break all delayed call backs for host.
* Returns 1: one or more failed, 0: success.
- *
+ *
* PrintCallBackStats()
* Print statistics about call backs to stdout.
- *
+ *
* DumpCallBacks() ---wishful thinking---
* Dump call back state to /tmp/callback.state.
* This is separately interpretable by the program pcb.
#include <afsconfig.h>
#include <afs/param.h>
+#include <afs/stds.h>
+#include <roken.h>
-#include <stdio.h>
-#include <stdlib.h> /* for malloc() */
-#include <time.h> /* ANSI standard location for time stuff */
-#include <string.h>
-#ifdef AFS_NT40_ENV
-#include <fcntl.h>
-#include <io.h>
-#else
-#include <sys/time.h>
+#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
-#include <unistd.h>
#endif
-#include <afs/assert.h>
-
-#include <afs/stds.h>
#include <afs/nfs.h> /* yuck. This is an abomination. */
#include <lwp.h>
static int AddCallBack1_r(struct host *host, AFSFid * fid, afs_uint32 * thead,
int type, int locked);
static void MultiBreakCallBack_r(struct cbstruct cba[], int ncbas,
- struct AFSCBFids *afidp, struct host *xhost);
-static int MultiBreakVolumeCallBack_r(struct host *host, int isheld,
+ struct AFSCBFids *afidp);
+static int MultiBreakVolumeCallBack_r(struct host *host,
struct VCBParams *parms, int deletefe);
-static int MultiBreakVolumeLaterCallBack(struct host *host, int isheld,
- void *rock);
+static int MultiBreakVolumeLaterCallBack(struct host *host, void *rock);
static int GetSomeSpace_r(struct host *hostp, int locked);
static int ClearHostCallbacks_r(struct host *hp, int locked);
static int DumpCallBackState_r(void);
for (safety = 0, cbp = &fe->firstcb; *cbp && *cbp != cbi;
cbp = &itocb(*cbp)->cnext, safety++) {
if (safety > cbstuff.nblks + 10) {
- assert(0);
- ViceLog(0,
- ("CDel: Internal Error -- shutting down: wanted %d from %d, now at %d\n",
- cbi, fe->firstcb, *cbp));
+ ViceLogThenPanic(0, ("CDel: Internal Error -- shutting down: "
+ "wanted %d from %d, now at %d\n",
+ cbi, fe->firstcb, *cbp));
DumpCallBackState_r();
ShutDownAndCore(PANIC);
}
while (*p && *p != fei)
p = &itofe(*p)->fnext;
- assert(*p);
+ osi_Assert(*p);
*p = fe->fnext;
FreeFE(fe);
return 0;
* FE[0] and CB[0] are not used--and not allocated */
FE = ((struct FileEntry *)(calloc(nblks, sizeof(struct FileEntry))));
if (!FE) {
- ViceLog(0, ("Failed malloc in InitCallBack\n"));
- assert(0);
+ ViceLogThenPanic(0, ("Failed malloc in InitCallBack\n"));
}
FE--; /* FE[0] is supposed to point to junk */
cbstuff.nFEs = nblks;
FreeFE(&FE[cbstuff.nFEs]); /* This is correct */
CB = ((struct CallBack *)(calloc(nblks, sizeof(struct CallBack))));
if (!CB) {
- ViceLog(0, ("Failed malloc in InitCallBack\n"));
- assert(0);
+ ViceLogThenPanic(0, ("Failed malloc in InitCallBack\n"));
}
CB--; /* CB[0] is supposed to point to junk */
cbstuff.nCBs = nblks;
return code;
}
-/* the locked flag tells us if the host entry has already been locked
+/* the locked flag tells us if the host entry has already been locked
* by our parent. I don't think anybody actually calls us with the
* host locked, but here's how to make that work: GetSomeSpace has to
* change so that it doesn't attempt to lock any hosts < "host". That
host->Console |= 2;
/* allocate these guys first, since we can't call the allocator with
- * the host structure locked -- or we might deadlock. However, we have
+ * the host structure locked -- or we might deadlock. However, we have
* to avoid races with FindFE... */
while (!(newcb = GetCB())) {
GetSomeSpace_r(host, locked);
return ((cba1->hp)->index - (cba2->hp)->index);
}
-/* Take an array full of hosts, all held. Break callbacks to them, and
- * release the holds once you're done, except don't release xhost. xhost
- * may be NULL. Currently only works for a single Fid in afidp array.
+/* Take an array full of hosts, all held. Break callbacks to them, and
+ * release the holds once you're done.
+ * Currently only works for a single Fid in afidp array.
* If you want to make this work with multiple fids, you need to fix
* the error handling. One approach would be to force a reset if a
* multi-fid call fails, or you could add delayed callbacks for each
* fid. You probably also need to sort and remove duplicate hosts.
- * When this is called from the BreakVolumeCallBacks path, it does NOT
- * force a reset if the RPC fails, it just marks the host down and tries
+ * When this is called from the BreakVolumeCallBacks path, it does NOT
+ * force a reset if the RPC fails, it just marks the host down and tries
* to create a delayed callback. */
/* N.B. be sure that code works when ncbas == 0 */
/* N.B. requires all the cba[*].hp pointers to be valid... */
-/* This routine does not hold a lock on the host for the duration of
+/* This routine does not hold a lock on the host for the duration of
* the BreakCallBack RPC, which is a significant deviation from tradition.
* It _does_ get a lock on the host before setting VenusDown = 1,
* which is sufficient only if VenusDown = 0 only happens when the
* wherever that is done. */
static void
MultiBreakCallBack_r(struct cbstruct cba[], int ncbas,
- struct AFSCBFids *afidp, struct host *xhost)
+ struct AFSCBFids *afidp)
{
int i, j;
struct rx_connection *conns[MAX_CB_HOSTS];
static struct AFSCBs tc = { 0, 0 };
int multi_to_cba_map[MAX_CB_HOSTS];
- assert(ncbas <= MAX_CB_HOSTS);
+ osi_Assert(ncbas <= MAX_CB_HOSTS);
/* sort cba list to avoid makecall issues */
qsort(cba, ncbas, sizeof(struct cbstruct), CompareCBA);
("BCB: INTERNAL ERROR: hp=%p, cba=%p, thead=%u\n",
hp, cba, idx));
} else {
- /*
+ /*
** try breaking callbacks on alternate interface addresses
*/
if (MultiBreakCallBackAlternateAddress(hp, afidp)) {
}
H_LOCK;
- h_Lock_r(hp);
+ h_Lock_r(hp);
if (!(hp->hostFlags & HOSTDELETED)) {
hp->hostFlags |= VENUSDOWN;
/**
AddCallBack1_r(hp, afidp->AFSCBFids_val, itot(idx),
CB_DELAYED, 1);
}
- h_Unlock_r(hp);
+ h_Unlock_r(hp);
H_UNLOCK;
}
}
for (i = 0; i < ncbas; i++) {
struct host *hp;
hp = cba[i].hp;
- if (hp && xhost != hp) {
+ if (hp) {
h_Release_r(hp);
}
}
* Break all call backs for fid, except for the specified host (unless flag
* is true, in which case all get a callback message. Assumption: the specified
* host is h_Held, by the caller; the others aren't.
- * Specified host may be bogus, that's ok. This used to check to see if the
- * host was down in two places, once right after the host was h_held, and
+ * Specified host may be bogus, that's ok. This used to check to see if the
+ * host was down in two places, once right after the host was h_held, and
* again after it was locked. That race condition is incredibly rare and
- * relatively harmless even when it does occur, so we don't check for it now.
+ * relatively harmless even when it does occur, so we don't check for it now.
*/
/* if flag is true, send a break callback msg to "host", too */
int
{
struct FileEntry *fe;
struct CallBack *cb, *nextcb;
- struct cbstruct cba[MAX_CB_HOSTS];
- int ncbas;
+ struct cbstruct cbaDef[MAX_CB_HOSTS], *cba = cbaDef;
+ unsigned int ncbas, cbaAlloc = MAX_CB_HOSTS;
struct AFSCBFids tf;
int hostindex;
char hoststr[16];
tf.AFSCBFids_len = 1;
tf.AFSCBFids_val = fid;
- for (; cb;) {
- for (ncbas = 0; cb && ncbas < MAX_CB_HOSTS; cb = nextcb) {
+ for (ncbas = 0; cb ; cb = nextcb) {
nextcb = itocb(cb->cnext);
if ((cb->hhead != hostindex || flag)
&& (cb->status == CB_BULK || cb->status == CB_NORMAL
} else {
if (!(thishost->hostFlags & HOSTDELETED)) {
h_Hold_r(thishost);
+ if (ncbas == cbaAlloc) { /* Need more space */
+ int curLen = cbaAlloc*sizeof(cba[0]);
+ struct cbstruct *cbaOld = (cba == cbaDef) ? NULL : cba;
+
+ /* There are logical contraints elsewhere that the number of hosts
+ (i.e. h_HTSPERBLOCK*h_MAXHOSTTABLES) remains in the realm of a signed "int".
+ cbaAlloc is defined unsigned int hence doubling below cannot overflow
+ */
+ cbaAlloc = cbaAlloc<<1; /* double */
+ cba = realloc(cbaOld, cbaAlloc * sizeof(cba[0]));
+
+ if (cbaOld == NULL) { /* realloc wouldn't have copied from cbaDef */
+ memcpy(cba, cbaDef, curLen);
+ }
+ }
cba[ncbas].hp = thishost;
cba[ncbas].thead = cb->thead;
ncbas++;
}
TDel(cb);
HDel(cb);
- CDel(cb, 1); /* Usually first; so this delete
+ CDel(cb, 1); /* Usually first; so this delete
* is reasonably inexpensive */
}
}
}
if (ncbas) {
- MultiBreakCallBack_r(cba, ncbas, &tf, xhost);
+ struct cbstruct *cba2;
+ int num;
- /* we need to to all these initializations again because MultiBreakCallBack may block */
- fe = FindFE(fid);
- if (!fe) {
- goto done;
- }
- cb = itocb(fe->firstcb);
- if (!cb || ((fe->ncbs == 1) && (cb->hhead == hostindex) && !flag)) {
- /* the most common case is what follows the || */
- goto done;
+ for (cba2 = cba, num = ncbas; ncbas > 0; cba2 += num, ncbas -= num) {
+ num = (ncbas > MAX_CB_HOSTS) ? MAX_CB_HOSTS : ncbas;
+ MultiBreakCallBack_r(cba2, num, &tf);
}
}
- }
+
+ if (cba != cbaDef) free(cba);
done:
H_UNLOCK;
BreakDelayedCallBacks_r(struct host *host)
{
struct AFSFid fids[AFSCBMAX];
- u_byte thead[AFSCBMAX]; /* This should match thead in struct Callback */
int cbi, first, nfids;
struct CallBack *cb;
int code;
cbi = cb->hnext;
if (cb->status == CB_DELAYED) {
struct FileEntry *fe = itofe(cb->fhead);
- thead[nfids] = cb->thead;
fids[nfids].Volume = fe->volid;
fids[nfids].Vnode = fe->vnode;
fids[nfids].Unique = fe->unique;
return (host->hostFlags & VENUSDOWN);
}
-/*
-** isheld is 0 if the host is held in h_Enumerate
-** isheld is 1 if the host is held in BreakVolumeCallBacks
-*/
static int
-MultiBreakVolumeCallBack_r(struct host *host, int isheld,
+MultiBreakVolumeCallBack_r(struct host *host,
struct VCBParams *parms, int deletefe)
{
char hoststr[16];
if (host->hostFlags & HOSTDELETED)
- return 0; /* host is deleted, release hold */
+ return 0;
if (!(host->hostFlags & HCBREAK))
return 0; /* host is not flagged to notify */
host, afs_inet_ntoa_r(host->host, hoststr),
ntohs(host->port)));
}
- DeleteAllCallBacks_r(host, deletefe); /* Delete all callback state
- * rather than attempting to
+ DeleteAllCallBacks_r(host, deletefe); /* Delete all callback state
+ * rather than attempting to
* selectively remember to
* delete the volume callbacks
* later */
host->hostFlags &= ~(RESETDONE|HCBREAK); /* Do InitCallBackState when host returns */
h_Unlock_r(host);
- return 0; /* parent will release hold */
+ return 0;
}
- assert(parms->ncbas <= MAX_CB_HOSTS);
+ osi_Assert(parms->ncbas <= MAX_CB_HOSTS);
/* Do not call MultiBreakCallBack on the current host structure
** because it would prematurely release the hold on the host
tf.AFSCBFids_val = parms->fid;
/* this releases all the hosts */
- MultiBreakCallBack_r(parms->cba, parms->ncbas, &tf, 0 /* xhost */ );
+ MultiBreakCallBack_r(parms->cba, parms->ncbas, &tf);
parms->ncbas = 0;
}
parms->cba[parms->ncbas].hp = host;
parms->cba[(parms->ncbas)++].thead = parms->thead;
host->hostFlags &= ~HCBREAK;
- return 1; /* parent shouldn't release hold, more work to do */
+
+ /* we have more work to do on this host, so make sure we keep a reference
+ * to it */
+ h_Hold_r(host);
+
+ return 0;
}
-/*
-** isheld is 0 if the host is held in h_Enumerate
-** isheld is 1 if the host is held in BreakVolumeCallBacks
-*/
static int
-MultiBreakVolumeLaterCallBack(struct host *host, int isheld, void *rock)
+MultiBreakVolumeLaterCallBack(struct host *host, void *rock)
{
struct VCBParams *parms = (struct VCBParams *)rock;
int retval;
H_LOCK;
- retval = MultiBreakVolumeCallBack_r(host, isheld, parms, 0);
+ retval = MultiBreakVolumeCallBack_r(host, parms, 0);
H_UNLOCK;
return retval;
}
ViceLog(25, ("Fsync thread wakeup\n"));
#ifdef AFS_PTHREAD_ENV
FSYNC_LOCK;
- assert(pthread_cond_broadcast(&fsync_cond) == 0);
+ CV_BROADCAST(&fsync_cond);
FSYNC_UNLOCK;
#else
LWP_NoYieldSignal(fsync_wait);
tf.AFSCBFids_len = 1;
tf.AFSCBFids_val = &fid;
- MultiBreakCallBack_r(henumParms.cba, henumParms.ncbas, &tf, 0);
+ MultiBreakCallBack_r(henumParms.cba, henumParms.ncbas, &tf);
henumParms.ncbas = 0;
}
}
* host may be held by some other thread */
#define OTHER_MUSTHOLD_LIH 2
-/* This version does not allow 'host' to be selected unless its ActiveCall
+/* This version does not allow 'host' to be selected unless its ActiveCall
* is newer than 'params->lastlih' which is the host with the oldest
* ActiveCall from the last pass (if it is provided). We filter out any hosts
* that are are held by other threads.
* theory not give these to us anyway, but be paranoid.
*/
static int
-lih0_r(struct host *host, int flags, void *rock)
+lih0_r(struct host *host, void *rock)
{
struct lih_params *params = (struct lih_params *)rock;
h_Hold_r(host);
params->lih = host;
}
- return flags;
+ return 0;
}
/* same as lih0_r, except we do not prevent held hosts from being selected. */
static int
-lih1_r(struct host *host, int flags, void *rock)
+lih1_r(struct host *host, void *rock)
{
struct lih_params *params = (struct lih_params *)rock;
h_Hold_r(host);
params->lih = host;
}
- return flags;
+ return 0;
}
/* This could be upgraded to get more space each time */
/* first pass: sequentially find the oldest host which isn't held by
anyone for which we can clear callbacks;
skipping 'hostp' */
-/* second pass: sequentially find the oldest host regardless of
+/* second pass: sequentially find the oldest host regardless of
whether or not the host is held; skipping 'hostp' */
/* third pass: attempt to clear callbacks from 'hostp' */
/* always called with hostp unlocked */
-/* Note: hostlist is ordered most recently created host first and
+/* Note: hostlist is ordered most recently created host first and
* its order has no relationship to the most recently used. */
extern struct host *hostList;
static int
static int cb_stateRestoreFEHash(struct fs_dump_state * state);
static int cb_stateRestoreFEs(struct fs_dump_state * state);
static int cb_stateRestoreFE(struct fs_dump_state * state);
-static int cb_stateRestoreCBs(struct fs_dump_state * state, struct FileEntry * fe,
+static int cb_stateRestoreCBs(struct fs_dump_state * state, struct FileEntry * fe,
struct iovec * iov, int niovecs);
static int cb_stateVerifyFEHash(struct fs_dump_state * state);
ret = 1;
goto done;
}
-
+
done:
return ret;
}
}
}
}
-
+
/* restore indices in the CallBack structures */
for (i = 1; i < state->cb_map.len; i++) {
if (state->cb_map.entries[i].new_idx) {
ret = 1;
goto done;
}
-
+
/* restore the cb->fhead entry */
if (fe_OldToNew(state, cb->fhead, &cb->fhead)) {
ret = 1;
int ret = 0, len;
if (fs_stateReadHeader(state, &state->cb_hdr->timeout_offset,
- state->cb_timeout_hdr,
+ state->cb_timeout_hdr,
sizeof(struct callback_state_timeout_header))) {
ret = 1;
goto done;
int ret = 0, len;
if (fs_stateReadHeader(state, &state->cb_hdr->fehash_offset,
- state->cb_fehash_hdr,
+ state->cb_fehash_hdr,
sizeof(struct callback_state_fehash_header))) {
ret = 1;
goto done;
iov[1].iov_len = sizeof(struct FEDiskEntry);
iovcnt = 2;
- for (cbi = fe->firstcb, cb = itocb(cbi);
- cb != NULL;
+ for (cbi = fe->firstcb, cb = itocb(cbi);
+ cb != NULL;
cbi = cb->cnext, cb = itocb(cbi), hdr.nCBs++) {
if (cbi > state->cb_hdr->cb_max) {
state->cb_hdr->cb_max = cbi;
}
hdr.magic = CALLBACK_STATE_ENTRY_MAGIC;
- hdr.len = sizeof(hdr) + sizeof(struct FEDiskEntry) +
+ hdr.len = sizeof(hdr) + sizeof(struct FEDiskEntry) +
(hdr.nCBs * sizeof(struct CBDiskEntry));
if (!written) {
}
}
}
-
+
done:
return ret;
}
static int
-cb_stateRestoreCBs(struct fs_dump_state * state, struct FileEntry * fe,
+cb_stateRestoreCBs(struct fs_dump_state * state, struct FileEntry * fe,
struct iovec * iov, int niovecs)
{
int ret = 0, idx;
struct CallBack * cb;
struct CBDiskEntry * cbdsk;
- afs_uint32 fei;
-
- fei = fetoi(fe);
for (idx = 0; idx < niovecs; idx++) {
cbdsk = (struct CBDiskEntry *) iov[idx].iov_base;
+
+ if (cbdsk->cb.hhead < state->h_map.len &&
+ state->h_map.entries[cbdsk->cb.hhead].valid == FS_STATE_IDX_SKIPPED) {
+ continue;
+ }
+
if ((cb = GetCB()) == NULL) {
ViceLog(0, ("cb_stateRestoreCBs: ran out of free CallBack structures\n"));
ret = 1;
}
static int
-cb_stateDiskEntryToFE(struct fs_dump_state * state,
+cb_stateDiskEntryToFE(struct fs_dump_state * state,
struct FEDiskEntry * in, struct FileEntry * out)
{
int ret = 0;
ret = 1;
goto done;
}
+ state->fe_map.entries[in->index].valid = FS_STATE_IDX_VALID;
state->fe_map.entries[in->index].old_idx = in->index;
state->fe_map.entries[in->index].new_idx = fetoi(out);
ret = 1;
goto done;
}
+ state->cb_map.entries[in->index].valid = FS_STATE_IDX_VALID;
state->cb_map.entries[in->index].old_idx = in->index;
state->cb_map.entries[in->index].new_idx = cbtoi(out);
if (old >= state->fe_map.len) {
ViceLog(0, ("fe_OldToNew: index %d is out of range\n", old));
ret = 1;
- } else if (state->fe_map.entries[old].old_idx != old) { /* sanity check */
+ } else if (state->fe_map.entries[old].valid != FS_STATE_IDX_VALID ||
+ state->fe_map.entries[old].old_idx != old) { /* sanity check */
ViceLog(0, ("fe_OldToNew: index %d points to an invalid FileEntry record\n", old));
ret = 1;
} else {
if (old >= state->cb_map.len) {
ViceLog(0, ("cb_OldToNew: index %d is out of range\n", old));
ret = 1;
- } else if (state->cb_map.entries[old].old_idx != old) { /* sanity check */
+ } else if (state->cb_map.entries[old].valid != FS_STATE_IDX_VALID ||
+ state->cb_map.entries[old].old_idx != old) { /* sanity check */
ViceLog(0, ("cb_OldToNew: index %d points to an invalid CallBack record\n", old));
ret = 1;
} else {
int fd, oflag;
afs_uint32 magic, freelisthead;
afs_uint32 now;
-#ifdef AFS_64BIT_ENV
afs_int64 now64;
-#endif
oflag = O_RDONLY;
#ifdef AFS_NT40_ENV
exit(1);
}
}
-#ifdef AFS_64BIT_ENV
if (timebits == 64) {
read(fd, &now64, sizeof(afs_int64));
now = (afs_int32) now64;
} else
-#endif
read(fd, &now, sizeof(afs_int32));
+
read(fd, &cbstuff, sizeof(cbstuff));
read(fd, TimeOuts, sizeof(TimeOuts));
read(fd, timeout, sizeof(timeout));
struct CallBack *cb;
time_t now;
int timebits = 32;
-
+
memset(&fid, 0, sizeof(fid));
argc--;
argv++;
argc--;
timebits = atoi(*++argv);
if ((timebits != 32)
-#ifdef AFS_64BIT_ENV
&& (timebits != 64)
-#endif
- )
+ )
err++;
} else if (!strcmp(*argv, "-volume")) {
if (argc < 1) {
if (err || argc != 1) {
fprintf(stderr,
"Usage: cbd [-host cbid] [-fid volume vnode] [-stats] [-all] [-timebits 32"
-#ifdef AFS_64BIT_ENV
"|64"
-#endif
"] callbackdumpfile\n");
fprintf(stderr,
"[cbid is shown for each host in the hosts.dump file]\n");
interfaces = calloc(i, sizeof(struct AddrPort));
conns = calloc(i, sizeof(struct rx_connection *));
if (!interfaces || !conns) {
- ViceLog(0,
- ("Failed malloc in MultiBreakCallBackAlternateAddress_r\n"));
- assert(0);
+ ViceLogThenPanic(0, ("Failed malloc in "
+ "MultiBreakCallBackAlternateAddress_r\n"));
}
/* initialize alternate rx connections */
interfaces[j] = host->interface->interface[i];
conns[j] =
- rx_NewConnection(interfaces[j].addr,
+ rx_NewConnection(interfaces[j].addr,
interfaces[j].port, 1, sc, 0);
rx_SetConnDeadTime(conns[j], 2);
rx_SetConnHardDeadTime(conns[j], AFS_HARDDEADTIME);
j++;
}
- assert(j); /* at least one alternate address */
+ osi_Assert(j); /* at least one alternate address */
ViceLog(125,
("Starting multibreakcall back on all addr for host %p (%s:%d)\n",
host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port)));
/*
-** try multi_RX probes to host.
+** try multi_RX probes to host.
** return 0 on success, non-0 on failure
*/
int
interfaces = calloc(i, sizeof(struct AddrPort));
conns = calloc(i, sizeof(struct rx_connection *));
if (!interfaces || !conns) {
- ViceLog(0, ("Failed malloc in MultiProbeAlternateAddress_r\n"));
- assert(0);
+ ViceLogThenPanic(0, ("Failed malloc in "
+ "MultiProbeAlternateAddress_r\n"));
}
/* initialize alternate rx connections */
interfaces[j] = host->interface->interface[i];
conns[j] =
- rx_NewConnection(interfaces[j].addr,
+ rx_NewConnection(interfaces[j].addr,
interfaces[j].port, 1, sc, 0);
rx_SetConnDeadTime(conns[j], 2);
rx_SetConnHardDeadTime(conns[j], AFS_HARDDEADTIME);
j++;
}
- assert(j); /* at least one alternate address */
+ osi_Assert(j); /* at least one alternate address */
ViceLog(125,
("Starting multiprobe on all addr for host %p (%s:%d)\n",
host, afs_inet_ntoa_r(host->host, hoststr),
("multiprobe failure with addr %s:%d\n",
afs_inet_ntoa_r(interfaces[multi_i].addr, hoststr),
ntohs(interfaces[multi_i].port)));
-
+
/* This is less than desirable but its the best we can do.
- * The AFS Cache Manager will return either 0 for a Uuid
- * match and a 1 for a non-match. If the error is 1 we
- * therefore know that our mapping of IP address to Uuid
+ * The AFS Cache Manager will return either 0 for a Uuid
+ * match and a 1 for a non-match. If the error is 1 we
+ * therefore know that our mapping of IP address to Uuid
* is wrong. We should attempt to find the correct
* Uuid and fix the host tables.
*/