death to register
[openafs.git] / src / viced / callback.c
index 34dbd13..27b530f 100644 (file)
@@ -171,22 +171,22 @@ struct object {
 };
 
 /* Prototypes for static routines */
-static struct FileEntry *FindFE(register AFSFid * fid);
+static struct FileEntry *FindFE(AFSFid * fid);
 
 #ifndef INTERPRET_DUMP
-static struct CallBack *iGetCB(register int *nused);
-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 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 struct CallBack *iGetCB(int *nused);
+static int iFreeCB(struct CallBack *cb, int *nused);
+static struct FileEntry *iGetFE(int *nused);
+static int iFreeFE(struct FileEntry *fe, int *nused);
+static int TAdd(struct CallBack *cb, afs_uint32 * thead);
+static int TDel(struct CallBack *cb);
+static int HAdd(struct CallBack *cb, struct host *host);
+static int HDel(struct CallBack *cb);
 static int CDel(struct CallBack *cb, int deletefe);
-static int CDelPtr(register struct FileEntry *fe, register afs_uint32 * cbp,
+static int CDelPtr(struct FileEntry *fe, afs_uint32 * cbp,
                   int deletefe);
 static afs_uint32 *FindCBPtr(struct FileEntry *fe, struct host *host);
-static int FDel(register struct FileEntry *fe);
+static int FDel(struct FileEntry *fe);
 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,
@@ -207,16 +207,16 @@ static int DumpCallBackState_r(void);
 
 
 /* Other protos - move out sometime */
-void PrintCB(register struct CallBack *cb, afs_uint32 now);
+void PrintCB(struct CallBack *cb, afs_uint32 now);
 
 static afs_uint32 HashTable[FEHASH_SIZE];      /* File entry hash table */
 
 static struct FileEntry *
-FindFE(register AFSFid * fid)
+FindFE(AFSFid * fid)
 {
     int hash;
-    register int fei;
-    register struct FileEntry *fe;
+    int fei;
+    struct FileEntry *fe;
 
     hash = FEHash(fid->Volume, fid->Unique);
     for (fei = HashTable[hash]; fei; fei = fe->fnext) {
@@ -231,9 +231,9 @@ FindFE(register AFSFid * fid)
 #ifndef INTERPRET_DUMP
 
 static struct CallBack *
-iGetCB(register int *nused)
+iGetCB(int *nused)
 {
-    register struct CallBack *ret;
+    struct CallBack *ret;
 
     if ((ret = CBfree)) {
        CBfree = (struct CallBack *)(((struct object *)ret)->next);
@@ -243,7 +243,7 @@ iGetCB(register int *nused)
 }
 
 static int
-iFreeCB(register struct CallBack *cb, register int *nused)
+iFreeCB(struct CallBack *cb, int *nused)
 {
     ((struct object *)cb)->next = (struct object *)CBfree;
     CBfree = cb;
@@ -252,9 +252,9 @@ iFreeCB(register struct CallBack *cb, register int *nused)
 }
 
 static struct FileEntry *
-iGetFE(register int *nused)
+iGetFE(int *nused)
 {
-    register struct FileEntry *ret;
+    struct FileEntry *ret;
 
     if ((ret = FEfree)) {
        FEfree = (struct FileEntry *)(((struct object *)ret)->next);
@@ -264,7 +264,7 @@ iGetFE(register int *nused)
 }
 
 static int
-iFreeFE(register struct FileEntry *fe, register int *nused)
+iFreeFE(struct FileEntry *fe, int *nused)
 {
     ((struct object *)fe)->next = (struct object *)FEfree;
     FEfree = fe;
@@ -274,12 +274,12 @@ iFreeFE(register struct FileEntry *fe, register int *nused)
 
 /* Add cb to end of specified timeout list */
 static int
-TAdd(register struct CallBack *cb, register afs_uint32 * thead)
+TAdd(struct CallBack *cb, afs_uint32 * thead)
 {
     if (!*thead) {
        (*thead) = cb->tnext = cb->tprev = cbtoi(cb);
     } else {
-       register struct CallBack *thp = itocb(*thead);
+       struct CallBack *thp = itocb(*thead);
 
        cb->tprev = thp->tprev;
        cb->tnext = *thead;
@@ -296,9 +296,9 @@ TAdd(register struct CallBack *cb, register afs_uint32 * thead)
 
 /* Delete call back entry from timeout list */
 static int
-TDel(register struct CallBack *cb)
+TDel(struct CallBack *cb)
 {
-    register afs_uint32 *thead = itot(cb->thead);
+    afs_uint32 *thead = itot(cb->thead);
 
     if (*thead == cbtoi(cb))
        *thead = (*thead == cb->tnext ? 0 : cb->tnext);
@@ -311,13 +311,13 @@ TDel(register struct CallBack *cb)
 
 /* Add cb to end of specified host list */
 static int
-HAdd(register struct CallBack *cb, register struct host *host)
+HAdd(struct CallBack *cb, struct host *host)
 {
     cb->hhead = h_htoi(host);
     if (!host->cblist) {
        host->cblist = cb->hnext = cb->hprev = cbtoi(cb);
     } else {
-       register struct CallBack *fcb = itocb(host->cblist);
+       struct CallBack *fcb = itocb(host->cblist);
 
        cb->hprev = fcb->hprev;
        cb->hnext = cbtoi(fcb);
@@ -328,9 +328,9 @@ HAdd(register struct CallBack *cb, register struct host *host)
 
 /* Delete call back entry from host list */
 static int
-HDel(register struct CallBack *cb)
+HDel(struct CallBack *cb)
 {
-    register afs_uint32 *hhead = &h_itoh(cb->hhead)->cblist;
+    afs_uint32 *hhead = &h_itoh(cb->hhead)->cblist;
 
     if (*hhead == cbtoi(cb))
        *hhead = (*hhead == cb->hnext ? 0 : cb->hnext);
@@ -348,8 +348,8 @@ CDel(struct CallBack *cb, int deletefe)
 {
     int cbi = cbtoi(cb);
     struct FileEntry *fe = itofe(cb->fhead);
-    register afs_uint32 *cbp;
-    register int safety;
+    afs_uint32 *cbp;
+    int safety;
 
     for (safety = 0, cbp = &fe->firstcb; *cbp && *cbp != cbi;
         cbp = &itocb(*cbp)->cnext, safety++) {
@@ -374,10 +374,10 @@ CDel(struct CallBack *cb, int deletefe)
 static int Ccdelpt = 0, CcdelB = 0;
 
 static int
-CDelPtr(register struct FileEntry *fe, register afs_uint32 * cbp,
+CDelPtr(struct FileEntry *fe, afs_uint32 * cbp,
        int deletefe)
 {
-    register struct CallBack *cb;
+    struct CallBack *cb;
 
     if (!*cbp)
        return 0;
@@ -395,10 +395,10 @@ CDelPtr(register struct FileEntry *fe, register afs_uint32 * cbp,
 static afs_uint32 *
 FindCBPtr(struct FileEntry *fe, struct host *host)
 {
-    register afs_uint32 hostindex = h_htoi(host);
-    register struct CallBack *cb;
-    register afs_uint32 *cbp;
-    register int safety;
+    afs_uint32 hostindex = h_htoi(host);
+    struct CallBack *cb;
+    afs_uint32 *cbp;
+    int safety;
 
     for (safety = 0, cbp = &fe->firstcb; *cbp; cbp = &cb->cnext, safety++) {
        if (safety > cbstuff.nblks) {
@@ -415,10 +415,10 @@ FindCBPtr(struct FileEntry *fe, struct host *host)
 
 /* Delete file entry from hash table */
 static int
-FDel(register struct FileEntry *fe)
+FDel(struct FileEntry *fe)
 {
-    register int fei = fetoi(fe);
-    register afs_uint32 *p = &HashTable[FEHash(fe->volid, fe->unique)];
+    int fei = fetoi(fe);
+    afs_uint32 *p = &HashTable[FEHash(fe->volid, fe->unique)];
 
     while (*p && *p != fei)
        p = &itofe(*p)->fnext;
@@ -464,7 +464,7 @@ afs_int32
 XCallBackBulk_r(struct host * ahost, struct AFSFid * fids, afs_int32 nfids)
 {
     struct AFSCallBack tcbs[AFSCBMAX];
-    register int i;
+    int i;
     struct AFSCBFids tf;
     struct AFSCBs tc;
     int code;
@@ -593,7 +593,7 @@ AddCallBack1_r(struct host *host, AFSFid * fid, afs_uint32 * thead, int type,
     host->Console &= ~2;
 
     if (!fe) {
-       register afs_uint32 hash;
+       afs_uint32 hash;
 
        fe = newfe;
        newfe = NULL;
@@ -887,8 +887,8 @@ BreakCallBack(struct host *xhost, AFSFid * fid, int flag)
 int
 DeleteCallBack(struct host *host, AFSFid * fid)
 {
-    register struct FileEntry *fe;
-    register afs_uint32 *pcb;
+    struct FileEntry *fe;
+    afs_uint32 *pcb;
     char hoststr[16];
 
     H_LOCK;
@@ -932,10 +932,10 @@ DeleteCallBack(struct host *host, AFSFid * fid)
 int
 DeleteFileCallBacks(AFSFid * fid)
 {
-    register struct FileEntry *fe;
-    register struct CallBack *cb;
-    register afs_uint32 cbi;
-    register int n;
+    struct FileEntry *fe;
+    struct CallBack *cb;
+    afs_uint32 cbi;
+    int n;
 
     H_LOCK;
     cbstuff.DeleteFiles++;
@@ -965,8 +965,8 @@ DeleteFileCallBacks(AFSFid * fid)
 int
 DeleteAllCallBacks_r(struct host *host, int deletefe)
 {
-    register struct CallBack *cb;
-    register int cbi, first;
+    struct CallBack *cb;
+    int cbi, first;
 
     cbstuff.DeleteAllCallBacks++;
     cbi = first = host->cblist;
@@ -1057,7 +1057,7 @@ BreakDelayedCallBacks_r(struct host *host)
                cb = itocb(cbi);
                cbi = cb->hnext;
                if (cb->status == CB_DELAYED) {
-                   register struct FileEntry *fe = itofe(cb->fhead);
+                   struct FileEntry *fe = itofe(cb->fhead);
                    thead[nfids] = cb->thead;
                    fids[nfids].Volume = fe->volid;
                    fids[nfids].Vnode = fe->vnode;
@@ -1217,7 +1217,7 @@ BreakVolumeCallBacksLater(afs_uint32 volume)
     for (hash = 0; hash < FEHASH_SIZE; hash++) {
        for (feip = &HashTable[hash]; (fe = itofe(*feip)) != NULL; ) {
            if (fe->volid == volume) {
-               register struct CallBack *cbnext;
+               struct CallBack *cbnext;
                for (cb = itocb(fe->firstcb); cb; cb = cbnext) {
                    host = h_itoh(cb->hhead);
                    host->hostFlags |= HFE_LATER;
@@ -1300,7 +1300,7 @@ BreakLaterCallBacks(void)
     /* loop over FEs from myfe and free/break */
     tthead = 0;
     for (fe = myfe; fe;) {
-       register struct CallBack *cbnext;
+       struct CallBack *cbnext;
        for (cb = itocb(fe->firstcb); cb; cb = cbnext) {
            cbnext = itocb(cb->cnext);
            host = h_itoh(cb->hhead);
@@ -1368,13 +1368,13 @@ int
 CleanupTimedOutCallBacks_r(void)
 {
     afs_uint32 now = CBtime(FT_ApproxTime());
-    register afs_uint32 *thead;
-    register struct CallBack *cb;
-    register int ntimedout = 0;
+    afs_uint32 *thead;
+    struct CallBack *cb;
+    int ntimedout = 0;
     char hoststr[16];
 
     while (tfirst <= now) {
-       register int cbi;
+       int cbi;
        cbi = *(thead = THead(tfirst));
        if (cbi) {
            do {
@@ -1447,7 +1447,7 @@ struct lih_params {
  * theory not give these to us anyway, but be paranoid.
  */
 static int
-lih0_r(register struct host *host, register int flags, void *rock)
+lih0_r(struct host *host, int flags, void *rock)
 {
     struct lih_params *params = (struct lih_params *)rock;
 
@@ -1470,7 +1470,7 @@ lih0_r(register struct host *host, register int flags, void *rock)
 
 /* same as lih0_r, except we do not prevent held hosts from being selected. */
 static int
-lih1_r(register struct host *host, register int flags, void *rock)
+lih1_r(struct host *host, int flags, void *rock)
 {
     struct lih_params *params = (struct lih_params *)rock;
 
@@ -2270,8 +2270,8 @@ static int
 cb_stateSaveFEs(struct fs_dump_state * state)
 {
     int ret = 0;
-    register int fei, hash;
-    register struct FileEntry *fe;
+    int fei, hash;
+    struct FileEntry *fe;
 
     AssignInt64(state->eof_offset, &state->cb_hdr->fe_offset);
 
@@ -2460,7 +2460,7 @@ cb_stateRestoreCBs(struct fs_dump_state * state, struct FileEntry * fe,
                   struct iovec * iov, int niovecs)
 {
     int ret = 0, idx;
-    register struct CallBack * cb;
+    struct CallBack * cb;
     struct CBDiskEntry * cbdsk;
     afs_uint32 fei;
 
@@ -2761,8 +2761,8 @@ main(int argc, char **argv)
 {
     int err = 0, cbi = 0, stats = 0, noptions = 0, all = 0, vol = 0, raw = 0;
     static AFSFid fid;
-    register struct FileEntry *fe;
-    register struct CallBack *cb;
+    struct FileEntry *fe;
+    struct CallBack *cb;
     time_t now;
     int timebits = 32;
     
@@ -2912,7 +2912,7 @@ main(int argc, char **argv)
 }
 
 void
-PrintCB(register struct CallBack *cb, afs_uint32 now)
+PrintCB(struct CallBack *cb, afs_uint32 now)
 {
     struct FileEntry *fe = itofe(cb->fhead);
     time_t expires = TIndexToTime(cb->thead);