viced: Allow null host for BreakCallBack

For replication writes at the remote site, we will want to call
this without a host structure.

Change-Id: I9cdef18f35229c9ab162cc07f6d60fe443204654
Reviewed-on: http://gerrit.openafs.org/6674
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Marc Dionne 2012-01-22 09:45:22 -05:00 committed by Derrick Brashear
parent fb0d056c69
commit 01301d0a53

View File

@ -798,10 +798,15 @@ BreakCallBack(struct host *xhost, AFSFid * fid, int flag)
int hostindex; int hostindex;
char hoststr[16]; char hoststr[16];
ViceLog(7, if (xhost)
("BCB: BreakCallBack(Host %p all but %s:%d, (%u,%u,%u))\n", ViceLog(7,
xhost, afs_inet_ntoa_r(xhost->host, hoststr), ntohs(xhost->port), ("BCB: BreakCallBack(Host %p all but %s:%d, (%u,%u,%u))\n",
fid->Volume, fid->Vnode, fid->Unique)); xhost, afs_inet_ntoa_r(xhost->host, hoststr), ntohs(xhost->port),
fid->Volume, fid->Vnode, fid->Unique));
else
ViceLog(7,
("BCB: BreakCallBack(No Host, (%u,%u,%u))\n",
fid->Volume, fid->Vnode, fid->Unique));
H_LOCK; H_LOCK;
cbstuff.BreakCallBacks++; cbstuff.BreakCallBacks++;
@ -809,7 +814,7 @@ BreakCallBack(struct host *xhost, AFSFid * fid, int flag)
if (!fe) { if (!fe) {
goto done; goto done;
} }
hostindex = h_htoi(xhost); hostindex = xhost ? h_htoi(xhost) : 0;
cb = itocb(fe->firstcb); cb = itocb(fe->firstcb);
if (!cb || ((fe->ncbs == 1) && (cb->hhead == hostindex) && !flag)) { if (!cb || ((fe->ncbs == 1) && (cb->hhead == hostindex) && !flag)) {
/* the most common case is what follows the || */ /* the most common case is what follows the || */