struct VCBParams *parms);
static int MultiBreakVolumeLaterCallBack(struct host *host, int isheld,
struct VCBParams *parms);
-static int lih_r(register struct host *host, register int held,
- register struct host *hostp);
static int GetSomeSpace_r(struct host *hostp, int locked);
static int ClearHostCallbacks_r(struct host *hp, int locked);
/* Other protos - move out sometime */
extern void ShutDown();
+void PrintCB(register struct CallBack *cb, afs_uint32 now);
#define VHASH 512 /* Power of 2 */
static afs_uint32 HashTable[VHASH]; /* File entry hash table */
ViceLog(25, ("Setting later on volume %u\n", volume));
H_LOCK;
for (hash = 0; hash < VHASH; hash++) {
- for (feip = &HashTable[hash]; fe = itofe(*feip);) {
+ for (feip = &HashTable[hash]; (fe = itofe(*feip)) != NULL; ) {
if (fe->volid == volume) {
register struct CallBack *cbnext;
for (cb = itocb(fe->firstcb); cb; cb = cbnext) {
fid.Volume = fid.Vnode = fid.Unique = 0;
for (hash = 0; hash < VHASH; hash++) {
- for (feip = &HashTable[hash]; fe = itofe(*feip);) {
+ for (feip = &HashTable[hash]; (fe = itofe(*feip)) != NULL; ) {
if (fe && (fe->status & FE_LATER)
&& (fid.Volume == 0 || fid.Volume == fe->volid)) {
/* Ugly, but used to avoid left side casting */
static struct host *lih_host;
static int lih_host_held;
-static int
-lih_r(register struct host *host, register int held,
- register struct host *hostp)
-{
- if (host->cblist
- && ((hostp && host != hostp) || (!held && !h_OtherHolds_r(host)))
- && (!lih_host || host->ActiveCall < lih_host->ActiveCall)) {
- if (lih_host != NULL && lih_host_held) {
- h_Release_r(lih_host);
- }
- lih_host = host;
- lih_host_held = !held;
- held = 1;
- }
- return held;
-}
-
/* This version does not allow 'host' to be selected unless its ActiveCall
* is newer than 'hostp' which is the host with the oldest ActiveCall from
* the last pass (if it is provided). We filter out any hosts that are
PrintCallBackStats();
}
if (all || vol) {
- register hash;
- register afs_uint32 *feip;
- register struct CallBack *cb;
- register struct FileEntry *fe;
+ int hash;
+ afs_uint32 *feip;
+ struct CallBack *cb;
+ struct FileEntry *fe;
for (hash = 0; hash < VHASH; hash++) {
for (feip = &HashTable[hash]; fe = itofe(*feip);) {
}
}
if (raw) {
- struct FileEntry *fe;
afs_int32 *p, i;
for (i = 1; i < cbstuff.nblks; i++) {
p = (afs_int32 *) & FE[i];
printf("%d:%12x%12x%12x%12x\n", i, p[0], p[1], p[2], p[3]);
}
}
+ exit(0);
}
-int
+void
PrintCB(register struct CallBack *cb, afs_uint32 now)
{
struct FileEntry *fe = itofe(cb->fhead);
#include <afs/stds.h>
#include <afs/afsint.h>
-#include <rx/rx_globals.h>
-#include <netdb.h>
#include <sys/socket.h>
+#include <rx/rx_globals.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
#include <ubik.h>
#ifdef HAVE_STRING_H
exit(1);
}
}
- if (code = pxclient_Initialize(noAuth, host.sin_addr.s_addr)) {
+ if ((code = pxclient_Initialize(noAuth, host.sin_addr.s_addr)) != 0) {
printf("Couldn't initialize fs library (code=%d).\n", code);
exit(1);
}
code = ubik_Call(RXAFS_GetTime, cstruct, 0, &tv.tv_sec, &tv.tv_usec);
if (!code)
- printf("AFS_GetTime on %s sec=%d, usec=%d\n", av[0], tv.tv_sec,
+ printf("AFS_GetTime on %s sec=%ld, usec=%ld\n", av[0], tv.tv_sec,
tv.tv_usec);
else
printf("return code is %d\n", code);
h_Alloc_r(register struct rx_connection *r_con)
{
struct servent *serverentry;
- register index = h_HashIndex(rxr_HostOf(r_con));
- register struct host *host;
+ int index = h_HashIndex(rxr_HostOf(r_con));
+ struct host *host;
static struct rx_securityClass *sc = 0;
afs_int32 now;
struct h_hashChain *h_hashChain;
struct host *
h_Lookup_r(afs_uint32 haddr, afs_uint32 hport, int *heldp)
{
- register afs_int32 now;
- register struct host *host = 0;
- register struct h_hashChain *chain;
- register index = h_HashIndex(haddr);
+ afs_int32 now;
+ struct host *host = 0;
+ struct h_hashChain *chain;
+ int index = h_HashIndex(haddr);
extern int hostaclRefresh;
restart:
struct host *
h_LookupUuid_r(afsUUID * uuidp)
{
- register struct host *host = 0;
- register struct h_hashChain *chain;
- register index = h_UuidHashIndex(uuidp);
+ struct host *host = 0;
+ struct h_hashChain *chain;
+ int index = h_UuidHashIndex(uuidp);
for (chain = hostUuidHashTable[index]; chain; chain = chain->next) {
host = chain->hostPtr;
extern int MultiBreakCallBackAlternateAddress_r(struct host *host,
struct AFSCBFids *afidp);
extern int DumpCallBackState(void);
+extern int PrintCallBackStats(void);
extern void ShutDownAndCore(int dopanic);
extern struct host *h_Alloc(register struct rx_connection *r_con);
* other 5 minute activities because it may be delayed by timeouts when
* it probes the workstations
*/
-static
+static void
FsyncCheckLWP()
{
afs_int32 code;
rxMaxMTU = atoi(argv[++i]);
if ((rxMaxMTU < RX_MIN_PACKET_SIZE) ||
(rxMaxMTU > RX_MAX_PACKET_DATA_SIZE)) {
- printf("rxMaxMTU %d% invalid; must be between %d-%d\n",
+ printf("rxMaxMTU %d%% invalid; must be between %d-%d\n",
rxMaxMTU, RX_MIN_PACKET_SIZE,
RX_MAX_PACKET_DATA_SIZE);
return -1;
afs_int32
InitPR()
{
- register code;
+ int code;
/*
* If this fails, it's because something major is wrong, and is not
InitVL()
{
afs_int32 code;
- extern int rxi_numNetAddrs;
- extern afs_uint32 rxi_NetAddrs[];
/*
* If this fails, it's because something major is wrong, and is not
#define VAclDiskSize(v) (SIZEOF_LARGEDISKVNODE - SIZEOF_SMALLDISKVNODE)
/*extern int VolumeHashOffset(); */
extern int VolumeHashOffset_r(void);
-extern VInitVnodes(VnodeClass class, int nVnodes);
+extern int VInitVnodes(VnodeClass class, int nVnodes);
/*extern VInitVnodes_r();*/
extern Vnode *VGetVnode(Error * ec, struct Volume *vp, VnodeId vnodeNumber,
int locktype);
int locktype);
extern void VPutVnode(Error * ec, register Vnode * vnp);
extern void VPutVnode_r(Error * ec, register Vnode * vnp);
-extern VVnodeWriteToRead(Error * ec, register Vnode * vnp);
-extern VVnodeWriteToRead_r(Error * ec, register Vnode * vnp);
+extern int VVnodeWriteToRead(Error * ec, register Vnode * vnp);
+extern int VVnodeWriteToRead_r(Error * ec, register Vnode * vnp);
extern Vnode *VAllocVnode(Error * ec, struct Volume *vp, VnodeType type);
extern Vnode *VAllocVnode_r(Error * ec, struct Volume *vp, VnodeType type);
/*extern VFreeVnode();*/