/* max time to break a callback, otherwise client is dead or net is hosed */
#define MAXCBT 25
-#define u_short unsigned short
#define u_byte unsigned char
struct cbcounters cbstuff;
struct cbstruct {
struct host * hp;
- u_short thead;
+ afs_uint32 thead;
} ;
struct FileEntry {
- afs_uint32 vnode; /* XXX This was u_short XXX */
+ afs_uint32 vnode;
afs_uint32 unique;
afs_uint32 volid;
- u_short fnext;
- u_short ncbs;
- u_short firstcb;
- u_short spare;
-#if defined(AFS_ALPHA_ENV) || defined(AFS_ALPHA_LINUX20_ENV)
- u_short spare1;
- u_short spare2;
-#endif
+ afs_uint32 fnext;
+ afs_uint32 ncbs;
+ afs_uint32 firstcb;
} *FE; /* Don't use FE[0] */
struct CallBack {
- u_short cnext; /* Next call back entry */
- u_short fhead; /* Head of this call back chain */
+ afs_uint32 cnext; /* Next call back entry */
+ afs_uint32 fhead; /* Head of this call back chain */
u_byte thead; /* Head of timeout chain */
u_byte status; /* Call back status; see definitions, below */
- u_short hhead; /* Head of host table chain */
- u_short tprev, tnext; /* Timeout chain */
- u_short hprev, hnext; /* Chain from host table */
+ afs_uint32 hhead; /* Head of host table chain */
+ afs_uint32 tprev, tnext; /* Timeout chain */
+ afs_uint32 hprev, hnext; /* Chain from host table */
+ unsigned short spare; /* make it a multiple of 32 bits. */
} *CB; /* Don't use CB[0] */
/* status bits for status field of CallBack structure */
#define ServerBias (3*60)
/* Heads of CB queues; a timeout index is 1+index into this array */
-static u_short timeout[128];
+static afs_uint32 timeout[128];
/* Convert cbtime to timeout queue index */
#define TIndex(cbtime) (((cbtime)&127)+1)
struct VCBParams {
struct cbstruct cba[MAX_CB_HOSTS]; /* re-entrant storage */
unsigned int ncbas;
- unsigned short thead; /* head of timeout queue for youngest callback */
+ afs_uint32 thead; /* head of timeout queue for youngest callback */
struct AFSFid *fid;
};
static int iFreeCB(register struct CallBack *cb, register int *nused);
static struct FileEntry *iGetFE(register int *nused);
static int iFreeFE(register struct FileEntry *fe, register int *nused);
-static int TAdd(register struct CallBack *cb, register u_short *thead);
+static int TAdd(register struct CallBack *cb, register afs_uint32 *thead);
static int TDel(register struct CallBack *cb);
static int HAdd(register struct CallBack *cb, register struct host *host);
static int HDel(register struct CallBack *cb);
static int CDel(struct CallBack *cb);
-static int CDelPtr(register struct FileEntry *fe, register u_short *cbp);
-static u_short *FindCBPtr(struct FileEntry *fe, struct host *host);
+static int CDelPtr(register struct FileEntry *fe, register afs_uint32 *cbp);
+static afs_uint32 *FindCBPtr(struct FileEntry *fe, struct host *host);
static int FDel(register struct FileEntry *fe);
-static int AddCallBack1_r(struct host *host, AFSFid *fid, u_short *thead, int type, int locked);
+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 VCBParams *parms);
static int MultiBreakVolumeCallBack(struct host *host, int isheld, struct VCBParams *parms);
extern void ShutDown();
#define VHASH 512 /* Power of 2 */
-static u_short HashTable[VHASH]; /* File entry hash table */
+static afs_uint32 HashTable[VHASH]; /* File entry hash table */
#define VHash(volume, unique) (((volume)+(unique))&(VHASH-1))
static struct FileEntry *FindFE (register AFSFid *fid)
}
/* Add cb to end of specified timeout list */
-static int TAdd(register struct CallBack *cb, register u_short *thead)
+static int TAdd(register struct CallBack *cb, register afs_uint32 *thead)
{
if (!*thead) {
(*thead) = cb->tnext = cb->tprev = cbtoi(cb);
/* Delete call back entry from timeout list */
static int TDel(register struct CallBack *cb)
{
- register u_short *thead = itot(cb->thead);
+ register afs_uint32 *thead = itot(cb->thead);
if (*thead == cbtoi(cb))
*thead = (*thead == cb->tnext? 0: cb->tnext);
/* Delete call back entry from host list */
static int HDel(register struct CallBack *cb)
{
- register u_short *hhead = &h_itoh(cb->hhead)->cblist;
+ register afs_uint32 *hhead = &h_itoh(cb->hhead)->cblist;
if (*hhead == cbtoi(cb))
*hhead = (*hhead == cb->hnext? 0: cb->hnext);
{
int cbi = cbtoi(cb);
struct FileEntry *fe = itofe(cb->fhead);
- register u_short *cbp;
+ register afs_uint32 *cbp;
register int safety;
for (safety = 0, cbp = &fe->firstcb; *cbp && *cbp != cbi;
int Ccdelpt=0, CcdelB=0;
static int CDelPtr(register struct FileEntry *fe,
- register u_short *cbp)
+ register afs_uint32 *cbp)
{
register struct CallBack *cb;
return 0;
}
-static u_short *FindCBPtr(struct FileEntry *fe, struct host *host)
+static afs_uint32 *FindCBPtr(struct FileEntry *fe, struct host *host)
{
register afs_uint32 hostindex = h_htoi(host);
register struct CallBack *cb;
- register u_short *cbp;
+ register afs_uint32 *cbp;
register int safety;
for (safety = 0, cbp = &fe->firstcb; *cbp; cbp = &cb->cnext, safety++) {
static int FDel(register struct FileEntry *fe)
{
register int fei = fetoi(fe);
- register unsigned short *p = &HashTable[VHash(fe->volid, fe->unique)];
+ register afs_uint32 *p = &HashTable[VHash(fe->volid, fe->unique)];
while (*p && *p != fei)
p = &itofe(*p)->fnext;
* as well. If so, the host->ResetDone should probably be set to 0,
* and we probably don't want to return a callback promise to the
* cache manager, either. */
-int AddCallBack1(struct host *host, AFSFid *fid, u_short *thead,
+int AddCallBack1(struct host *host, AFSFid *fid, afs_uint32 *thead,
int type, int locked)
{
int retVal;
return retVal;
}
-static int AddCallBack1_r(struct host *host, AFSFid *fid, u_short *thead,
+static int AddCallBack1_r(struct host *host, AFSFid *fid, afs_uint32 *thead,
int type, int locked)
{
struct FileEntry *fe;
struct CallBack *cb = 0, *lastcb = 0;
struct FileEntry *newfe = 0;
afs_uint32 time_out;
- u_short *Thead = thead;
+ afs_uint32 *Thead = thead;
struct CallBack *newcb = 0;
int safety;
multi_Rx(conns, j) {
multi_RXAFSCB_CallBack(afidp, &tc);
if (multi_error) {
- unsigned short idx ;
+ afs_uint32 idx ;
struct host *hp;
char hoststr[16];
int DeleteCallBack(struct host *host, AFSFid *fid)
{
register struct FileEntry *fe;
- register u_short *pcb;
+ register afs_uint32 *pcb;
char hoststr[16];
cbstuff.DeleteCallBacks++;
int BreakDelayedCallBacks_r(struct host *host)
{
struct AFSFid fids[AFSCBMAX];
- u_short thead[AFSCBMAX];
+ u_byte thead[AFSCBMAX]; /* This should match thead in struct Callback */
int cbi, first, nfids;
struct CallBack *cb;
struct interfaceAddr interf;
{
struct AFSFid fid;
int hash;
- u_short *feip;
+ afs_uint32 *feip;
struct CallBack *cb;
struct FileEntry *fe;
struct host *host;
struct VCBParams henumParms;
- unsigned short tthead = 0; /* zero is illegal value */
+ afs_uint32 tthead = 0; /* zero is illegal value */
H_LOCK
fid.Volume = volume, fid.Vnode = fid.Unique = 0;
int CleanupTimedOutCallBacks_r(void)
{
afs_uint32 now = CBtime(FT_ApproxTime());
- register u_short *thead;
+ register afs_uint32 *thead;
register struct CallBack *cb;
register int ntimedout = 0;
char hoststr[16];
}
if (all || vol) {
register hash;
- register u_short *feip;
+ register afs_uint32 *feip;
register struct CallBack *cb;
register struct FileEntry *fe;
}
}
if (cbi) {
- u_short cfirst = cbi;
+ afs_uint32 cfirst = cbi;
do {
cb = itocb(cbi);
PrintCB(cb,now);
struct client *FirstClient; /* first connection from host */
afs_uint32 cpsCall; /* time of last cps call from this host */
struct Interface* interface; /* all alternate addr for client */
- unsigned short cblist; /* Call back list for this host */
+ afs_uint32 cblist; /* Call back list for this host */
/*
* These don't get zeroed, keep them at the end. If index doesn't
* follow an unsigned short then we need to pad to ensure that
- * the index fields isn't zeroed.
+ * the index fields isn't zeroed. XXX
*/
- unsigned short index; /* Host table index, for vicecb.c */
+ afs_uint32 index; /* Host table index, for vicecb.c */
struct Lock lock; /* Write lock for synchronization of
VenusDown flag */
#ifdef AFS_PTHREAD_ENV
#define h_Unlock(host) ReleaseWriteLock(&(host)->lock)
#define h_Unlock_r(host) ReleaseWriteLock(&(host)->lock)
-#define AddCallBack(host, fid) AddCallBack1((host), (fid), (u_short *)0, 1/*CB_NORMAL*/, 0)
-#define AddVolCallBack(host, fid) AddCallBack1((host), (fid), (u_short *)0, 3/*CB_VOLUME*/, 0)
-#define AddBulkCallBack(host, fid) AddCallBack1((host), (fid), (u_short *)0, 4/*CB_BULK*/, 0)
+#define AddCallBack(host, fid) AddCallBack1((host), (fid), (afs_uint32 *)0, 1/*CB_NORMAL*/, 0)
+#define AddVolCallBack(host, fid) AddCallBack1((host), (fid), (afs_uint32 *)0, 3/*CB_VOLUME*/, 0)
+#define AddBulkCallBack(host, fid) AddCallBack1((host), (fid), (afs_uint32 *)0, 4/*CB_BULK*/, 0)
/* operations on the global linked list of hosts */
#define h_InsertList_r(h) (h)->next = hostList; \