From c598e8e5578d79f11759865f8bb83bc61046b43c Mon Sep 17 00:00:00 2001 From: Walter Wong Date: Wed, 19 Sep 2001 23:36:15 +0000 Subject: [PATCH] STABLE12-misc-build-cleanup-20010917 get rid of build warnings from unused variables, especially for winnt (cherry picked from commit 7944ae223ada964b0a8c617dfef2f9fb52fadbf1) --- src/WINNT/afsd/cm_config.c | 2 +- src/auth/authcon.c | 4 +--- src/auth/cellconfig.c | 20 ++++++++++++-------- src/auth/userok.c | 1 - src/bozo/bos.c | 1 + src/bozo/bosoprocs.c | 2 +- src/bozo/bosserver.c | 5 ++++- src/bozo/cronbnodeops.c | 1 + src/bozo/fsbnodeops.c | 1 + src/cmd/cmd.c | 6 +++--- src/dir/buffer.c | 4 +++- src/dir/salvage.c | 2 +- src/kauth/admin_tools.c | 3 ++- src/kauth/authclient.c | 1 - src/kauth/kaauxdb.c | 1 - src/kauth/kaprocs.c | 19 ++++++++++++------- src/kauth/krb_udp.c | 24 ++++++++++++++---------- src/kauth/rebuild.c | 8 ++++++-- src/kauth/token.c | 2 -- src/libacl/aclprocs.c | 2 +- src/ptserver/db_verify.c | 5 ----- src/ptserver/display.c | 1 - src/ptserver/ptprocs.c | 2 +- src/ptserver/ptserver.c | 3 --- src/ptserver/readgroup.c | 4 +++- src/ptserver/utils.c | 1 - src/rx/rx_pthread.c | 8 ++------ src/rxgen/rpc_main.c | 2 -- src/rxgen/rpc_parse.c | 5 ----- src/rxkad/rxkad_server.c | 1 - src/sys/pioctl_nt.c | 4 +++- src/ubik/beacon.c | 4 ++-- src/ubik/disk.c | 15 +++++++-------- src/ubik/lock.c | 2 +- src/ubik/remote.c | 4 +++- src/ubik/vote.c | 4 ++-- src/vlserver/vlclient.c | 32 +++++++++++++++++++++----------- src/vlserver/vldb_check.c | 17 ++++++++--------- src/vlserver/vlprocs.c | 21 +++++++++------------ src/vlserver/vlutils.c | 7 ++++--- src/vol/clone.c | 5 +++++ src/vol/partition.c | 6 ++++-- src/vol/vnode.c | 12 +++++++++--- src/vol/vol-salvage.c | 5 ++--- src/vol/vutil.c | 15 ++++++++++----- src/volser/common.c | 1 + src/volser/dumpstuff.c | 14 +++++++++----- src/volser/lockprocs.c | 1 + src/volser/volprocs.c | 11 +++++------ src/volser/vos.c | 2 +- src/volser/vsprocs.c | 27 +++++++++++++-------------- src/volser/vsutils.c | 13 ++++++------- 52 files changed, 196 insertions(+), 167 deletions(-) diff --git a/src/WINNT/afsd/cm_config.c b/src/WINNT/afsd/cm_config.c index 2e1261b20..a3ef82f3f 100644 --- a/src/WINNT/afsd/cm_config.c +++ b/src/WINNT/afsd/cm_config.c @@ -113,8 +113,8 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, int foundCell; long code; int tracking = 1, partial = 0; - long ip_addr; #if defined(DJGPP) || defined(AFS_WIN95_ENV) + long ip_addr; int c1, c2, c3, c4; char aname[256]; #endif diff --git a/src/auth/authcon.c b/src/auth/authcon.c index 27991391c..f990f0cbf 100644 --- a/src/auth/authcon.c +++ b/src/auth/authcon.c @@ -99,9 +99,7 @@ rxkad_level enclevel; { struct rx_securityClass *tclass; afs_int32 kvno; afs_int32 ticketLen; - struct timeval tv; - Key_schedule schedule; - register afs_int32 i, code; + register afs_int32 code; /* first, find the right key and kvno to use */ code = afsconf_GetLatestKey(adir, &kvno, &key); diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index 97e0b2086..cd4c38d1d 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -191,10 +191,15 @@ register struct afsconf_dir *adir; { static afsconf_Touch(adir) register struct afsconf_dir *adir; { char tbuffer[256]; +#ifndef AFS_NT40_ENV struct timeval tvp[2]; +#endif + + adir->timeRead = 0; /* just in case */ #ifdef AFS_NT40_ENV /* NT client CellServDB has different file name than NT server or Unix */ + if (IsClientConfigDirectory(adir->name)) { strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL); @@ -202,14 +207,11 @@ register struct afsconf_dir *adir; { strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL); } -#else - strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL); -#endif /* AFS_NT40_ENV */ - adir->timeRead = 0; /* just in case */ -#ifdef AFS_NT40_ENV return _utime(tbuffer, NULL); + #else + strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL); gettimeofday(&tvp[0], NULL); tvp[1] = tvp[0]; return utimes(tbuffer, tvp); @@ -238,7 +240,7 @@ register char *adir; { /* The "AFSCONF" environment (or contents of "/.AFSCONF") will be typically set to something like "/afs//common/etc" where, by convention, the default files for "ThisCell" and "CellServDB" will reside; note that a major drawback is that a given afs client on that cell may NOT contain the same contents... */ char *home_dir; FILE *fp; - int len; + size_t len; if (!(home_dir = getenv("HOME"))) { /* Our last chance is the "/.AFSCONF" file */ @@ -557,7 +559,8 @@ afsconf_GetAfsdbInfo(acellName, aservice, acellInfo) struct afsconf_cell *acellInfo; { afs_int32 code; - int tservice, len, i; + int tservice, i; + size_t len; unsigned char answer[1024]; unsigned char *p; char host[256]; @@ -654,7 +657,8 @@ struct afsconf_cell *acellInfo; { register afs_int32 i; int tservice; char *tcell; - int cnLen, ambig; + size_t cnLen; + int ambig; char tbuffer[64]; LOCK_GLOBAL_MUTEX diff --git a/src/auth/userok.c b/src/auth/userok.c index 7094daa15..1ea085435 100644 --- a/src/auth/userok.c +++ b/src/auth/userok.c @@ -231,7 +231,6 @@ register char *auser; { char tbuffer[256]; register bufio_p bp; char tname[64]; - register char *tp; register int flag; register afs_int32 code; int rc; diff --git a/src/bozo/bos.c b/src/bozo/bos.c index ce0d0a354..e9bc6406e 100644 --- a/src/bozo/bos.c +++ b/src/bozo/bos.c @@ -387,6 +387,7 @@ register struct cmd_syndesc *as; { printf("\n"); } } + return 0; } static UnInstall(as) diff --git a/src/bozo/bosoprocs.c b/src/bozo/bosoprocs.c index c3aa5d569..8e5f867a5 100644 --- a/src/bozo/bosoprocs.c +++ b/src/bozo/bosoprocs.c @@ -147,7 +147,6 @@ BOZO_GetDates(acall, aname, atime, abakTime, aoldTime) struct rx_call *acall; char *aname; afs_int32 *atime, *abakTime, *aoldTime; { - register afs_int32 code; struct stat tstat; char *strp; char tbuffer[AFSDIR_PATH_MAX]; @@ -1191,6 +1190,7 @@ int initBosEntryStats() bozo_bosEntryStats[7].path = AFSDIR_SERVER_KEY_FILEPATH; bozo_bosEntryStats[8].path = AFSDIR_SERVER_ULIST_FILEPATH; + return 0; } /* StatEachEntry - If it's not there, it is okay. If anything else goes wrong * complain. Otherwise check permissions: shouldn't allow write or (usually) diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index e6a9aea7e..59a1a1931 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -52,6 +52,9 @@ extern int BOZO_ExecuteRequest(); extern int RXSTATS_ExecuteRequest(); extern int afsconf_GetKey(); extern struct bnode_ops fsbnode_ops, ezbnode_ops, cronbnode_ops; + +void bozo_Log(); + struct afsconf_dir *bozo_confdir = 0; /* bozo configuration dir */ static char *bozo_pid; struct rx_securityClass *bozo_rxsc[3]; @@ -666,7 +669,6 @@ char **envp; int noAuth = 0; struct ktc_encryptionKey tkey; int i; - pid_t newSessionID; char namebuf[AFSDIR_PATH_MAX]; #ifdef AFS_AIX32_ENV @@ -919,6 +921,7 @@ char **envp; rx_StartServer(1); /* donate this process */ } +void bozo_Log(a,b,c,d,e,f) char *a, *b, *c, *d, *e, *f; { char tdate[26]; diff --git a/src/bozo/cronbnodeops.c b/src/bozo/cronbnodeops.c index b410c3e2c..c5f8c833f 100644 --- a/src/bozo/cronbnodeops.c +++ b/src/bozo/cronbnodeops.c @@ -120,6 +120,7 @@ register struct cronbnode *abnode; { if (temp < 1) temp = 1; /* temp is when to start dude */ bnode_SetTimeout(abnode, temp); } + return 0; } static int cron_restartp (abnode) diff --git a/src/bozo/fsbnodeops.c b/src/bozo/fsbnodeops.c index 26670d53b..8df317886 100644 --- a/src/bozo/fsbnodeops.c +++ b/src/bozo/fsbnodeops.c @@ -397,6 +397,7 @@ struct fsbnode *abnode; { } } SetNeedsClock(abnode); + return 0; } static int fs_getstat(abnode, astatus) diff --git a/src/cmd/cmd.c b/src/cmd/cmd.c index 529a99f34..906a34854 100644 --- a/src/cmd/cmd.c +++ b/src/cmd/cmd.c @@ -68,7 +68,7 @@ static int FindType(as, aname) register struct cmd_syndesc *as; register char *aname; { register int i; - int cmdlen; + size_t cmdlen; int ambig; int best; @@ -95,7 +95,7 @@ int *aambig; char *aname; { register struct cmd_syndesc *ts; struct cmd_syndesc *best; - int cmdLen; + size_t cmdLen; int ambig; cmdLen = strlen(aname); @@ -199,7 +199,7 @@ void PrintFlagHelp(as) register struct cmd_syndesc *as; { register int i; register struct cmd_parmdesc *tp; - int flag_width; + size_t flag_width; char *flag_prefix; /* find flag name length */ diff --git a/src/dir/buffer.c b/src/dir/buffer.c index 5d00736bc..376ba81f5 100644 --- a/src/dir/buffer.c +++ b/src/dir/buffer.c @@ -75,6 +75,7 @@ int DStat (abuffers, acalls, aios) {*abuffers = nbuffers; *acalls = calls; *aios = ios; + return 0; } int DInit (abuffers) @@ -215,7 +216,7 @@ struct buffer *newslot (afid, apage, lp) register struct buffer *lp; /* pointer to a fairly-old buffer */ {/* Find a usable buffer slot */ register afs_int32 i; - afs_int32 lt,pt; + afs_int32 lt; register struct buffer **tbp; if (lp && (lp->lockers == 0)) { @@ -263,6 +264,7 @@ struct buffer *newslot (afid, apage, lp) return lp; } +void DRelease (bp,flag) register struct buffer *bp; int flag; diff --git a/src/dir/salvage.c b/src/dir/salvage.c index 83468d61d..0c074dc0f 100644 --- a/src/dir/salvage.c +++ b/src/dir/salvage.c @@ -393,7 +393,7 @@ int DirSalvage (fromFile, toFile, vn, vu, pvn, pvu) afs_int32 dot[3], dotdot[3], lfid[3], code, usedPages; char tname[256]; register int i; - register char *tp, tc; + register char *tp; struct DirHeader *dhp; struct DirEntry *ep; int entry; diff --git a/src/kauth/admin_tools.c b/src/kauth/admin_tools.c index 8675c8d00..b250875c3 100644 --- a/src/kauth/admin_tools.c +++ b/src/kauth/admin_tools.c @@ -1449,9 +1449,10 @@ static ForgetTicket ( char *arock) { afs_int32 code; - struct ktc_principal server; #ifdef notdef + struct ktc_principal server; + if (as->parms[0].items) { char *name = as->parms[0].items->data; code = ka_ParseLoginName diff --git a/src/kauth/authclient.c b/src/kauth/authclient.c index e92abfbb0..704595aaf 100644 --- a/src/kauth/authclient.c +++ b/src/kauth/authclient.c @@ -637,7 +637,6 @@ afs_int32 ka_GetToken ( des_key_schedule schedule; int version; afs_int32 pwexpires; - char bob[KA_TIMESTR_LEN]; LOCK_GLOBAL_MUTEX aticket.SeqLen = auth_token->ticketLen; diff --git a/src/kauth/kaauxdb.c b/src/kauth/kaauxdb.c index dc3936640..d1275e3ca 100644 --- a/src/kauth/kaauxdb.c +++ b/src/kauth/kaauxdb.c @@ -165,7 +165,6 @@ int kaux_islocked( unsigned int nfailures, myshare; afs_uint32 lasttime; struct ubik_debug beaconinfo; - afs_uint32 now; /* if attempts is 0, that means there's no limit, so the id * can't ever be locked... diff --git a/src/kauth/kaprocs.c b/src/kauth/kaprocs.c index e17f31732..0279fc50a 100644 --- a/src/kauth/kaprocs.c +++ b/src/kauth/kaprocs.c @@ -707,7 +707,6 @@ impose_reuse_limits ( password, tentry ) int code; Date now; int i; - int reuse_p; extern int MinHours; afs_uint32 newsum; @@ -1277,8 +1276,7 @@ afs_int32 kamSetFields (call, aname, ainstance, aflags, afs_int32 caller; afs_int32 tentry_offset; /* offset of entry */ struct kaentry tentry; - unsigned char newvals[4], oldvals[4]; - int i; + unsigned char newvals[4]; COUNT_REQ (SetFields); @@ -1953,13 +1951,16 @@ afs_int32 kamGetPassword (call, name, password) struct rx_call *call; char *name; EncryptionKey *password; -{ int code = KANOAUTH; +{ + int code = KANOAUTH; + COUNT_REQ (GetPassword); + +#ifdef GETPASSWORD + { afs_int32 to; struct ubik_trans *tt; struct kaentry tentry; - COUNT_REQ (GetPassword); -#ifdef GETPASSWORD if (!name_instance_legal (name, "")) return KABADNAME; /* only requests from this host work */ if (rx_HostOf(rx_PeerOf(rx_ConnectionOf(call))) != htonl(INADDR_LOOPBACK)) @@ -1968,9 +1969,12 @@ afs_int32 kamGetPassword (call, name, password) /* this isn't likely to be used because of string to key problems, so since this is a temporary thing anyway, we'll use it here. */ - { extern char udpAuthPrincipal[256]; + { + extern char udpAuthPrincipal[256]; + save_principal (udpAuthPrincipal, name, 0, 0); } + get_time (0,0,0); /* update random value */ code = FindBlock(tt, name, "", &to, &tentry); if (code) goto abort; @@ -1984,6 +1988,7 @@ afs_int32 kamGetPassword (call, name, password) memcpy(password, &tentry.key, sizeof (*password)); code = ubik_EndTrans (tt); + } #endif return code; } diff --git a/src/kauth/krb_udp.c b/src/kauth/krb_udp.c index 2d13747c0..816ebd416 100644 --- a/src/kauth/krb_udp.c +++ b/src/kauth/krb_udp.c @@ -100,7 +100,6 @@ int fiveminutes=300; static FiveMinuteCheckLWP() { - struct timeval time; printf("start 5 min check lwp\n"); @@ -554,7 +553,7 @@ fail: return code; } -static err_packet (ksoc, pkt, code, reason) +static int err_packet (ksoc, pkt, code, reason) int ksoc; struct packet *pkt; afs_int32 code; @@ -576,7 +575,7 @@ static err_packet (ksoc, pkt, code, reason) 3/* nulls */ + (2 * sizeof(afs_int32)) + strlen (buf) + 1; if (ans.len > sizeof(ans.data)) { printf ("Answer packet too long\n"); - return; + return -1; } *answer++ = (unsigned char) KRB_PROT_VERSION; @@ -601,8 +600,10 @@ static err_packet (ksoc, pkt, code, reason) code, ans.len); else perror ("err_packet: sendto"); } + return 0; } +int process_udp_auth (ksoc, pkt) int ksoc; struct packet *pkt; @@ -632,7 +633,7 @@ process_udp_auth (ksoc, pkt) if ((strlen(realm) > 0) && (strcmp (realm, lrealm) != 0)) { err_packet (ksoc, pkt, KERB_ERR_NONNULL_REALM, "null realm name not allowed"); - return; + return -1; } memcpy(&startTime, packet, sizeof(startTime)); packet += sizeof(startTime); @@ -644,13 +645,13 @@ process_udp_auth (ksoc, pkt) if (code < 0) { err_packet (ksoc, pkt, KERB_ERR_BAD_LIFETIME, "requested ticket lifetime invalid"); - return; + return -1; } getstr (sname); getstr (sinst); if ((packet - pkt->data) != pkt->len) { err_packet (ksoc, pkt, KERB_ERR_PKT_LENGTH, "packet length inconsistent"); - return; + return -1; } pkt->rest = packet; code = UDP_Authenticate (ksoc, &pkt->from, name, inst, @@ -665,9 +666,10 @@ process_udp_auth (ksoc, pkt) } else err_packet (ksoc, pkt, code, (char *)error_message (code)); } - return; + return 0; } +int process_udp_appl (ksoc, pkt) int ksoc; struct packet *pkt; @@ -689,13 +691,13 @@ process_udp_appl (ksoc, pkt) authLen = *(unsigned char *)packet++; if (ticketLen > sizeof(ticket)) { err_packet (ksoc, pkt, KERB_ERR_TEXT_LENGTH, "ticket too long"); - return; + return -1; } memcpy(ticket, packet, ticketLen); packet += ticketLen; if (authLen > sizeof(auth)) { err_packet (ksoc, pkt, KERB_ERR_TEXT_LENGTH, "authenticator too long"); - return; + return -1; } memcpy(auth, packet, authLen); pkt->rest = packet + authLen; @@ -703,10 +705,12 @@ process_udp_appl (ksoc, pkt) if (code) { if (code == KANOENT) code = KERB_ERR_PRINCIPAL_UNKNOWN; err_packet (ksoc, pkt, code, (char*)error_message (code)); - return; + return -1; } + return 0; } +void process_udp_request (ksoc, pkt) int ksoc; struct packet *pkt; diff --git a/src/kauth/rebuild.c b/src/kauth/rebuild.c index 38432c55a..e25f2a616 100644 --- a/src/kauth/rebuild.c +++ b/src/kauth/rebuild.c @@ -41,6 +41,8 @@ char *whoami = "kadb_check"; int fd; FILE *out; +void badEntry(); + int listuheader, listkheader, listentries, verbose; int readUbikHeader() @@ -82,6 +84,7 @@ int readUbikHeader() return(0); } +void PrintHeader(header) struct kaheader *header; { @@ -100,6 +103,7 @@ PrintHeader(header) printf("stats.cpw commands = %d\n", header->stats.cpws); } +void PrintEntry(index, entry) afs_int32 index; struct kaentry *entry; @@ -221,6 +225,7 @@ char *EntryName(entryp) return(principal); } +void RebuildEntry(entryp) struct kaentry *entryp; { @@ -365,7 +370,6 @@ WorkerBee (as, arock) char *arock; { afs_int32 code; - int a; char *dbFile; char *outFile; afs_int32 index; @@ -556,6 +560,7 @@ WorkerBee (as, arock) exit (code != 0); } +void badEntry(e, i) afs_int32 e, i; { @@ -585,7 +590,6 @@ main (argc, argv) char *argv[]; { struct cmd_syndesc *ts; - struct cmd_item *ti; setlinebuf(stdout); diff --git a/src/kauth/token.c b/src/kauth/token.c index 07fb00160..0de5a103b 100644 --- a/src/kauth/token.c +++ b/src/kauth/token.c @@ -320,8 +320,6 @@ afs_int32 ka_VerifyUserToken( afs_int32 now = time(0); struct ktc_token token; char cellname[MAXKTCREALMLEN]; - char realm[MAXKTCREALMLEN]; - struct ktc_principal client, server; afs_int32 pwexpires; LOCK_GLOBAL_MUTEX diff --git a/src/libacl/aclprocs.c b/src/libacl/aclprocs.c index 055148045..cb955ea9c 100644 --- a/src/libacl/aclprocs.c +++ b/src/libacl/aclprocs.c @@ -222,7 +222,6 @@ struct acl_accessList **acl; register char *nextc; register afs_int32 code; int p,n; - char tbuf[PR_MAXNAMELEN+1]; namelist lnames; idlist lids; @@ -377,6 +376,7 @@ char *version; #ifdef AFS_PTHREAD_ENV assert(pthread_mutex_init(&acl_list_mutex, NULL) == 0); #endif /* AFS_PTHREAD_ENV */ + return 0; } int acl_IsAMember(aid,cps) diff --git a/src/ptserver/db_verify.c b/src/ptserver/db_verify.c index 5af62dbf1..666df8296 100644 --- a/src/ptserver/db_verify.c +++ b/src/ptserver/db_verify.c @@ -222,7 +222,6 @@ int PrintEntryError (misc, ea, e, indent) struct prentry *e; int indent; { - int i; pr_PrintEntry (stderr, /*net order*/0, ea, e, indent); return 0; @@ -1045,9 +1044,6 @@ WorkerBee (as, arock) char *recreateFile; struct misc_data misc; /* info & statistics */ - int a; - char arg[100]; - initialize_pt_error_table(); initialize_u_error_table(); @@ -1099,7 +1095,6 @@ main (argc, argv) char *argv[]; { struct cmd_syndesc *ts; - struct cmd_item *ti; setlinebuf(stdout); diff --git a/src/ptserver/display.c b/src/ptserver/display.c index 45e828773..28063319d 100644 --- a/src/ptserver/display.c +++ b/src/ptserver/display.c @@ -32,7 +32,6 @@ static char *pr_TimeToString (time_t clock) { struct tm *tm; static char buffer[32]; static int this_year = 0; - char year[6]; if (clock == 0) return "time-not-set "; if (!this_year) { diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index ae5bdc7e5..ac984c80a 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -1194,7 +1194,7 @@ afs_int32 listEntries(call, flag, startindex, bulkentries, nextstartindex) afs_int32 code; struct ubik_trans *tt; afs_int32 cid; - afs_int32 temp, i, eof, pos, maxentries, f; + afs_int32 i, eof, pos, maxentries, f; struct prentry tentry; afs_int32 pollcount=0; diff --git a/src/ptserver/ptserver.c b/src/ptserver/ptserver.c index bbf578522..b05ff9ab2 100644 --- a/src/ptserver/ptserver.c +++ b/src/ptserver/ptserver.c @@ -81,7 +81,6 @@ void main (argc, argv) #endif struct afsconf_cell info; int kerberosKeys; /* set if found some keys */ - afs_int32 i,j; int lwps = 3; char clones[MAXHOSTSPERCELL]; @@ -157,8 +156,6 @@ void main (argc, argv) } #endif else if (*arg == '-') { - usage: - /* hack in help flag support */ #ifndef AFS_NT40_ENV diff --git a/src/ptserver/readgroup.c b/src/ptserver/readgroup.c index 92bf208f9..4129c87c9 100644 --- a/src/ptserver/readgroup.c +++ b/src/ptserver/readgroup.c @@ -27,7 +27,9 @@ RCSID("$Header$"); #include "pterror.h" int verbose = 0; +void skip(); +void report_error (code, name, gname) afs_int32 code; char *name; @@ -66,7 +68,6 @@ char **argv; char buf[3000]; FILE *fp; char *ptr; - char *aptr; char *tmp; char *cellname; namelist lnames; @@ -195,6 +196,7 @@ char **argv; } } +void skip(s) char **s; { diff --git a/src/ptserver/utils.c b/src/ptserver/utils.c index 1be47930c..50464d86f 100644 --- a/src/ptserver/utils.c +++ b/src/ptserver/utils.c @@ -402,7 +402,6 @@ register struct ubik_trans *at; char aname[PR_MAXNAMELEN]; afs_int32 *aid; { - register afs_int32 code; afs_int32 temp; struct prentry tentry; diff --git a/src/rx/rx_pthread.c b/src/rx/rx_pthread.c index 6042ec6bf..a2b7297c9 100644 --- a/src/rx/rx_pthread.c +++ b/src/rx/rx_pthread.c @@ -207,12 +207,6 @@ struct rx_call **newcallp; u_long host; u_short port; register struct rx_packet *p = (struct rx_packet *)0; - unsigned long rfds; - register unsigned long rrfds; - struct clock cv; - long nextPollTime; /* time to next poll FD before sleeping */ - int lastPollWorked, doingPoll; /* true iff last poll was useful */ - struct timeval tv, *tvp; assert(pthread_mutex_lock(&listener_mutex)==0); while (!listeners_started) { @@ -378,6 +372,7 @@ rxi_Listen(sock) exit(1); } AFS_SIGSET_RESTORE(); + return 0; } @@ -415,4 +410,5 @@ rxi_Sendmsg(socket, msg_p, flags) printf("rxi_sendmsg failed, error %d\n", errno); fflush(stdout); } + return 0; } diff --git a/src/rxgen/rpc_main.c b/src/rxgen/rpc_main.c index 4cede5c90..0b003b8af 100644 --- a/src/rxgen/rpc_main.c +++ b/src/rxgen/rpc_main.c @@ -334,9 +334,7 @@ open_input(infile, define) char *infile; char *define; { - char *exec_args[MAXCPPARGS+10]; int nargs = 0; - char **args; char cpp_cmdline[MAXCMDLINE]; int i; diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index b072ab1ac..7b1d8e450 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -1451,11 +1451,6 @@ ss_ProcProto_setup(defp, somefrees) definition *defp; int *somefrees; { - proc1_list *plist, *plist1; - list *listp; - definition *defp1; - int preserve_flag = 0; - f_print(fout, "#ifndef KERNEL\n"); f_print(fout, "\tafs_int32 %s%s%s%s();\n", prefix, ServerPrefix, PackagePrefix[PackageIndex], defp->pc.proc_name); diff --git a/src/rxkad/rxkad_server.c b/src/rxkad/rxkad_server.c index d3908d101..84b949b8c 100644 --- a/src/rxkad/rxkad_server.c +++ b/src/rxkad/rxkad_server.c @@ -180,7 +180,6 @@ rxs_return_t rxkad_GetChallenge (aobj, aconn, apacket) IN struct rx_packet *apacket; IN struct rx_connection *aconn; { struct rxkad_sconn *sconn; - afs_int32 temp; char *challenge; int challengeSize; struct rxkad_v2Challenge c_v2; /* version 2 */ diff --git a/src/sys/pioctl_nt.c b/src/sys/pioctl_nt.c index 366fd9623..0794d3cfb 100644 --- a/src/sys/pioctl_nt.c +++ b/src/sys/pioctl_nt.c @@ -87,7 +87,6 @@ static long GetIoctlHandle(char *fileNamep, HANDLE *handlep) HKEY parmKey; DWORD dummyLen; long code; - int hostsize; if (fileNamep) { drivep = strchr(fileNamep, ':'); @@ -116,11 +115,14 @@ nogateway: #ifndef AFS_WIN95_ENV gethostname(hostName, sizeof(hostName)); #else + { + int hostsize; /* DJGPP version of gethostname gets the NetBIOS name of the machine, so that is what we are using for the AFS server name instead of the DNS name. */ hostsize = sizeof(hostName); GetComputerName(hostName, &hostsize); + } #endif /* AFS_WIN95_ENV */ havehost: diff --git a/src/ubik/beacon.c b/src/ubik/beacon.c index ed1887664..3fc756c62 100644 --- a/src/ubik/beacon.c +++ b/src/ubik/beacon.c @@ -447,7 +447,7 @@ static verifyInterfaceAddress(ame, info, aservers) afs_uint32 aservers[]; /* list of all possible server addresses */ { afs_uint32 myAddr[UBIK_MAX_INTERFACE_ADDR], *servList, tmpAddr; - int count, index, found, i, j, totalServers, start, end; + int count, found, i, j, totalServers, start, end; if (info) totalServers = info->numServers; @@ -574,7 +574,7 @@ int updateUbikNetworkAddress(ubik_host) afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR]; { - int j, count, found, index, code = 0; + int j, count, code = 0; UbikInterfaceAddr inAddr, outAddr; struct rx_connection *conns[MAXSERVERS]; struct ubik_server *ts, *server[MAXSERVERS]; diff --git a/src/ubik/disk.c b/src/ubik/disk.c index e35dce4a8..bf9785b9f 100644 --- a/src/ubik/disk.c +++ b/src/ubik/disk.c @@ -236,11 +236,11 @@ static int DInit (abuffers) } /* Take a buffer and mark it as the least recently used buffer */ -static int Dlru(abuf) +static void Dlru(abuf) struct buffer *abuf; { if (LruBuffer == abuf) - return 0; + return; /* Unthread from where it is in the list */ abuf->lru_next->lru_prev = abuf->lru_prev; @@ -256,12 +256,12 @@ static int Dlru(abuf) } /* Take a buffer and mark it as the most recently used buffer */ -static int Dmru(abuf) +static void Dmru(abuf) struct buffer *abuf; { if (LruBuffer == abuf) { LruBuffer = LruBuffer->lru_next; - return 0; + return; } /* Unthread from where it is in the list */ @@ -273,7 +273,6 @@ static int Dmru(abuf) abuf->lru_prev = LruBuffer->lru_prev; LruBuffer->lru_prev->lru_next = abuf; LruBuffer->lru_prev = abuf; - } /* get a pointer to a particular buffer */ @@ -283,7 +282,7 @@ static char *DRead(dbase, fid, page) int page; { /* Read a page from the disk. */ struct buffer *tb, *lastbuffer; - afs_int32 trys, code; + afs_int32 code; calls++; lastbuffer = LruBuffer->lru_prev; @@ -469,7 +468,7 @@ static struct buffer *newslot (adbase, afid, apage) } /* Release a buffer, specifying whether or not the buffer has been modified by the locker. */ -static DRelease (ap,flag) +static void DRelease (ap,flag) char *ap; int flag; { int index; @@ -480,7 +479,7 @@ static DRelease (ap,flag) bp = &(Buffers[index]); bp->lockers--; if (flag) bp->dirty=1; - return 0; + return; } /* flush all modified buffers, leaves dirty bits set (they're cleared diff --git a/src/ubik/lock.c b/src/ubik/lock.c index 2e5bd7cb7..e5d8a5b25 100644 --- a/src/ubik/lock.c +++ b/src/ubik/lock.c @@ -62,7 +62,6 @@ ulock_getLock(atrans, atype, await) struct ubik_trans *atrans; int atype, await; { - struct ubik_trans *tt; struct ubik_dbase *dbase=atrans->dbase; /* On first pass, initialize the lock */ @@ -118,6 +117,7 @@ ulock_getLock(atrans, atype, await) } /* Release the transaction lock */ +int ulock_relLock(atrans) struct ubik_trans *atrans; { diff --git a/src/ubik/remote.c b/src/ubik/remote.c index c09508d05..6f0d9438e 100644 --- a/src/ubik/remote.c +++ b/src/ubik/remote.c @@ -28,6 +28,7 @@ RCSID("$Header$"); #include "ubik_int.h" int (*ubik_CheckRXSecurityProc)(); char *ubik_CheckRXSecurityRock; +void printServerInfo(); /* routines for handling requests remotely-submitted by the sync site. These are only write transactions (we don't propagate read trans), and there is at most one @@ -453,7 +454,7 @@ SDISK_SendFile(rxcall, file, length, avers) register afs_int32 code; register struct ubik_dbase *dbase; char tbuffer[256]; - afs_int32 offset, t; + afs_int32 offset; struct ubik_version tversion; register int tlen; struct rx_peer *tpeer; @@ -614,6 +615,7 @@ UbikInterfaceAddr *inAddr, *outAddr; return 0; } +void printServerInfo() { struct ubik_server *ts; diff --git a/src/ubik/vote.c b/src/ubik/vote.c index abe9e8fd8..1a94ae326 100644 --- a/src/ubik/vote.c +++ b/src/ubik/vote.c @@ -430,7 +430,7 @@ SVOTE_SDebugOld(rxcall, awhich, aparm) afs_int32 awhich; register struct ubik_sdebug_old *aparm; { register struct ubik_server *ts; - register int i; + for(ts=ubik_servers; ts; ts=ts->next) { if (awhich-- == 0) { /* we're done */ @@ -453,7 +453,7 @@ SVOTE_SDebugOld(rxcall, awhich, aparm) SVOTE_DebugOld(rxcall, aparm) struct rx_call *rxcall; register struct ubik_debug_old *aparm; { - int i; + /* fill in the basic debug structure. Note the the RPC protocol transfers, * integers in host order. */ diff --git a/src/vlserver/vlclient.c b/src/vlserver/vlclient.c index cdd049fd1..30462449e 100644 --- a/src/vlserver/vlclient.c +++ b/src/vlserver/vlclient.c @@ -51,6 +51,16 @@ RCSID("$Header$"); #include "vlserver.h" #include "vlclient.h" +void fill_listattributes_entry(); +void display_listattributes_entry(); +void display_entry(); +void display_entryN(); +void display_update_entry(); +void dump_stats(); +void GetArgs(); +void print_usage(); +void fill_entry(); +void fill_update_entry(); extern int VL_GetAddrsU(), VL_RegisterAddrs(); #define VL_NUMBER_OPCODESX 34 @@ -253,7 +263,7 @@ static handleit(as) { register struct cmd_item *ti; register afs_int32 code, server = 0, sawserver=0; - afs_int32 i, id, voltype; + afs_int32 id, voltype; struct vldbentry entry; char *cmd = 0, *cellp=0; struct VldbUpdateEntry updateentry; @@ -395,7 +405,6 @@ static handleit(as) } else if (!strcmp(oper,"checkhash")) { int index, count, num=0, num1=0, num2 = 0, num3=0, num31=0, num4=0, num41=0, next_index; struct vldbentry tentry; - struct Vlent *vl1; VL = SVL = (struct Vlent *) malloc(ALLOCNT * sizeof(struct Vlent)); if (VL == NULL) { @@ -448,7 +457,6 @@ static handleit(as) } else if (!strcmp(oper,"fixhash")) { int index, count, num=0, num1=0, num2 = 0, next_index, x=0; struct vldbentry tentry; - struct Vlent *vl1; VL = SVL = (struct Vlent *) malloc(ALLOCNT * sizeof(struct Vlent)); if (VL == NULL) { @@ -700,7 +708,6 @@ static handleit(as) int nentries, i; afs_uint32 *addrp; bulkaddrs addrs; - struct vldbentry *entry; struct VLCallBack vlcb; addrs.bulkaddrs_val = 0; @@ -775,7 +782,6 @@ static handleit(as) int nentries1, nentries2, i, j, x, y, unique, found; afs_uint32 *addrp1, *addrp2; bulkaddrs addrs1, addrs2; - struct vldbentry *entry; struct VLCallBack vlcb; ListAddrByAttributes attrs; afsUUID uuid; @@ -870,7 +876,6 @@ static handleit(as) int i; afs_uint32 *addrp, tad; bulkaddrs addrs; - struct vldbentry *entry; afsUUID uuid; memset(&uuid, 0, sizeof(uuid)); @@ -899,7 +904,6 @@ static handleit(as) extern struct hostent *hostutil_GetHostByName(); struct hostent *h1, *h2; afs_uint32 a1, a2; - unsigned char n1[80], n2[80]; printf("changing %s", *argp); h1 = hostutil_GetHostByName(&(*argp)[0]); @@ -926,7 +930,6 @@ static handleit(as) } } else if (!strcmp(oper,"caid")) { afs_uint32 a1, a2; - unsigned char n1[80], n2[80]; sscanf(&(*argp)[0], "%d", &a1); printf("changing %d (0x%x)", a1, a1); @@ -972,6 +975,7 @@ main(argc, argv) } +void fill_entry(entry, argp, nargs) struct vldbentry *entry; char **argp; @@ -1008,7 +1012,7 @@ int nargs; sscanf(&(*argp)[0], "%d", &entry->cloneId); } - +void fill_update_entry(entry, argp, nargs) struct VldbUpdateEntry *entry; char **argp; @@ -1076,7 +1080,7 @@ int nargs; } } - +void fill_listattributes_entry(entry, argp, nargs) struct VldbListByAttributes *entry; char **argp; @@ -1109,6 +1113,7 @@ fill_listattributes_entry(entry, argp, nargs) entry->Mask |= VLLIST_FLAG; } +void display_listattributes_entry(entry, error) struct VldbListByAttributes *entry; int error; @@ -1130,6 +1135,7 @@ int error; #define volumetype_string(type) (type == RWVOL? "read/write":type == ROVOL? "readonly":type == BACKVOL? "backup":"unknown") +void display_entry(entry, error) struct vldbentry *entry; int error; @@ -1145,6 +1151,7 @@ int error; printf("%12u\t%10d\t%10x\n", entry->serverNumber[i], entry->serverPartition[i], entry->serverFlags[i]); } +void display_entryN(entry, error) struct nvldbentry *entry; int error; @@ -1172,7 +1179,7 @@ display_entryN(entry, error) } } - +void display_update_entry(entry, error) struct VldbUpdateEntry *entry; int error; @@ -1212,6 +1219,7 @@ int error; } } +void dump_stats(stats, vital_header) vldstats *stats; vital_vlheader *vital_header; @@ -1230,6 +1238,7 @@ vital_vlheader *vital_header; printf("total %s entries=%d\n", volumetype_string(i), ntohl(vital_header->totalEntries[i])); } +void GetArgs(line,args, nargs) register char *line; register char **args; @@ -1250,6 +1259,7 @@ GetArgs(line,args, nargs) } } +void print_usage() { printf("Valid Commands:\n"); diff --git a/src/vlserver/vldb_check.c b/src/vlserver/vldb_check.c index 4cb26d578..f87d019e1 100644 --- a/src/vlserver/vldb_check.c +++ b/src/vlserver/vldb_check.c @@ -135,7 +135,6 @@ afs_int32 NameHash(volname) char *volname; { unsigned int hash; - int i; char *vchar; hash = 0; @@ -155,7 +154,7 @@ int InvalidVolname(volname) char *volname; { char *map; - int slen; + size_t slen; map = LEGALCHARS; slen = strlen(volname); @@ -310,6 +309,7 @@ readentry(addr, vlentryp, type) } } +void readSIT(base, addr) int base; int addr; @@ -366,6 +366,7 @@ readSIT(base, addr) * Record what type of entry it is and its address in the record array. * Remember what the maximum volume id we found is and check against the header. */ +void ReadAllEntries(header) struct vlheader *header; { @@ -572,10 +573,10 @@ FollowIdHash(header) FollowFreeChain(header) struct vlheader *header; { - int count=0; + afs_int32 count=0; struct nvlentry vlentry; afs_uint32 addr; - afs_int32 i, type, rindex; + afs_int32 type, rindex; /* Now follow the Free Chain */ if (verbose) @@ -584,7 +585,7 @@ FollowFreeChain(header) readentry(addr, &vlentry, &type); if (type != FR) { printf("Free Chain %d: Bad entry at %u: Not a valid free vlentry (0x%x)\n", - i, addr, type); + count, addr, type); continue; } @@ -625,8 +626,6 @@ CheckIpAddrs(header) struct vlheader *header; { int mhblocks=0; - struct nvlentry vlentry; - afs_uint32 addr; afs_int32 i, j, m, rindex; afs_int32 mhentries, regentries; afs_int32 caddrs[VL_MAX_ADDREXTBLKS]; @@ -676,7 +675,7 @@ CheckIpAddrs(header) record[rindex].addr, caddrs[i], rindex); } if (record[rindex].type & FRC) { - printf("MH Blocks Chain %d: Bad entry at %u: Already a MH block\n", i, addr); + printf("MH Blocks Chain %d: Bad entry at %u: Already a MH block\n", i, record[rindex].addr); break; } record[rindex].type |= MHC; @@ -794,6 +793,7 @@ CheckIpAddrs(header) } +int WorkerBee(as, arock) struct cmd_syndesc *as; char *arock; @@ -921,7 +921,6 @@ main(argc, argv) char **argv; { struct cmd_syndesc *ts; - struct cmd_item *ti; setlinebuf(stdout); diff --git a/src/vlserver/vlprocs.c b/src/vlserver/vlprocs.c index 730cff553..da599610c 100644 --- a/src/vlserver/vlprocs.c +++ b/src/vlserver/vlprocs.c @@ -298,8 +298,7 @@ VL_ChangeAddr(rxcall, ip1, ip2) struct rx_call *rxcall; afs_int32 ip1, ip2; { struct ubik_trans *trans; - afs_int32 errorcode, blockindex; - struct nvlentry tentry; + afs_int32 errorcode; COUNT_REQ (VLCHANGEADDR); if (!afsconf_SuperUser(vldb_confdir, rxcall, (char *)0)) { @@ -1040,8 +1039,7 @@ bulkentries *vldbentries; VldbentryLast = VldbentryFirst + allocCount; /* Handle the attribute by volume id totally separate of the rest (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */ if (attributes->Mask & VLLIST_VOLUMEID) { - afs_int32 blockindex, chain; - struct nvlentry tempentry; + afs_int32 blockindex; blockindex = FindByID(trans, attributes->volumeid, -1, &tentry, &errorcode); if (blockindex == 0) { @@ -1148,8 +1146,7 @@ nbulkentries *vldbentries; VldbentryLast = VldbentryFirst + allocCount; /* Handle the attribute by volume id totally separate of the rest (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */ if (attributes->Mask & VLLIST_VOLUMEID) { - afs_int32 blockindex, chain; - struct nvlentry tempentry; + afs_int32 blockindex; blockindex = FindByID(trans, attributes->volumeid, -1, &tentry, &errorcode); if (blockindex == 0) { @@ -1247,7 +1244,7 @@ VL_ListAttributesN2(rxcall, attributes, name, startindex, nentries, vldbentries, int errorcode=0, maxCount=VLDBALLOCCOUNT; struct ubik_trans *trans; struct nvlentry tentry; - struct nvldbentry *Vldbentry=0, *VldbentryFirst=0, *VldbentryLast=0, tVldbentry; + struct nvldbentry *Vldbentry=0, *VldbentryFirst=0, *VldbentryLast=0; afs_int32 blockindex=0, count=0, k, match, matchindex; int serverindex=-1; /* no server found */ int findserver=0, findpartition=0, findflag=0, findname=0; @@ -1760,11 +1757,11 @@ VL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) { afs_int32 code; struct ubik_trans *trans; - int cnt, h, i, j, k, m, hostslot, base, index; + int cnt, h, i, j, k, m, base, index; struct extentaddr *exp = 0, *tex; afsUUID tuuid; afs_uint32 addrs[VL_MAXIPADDRS_PERMH]; - afs_int32 fbase, findex; + afs_int32 fbase; int count, willChangeEntry, foundUuidEntry, willReplaceCnt; int WillReplaceEntry, WillChange[MAXSERVERID+1], FoundUuid, ReplaceEntry; int srvidx, mhidx; @@ -2102,9 +2099,9 @@ struct ListAddrByAttributes *attributes; afsUUID *uuidpo; afs_int32 *uniquifier, *nentries; bulkaddrs *addrsp; -{ register afs_int32 errorcode, index=-1, op, offset; +{ register afs_int32 errorcode, index=-1, offset; struct ubik_trans *trans; - int nservers, i, j, k, base=0; + int nservers, i, j, base=0; struct extentaddr *exp=0; afsUUID tuuid; afs_uint32 *taddrp, taddr; @@ -2794,7 +2791,7 @@ register afs_uint32 ipaddr1, ipaddr2; int base, index, mhidx; afsUUID tuuid; afs_int32 blockindex, count; - int pollcount; + int pollcount = 0; struct nvlentry tentry; if (!atrans) diff --git a/src/vlserver/vlutils.c b/src/vlserver/vlutils.c index 2dda162e9..42bdea70b 100644 --- a/src/vlserver/vlutils.c +++ b/src/vlserver/vlutils.c @@ -89,7 +89,7 @@ struct ubik_trans *trans; afs_int32 offset; char *buffer; afs_int32 length; { - struct vlentry oentry, *oep; + struct vlentry oentry; struct nvlentry nentry, *nep; char *bufp; register afs_int32 i; @@ -138,7 +138,7 @@ struct ubik_trans *trans; afs_int32 offset; char *buffer; afs_int32 length; { - struct vlentry *oep, *obufp, tentry; + struct vlentry *oep, tentry; struct nvlentry *nep, *nbufp; char *bufp = (char *)&tentry; register afs_int32 i; @@ -475,7 +475,6 @@ afs_int32 FindExtentBlock(trans, uuidp, createit, hostslot, expp, basep) *expp = exp; *basep = base; if (vldbversion != VLDBVERSION_4) { - vldbversion != VLDBVERSION_4; cheader.vital_header.vldbversion = htonl(VLDBVERSION_4); code = write_vital_vlheader(trans); if (code) ERROR_EXIT(VL_IO); @@ -628,6 +627,7 @@ int hashindex; VLog(0, ("[%d]#%d: %10d %d %d (%s)\n", hashindex, i, tentry.volumeId[0], tentry.nextIdHash[0], tentry.nextNameHash, tentry.name)); } + return 0; } @@ -645,6 +645,7 @@ int hashindex; VLog(0, ("[%d]#%d: %10d %d %d (%s)\n", hashindex, i, tentry.volumeId[0], tentry.nextIdHash[0], tentry.nextNameHash, tentry.name)); } + return 0; } diff --git a/src/vol/clone.c b/src/vol/clone.c index 364535337..1294a1a9a 100644 --- a/src/vol/clone.c +++ b/src/vol/clone.c @@ -76,6 +76,9 @@ struct clone_head { struct clone_items *last; }; +void CloneVolume(); +void CloneVolume_r(); + static ci_AddItem(ah, aino) Inode aino; struct clone_head *ah; { @@ -349,6 +352,7 @@ afs_int32 DoCloneIndex(rwvp, clvp, class, reclone) return error; } +void CloneVolume(error, original, new, old) Error *error; Volume *original, *new, *old; @@ -358,6 +362,7 @@ CloneVolume(error, original, new, old) VOL_UNLOCK } +void CloneVolume_r(rerror, original, new, old) Error *rerror; Volume *original, *new, *old; diff --git a/src/vol/partition.c b/src/vol/partition.c index fc8703a9e..271772258 100644 --- a/src/vol/partition.c +++ b/src/vol/partition.c @@ -803,7 +803,6 @@ void VResetDiskUsage(void) void VAdjustDiskUsage_r(Error *ec, Volume *vp, afs_int32 blocks, afs_int32 checkBlocks) { - afs_int32 rem, minavail; *ec = 0; /* why blocks instead of checkBlocks in the check below? Otherwise, any check for less than BlocksSpare would skip the error-checking path, and we @@ -811,6 +810,8 @@ void VAdjustDiskUsage_r(Error *ec, Volume *vp, afs_int32 blocks, afs_int32 check blocks. */ if (blocks > 0) { #ifdef AFS_AIX32_ENV + afs_int32 rem, minavail; + if ((rem = vp->partition->free - checkBlocks) < (minavail = (vp->partition->totalUsable * aixlow_water) / 100)) #else @@ -833,9 +834,10 @@ void VAdjustDiskUsage(Error *ec, Volume *vp, afs_int32 blocks, afs_int32 checkBl int VDiskUsage_r(Volume *vp, afs_int32 blocks) { - afs_int32 rem, minavail; if (blocks > 0) { #ifdef AFS_AIX32_ENV + afs_int32 rem, minavail; + if ((rem = vp->partition->free - blocks) < (minavail = (vp->partition->totalUsable * aixlow_water) / 100)) #else diff --git a/src/vol/vnode.c b/src/vol/vnode.c index 4ab88597b..bad05c47c 100644 --- a/src/vol/vnode.c +++ b/src/vol/vnode.c @@ -60,6 +60,8 @@ RCSID("$Header$"); struct VnodeClassInfo VnodeClassInfo[nVNODECLASSES]; private int moveHash(); +void StickOnLruChain_r(); +void VPutVnode_r(); #define BAD_IGET -1000 @@ -183,7 +185,7 @@ VInitVnodes(class,nVnodes) } if (nVnodes == 0) - return; + return 0; va = (byte *) calloc(nVnodes,vcp->residentSize); assert (va != NULL); @@ -214,6 +216,7 @@ VInitVnodes(class,nVnodes) } va += vcp->residentSize; } + return 0; } @@ -360,7 +363,7 @@ Vnode *VAllocVnode_r(ec,vp,type) LWP_CurrentProcess(&vnp->writer); #endif /* AFS_PTHREAD_ENV */ /* Sanity check: is this vnode really not in use? */ - { int n; + { int size; IHandle_t *ihP = vp->vnodeIndex[class].handle; FdHandle_t *fdP; @@ -653,7 +656,7 @@ Vnode *VGetVnode_r(ec,vp,vnodeNumber,locktype) int TrustVnodeCacheEntry = 1; /* This variable is bogus--when it's set to 0, the hash chains fill up with multiple versions of the same vnode. Should fix this!! */ - +void VPutVnode(ec,vnp) Error *ec; register Vnode *vnp; @@ -663,6 +666,7 @@ VPutVnode(ec,vnp) VOL_UNLOCK } +void VPutVnode_r(ec,vnp) Error *ec; register Vnode *vnp; @@ -911,8 +915,10 @@ static int moveHash(vnp, newHash) vnp->hashNext = VnodeHashTable[newHash]; VnodeHashTable[newHash] = vnp; vnp->hashIndex = newHash; + return 0; } +void StickOnLruChain_r(vnp,vcp) register Vnode *vnp; register struct VnodeClassInfo *vcp; diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 9d4ab5fc4..eed39e563 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -1424,7 +1424,7 @@ int OnlyOneVolume(inodeinfo, singleVolumeNumber) int GetInodeSummary(char *path, VolumeId singleVolumeNumber) { struct stat status; - int summaryFd, forceSal, err; + int forceSal, err; struct ViceInodeInfo *ip; struct InodeSummary summary; char summaryFileName[50]; @@ -2920,7 +2920,6 @@ void DistilVnodeEssence(VolumeId rwVId, VnodeClass class, Inode ino, struct VnodeClassInfo *vcp = &VnodeClassInfo[class]; char buf[SIZEOF_LARGEDISKVNODE]; struct VnodeDiskObject *vnode = (struct VnodeDiskObject *) buf; - int code; int size; StreamHandle_t *file; int vnodeIndex; @@ -3444,7 +3443,7 @@ int CopyInode(Device device, Inode inode1, Inode inode2, int rwvolume) char buf[4096]; IHandle_t *srcH, *destH; FdHandle_t *srcFdP, *destFdP; - register int n; + register int n = 0; IH_INIT(srcH, device, rwvolume, inode1); srcFdP = IH_OPEN(srcH); diff --git a/src/vol/vutil.c b/src/vol/vutil.c index b2fafa18d..b4d5434b4 100644 --- a/src/vol/vutil.c +++ b/src/vol/vutil.c @@ -64,6 +64,11 @@ RCSID("$Header$"); #include #endif +void AssignVolumeName(); +void AssignVolumeName_r(); +void ClearVolumeStats(); +void ClearVolumeStats_r(); + #define nFILES (sizeof (stuff)/sizeof(struct stuff)) @@ -110,19 +115,15 @@ Volume *VCreateVolume_r(ec, partname, volumeId, parentId) no parent */ { VolumeDiskData vol; - int fd, fd1, i; + int fd, i; char headerName[32], volumePath[64]; - struct stat status; Device device; struct DiskPartition *partition; struct VolumeDiskHeader diskHeader; - int code; IHandle_t *handle; FdHandle_t *fdP; Inode nearInode=0; - - *ec = 0; memset(&vol, 0, sizeof (vol)); vol.id = volumeId; @@ -279,6 +280,7 @@ Volume *VCreateVolume_r(ec, partname, volumeId, parentId) } +void AssignVolumeName(vol, name, ext) register VolumeDiskData *vol; char *name,*ext; @@ -288,6 +290,7 @@ AssignVolumeName(vol, name, ext) VOL_UNLOCK } +void AssignVolumeName_r(vol, name, ext) register VolumeDiskData *vol; char *name,*ext; @@ -338,6 +341,7 @@ afs_int32 CopyVolumeHeader(from, to) return(code); } +void ClearVolumeStats(vol) register VolumeDiskData *vol; { @@ -346,6 +350,7 @@ ClearVolumeStats(vol) VOL_UNLOCK } +void ClearVolumeStats_r(vol) register VolumeDiskData *vol; { diff --git a/src/volser/common.c b/src/volser/common.c index f8d5ec66f..9de0f305d 100644 --- a/src/volser/common.c +++ b/src/volser/common.c @@ -36,6 +36,7 @@ char *s; abort(); } +void InitErrTabs() { initialize_ka_error_table(); diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index 9714b7d0f..1d9755953 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -417,7 +417,7 @@ static int DumpFile(struct iod *iodp, char tag, int vnode, FdHandle_t *handleP) { int code = 0, lcode = 0, error = 0; afs_int32 pad = 0, offset; - int n, nbytes, howMany; + int n, nbytes, howMany, howBig; byte *p; struct stat status; int size; @@ -427,9 +427,13 @@ static int DumpFile(struct iod *iodp, char tag, int vnode, FdHandle_t *handleP) #endif #ifdef AFS_NT40_ENV - howMany = 4096; /* Page size */ + howBig = _filelength(handleP->fd_fd); + howMany = 4096; + #else fstat(handleP->fd_fd, &status); + howBig = status.st_size; + #ifdef AFS_AIX_ENV /* Unfortunately in AIX valuable fields such as st_blksize are * gone from the stat structure. @@ -438,9 +442,10 @@ static int DumpFile(struct iod *iodp, char tag, int vnode, FdHandle_t *handleP) howMany = tstatfs.f_bsize; #else howMany = status.st_blksize; -#endif +#endif /* AFS_AIX_ENV */ #endif /* AFS_NT40_ENV */ + size = FDH_SIZE(handleP); code = DumpInt32(iodp, tag, size); if (code) { @@ -490,7 +495,7 @@ static int DumpFile(struct iod *iodp, char tag, int vnode, FdHandle_t *handleP) */ memset(p+n, 0, howMany-n); if (!pad) - offset = (status.st_size - nbytes) + n; + offset = (howBig - nbytes) + n; pad += (howMany-n); /* Now seek over the data we could not get. An error here means we @@ -631,7 +636,6 @@ static int DumpVnodeIndex(register struct iod *iodp, Volume *vp, char buf[SIZEOF_LARGEDISKVNODE]; struct VnodeDiskObject *vnode = (struct VnodeDiskObject *) buf; StreamHandle_t *file; - IHandle_t *handle; FdHandle_t *fdP; int size; int flag; diff --git a/src/volser/lockprocs.c b/src/volser/lockprocs.c index e4a372fa7..b52f3e80c 100644 --- a/src/volser/lockprocs.c +++ b/src/volser/lockprocs.c @@ -71,6 +71,7 @@ int FindIndex(entry, server, part, type) } /* Changes the rw site only */ +void SetAValue (entry, oserver, opart, nserver, npart, type) struct nvldbentry *entry; afs_int32 oserver, opart, nserver, npart, type; diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 9810a6a4a..93bce59f5 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -1584,13 +1584,15 @@ afs_int32 VolListPartitions (acid, partIds) struct rx_call *acid; struct pIDs *partIds; { - struct stat rbuf, pbuf; char namehead[9]; + struct stat rbuf, pbuf; int code; char i; + + strcpy(namehead, "/vicep"); /*7 including null terminator*/ + #ifdef AFS_NT40_ENV /* Just return attached partitions. */ - strcpy(namehead, "/vicep"); namehead[7] = '\0'; for (i=0; i<26; i++) { namehead[6] = i + 'a'; @@ -1598,9 +1600,8 @@ struct pIDs *partIds; partIds->partIds[i] = VGetPartition(namehead, 0) ? i : -1; } #else - strcpy(namehead, "/vicep"); /*7 including null terminator*/ - code = stat("/",&rbuf); /*interested in buf->st_dev*/ + (void) stat("/",&rbuf); /*interested in buf->st_dev*/ for(i = 0 ; i < 26 ; i++){ @@ -1613,8 +1614,6 @@ struct pIDs *partIds; else partIds->partIds[i ] = -1; } else partIds->partIds[i ] = -1; - - } #endif return 0; diff --git a/src/volser/vos.c b/src/volser/vos.c index 806fd038f..395795442 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -3153,7 +3153,7 @@ static ListVLDB(as) if (vcode == RXGEN_OPCODE) { /* Vlserver not running with ListAttributesN2. Fall back */ vcode = VLDB_ListAttributes(&attributes, ¢ries, &arrayEntries); - nextindex == -1; + nextindex = -1; } if (vcode) { fprintf(STDERR,"Could not access the VLDB for attributes\n"); diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 6e797730d..1c776d43f 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -65,12 +65,16 @@ extern int VL_SetLock(); extern int VL_ReleaseLock(); extern int VL_DeleteEntry(); +void MapNetworkToHost(); +void MapHostToNetwork(); + struct release { afs_int32 time; afs_int32 vldbEntryIndex; }; /*map the partition into partition name */ +void MapPartIdIntoName(partId, partName) afs_int32 partId; char *partName; @@ -79,14 +83,14 @@ char *partName; strcpy(partName,"/vicep"); partName[6] = partId + 'a'; partName[7] = '\0'; - return 0; + return; } else if (partId < VOLMAXPARTS) { strcpy(partName,"/vicep"); partId -= 26; partName[6] = 'a' + (partId/26); partName[7] = 'a' + (partId%26); partName[8] = '\0'; - return 0; + return; } } @@ -364,9 +368,6 @@ struct nvldbentry *entry; void EnumerateEntry(entry) struct nvldbentry *entry; { - int i; - char pname[10]; - int isMixed = 0; fprintf(STDOUT,"\n"); fprintf(STDOUT,"%s \n",entry->name); @@ -535,9 +536,8 @@ UV_AddVLDBEntry(aserver, apart, aname, aid) afs_int32 aid; { register struct rx_connection *aconn; - register afs_int32 code; afs_int32 error; - afs_int32 rcode,vcode; + afs_int32 vcode; struct nvldbentry entry,storeEntry;/*the new vldb entry */ aconn = (struct rx_connection *)0; @@ -1760,7 +1760,7 @@ static int DelVol (conn, vid, part, flags) struct rx_connection *conn; afs_int32 vid, part, flags; { - afs_int32 acode, bcode, ccode, rcode, tid; + afs_int32 acode, ccode, rcode, tid; ccode = rcode = tid = 0; acode = AFSVolTransCreate(conn, vid, part, flags, &tid); @@ -1931,7 +1931,7 @@ UV_ReleaseVolume(afromvol, afromserver, afrompart, forceflag) afs_int32 cloneVolId, roVolId; struct replica *replicas=0; struct nvldbentry entry,storeEntry; - int i, volcount, k, m, n, fullrelease, vldbindex; + int i, volcount, m, fullrelease, vldbindex; int failure; struct restoreCookie cookie; struct rx_connection **toconns=0; @@ -1943,7 +1943,7 @@ UV_ReleaseVolume(afromvol, afromserver, afrompart, forceflag) afs_int32 clonetid=0, onlinetid; afs_int32 fromtid=0; afs_uint32 fromdate, thisdate; - int ix, si, s; + int s; manyDests tr; manyResults results; int rwindex, roindex, roclone, roexists; @@ -3491,7 +3491,6 @@ static afs_int32 CheckVolume(volumeinfo, aserver, apart, modentry, maxvolid) int idx, j; afs_int32 code, error = 0; struct nvldbentry entry, storeEntry; - int sameserver; char pname[10]; int pass=0, islocked=0, createentry, addvolume, modified, mod; afs_int32 rwvolid; @@ -4402,10 +4401,9 @@ afs_int32 CheckVldb(entry, modified) afs_int32 *modified; { afs_int32 code, error=0; - int idx; struct nvldbentry storeEntry; int islocked=0, mod, modentry, delentry=0; - int foundro, pass=0; + int pass=0; if (modified) *modified = 0; if (verbose) { @@ -4926,6 +4924,7 @@ UV_SetVolume(server, partition, volid, transflag, setflag, sleeptime) /*maps the host addresses in (present in network byte order) to that in< new> (present in host byte order )*/ +void MapNetworkToHost(old, new) struct nvldbentry *old, *new; { @@ -4947,10 +4946,10 @@ struct nvldbentry *old, *new; new->volumeId[BACKVOL] = old->volumeId[BACKVOL]; new->cloneId = old->cloneId; new->flags = old->flags; - } /*maps the host entries in which are present in host byte order to network byte order */ +void MapHostToNetwork(entry) struct nvldbentry *entry; { diff --git a/src/volser/vsutils.c b/src/volser/vsutils.c index 746656e3a..416026734 100644 --- a/src/volser/vsutils.c +++ b/src/volser/vsutils.c @@ -105,7 +105,7 @@ VLDB_CreateEntry(entryp) struct nvldbentry *entryp; { struct vldbentry oentry; - register int code, (*nproc)(); + register int code; if (newvlserver == 1) { tryold: @@ -132,7 +132,7 @@ VLDB_GetEntryByID(volid, voltype, entryp) struct nvldbentry *entryp; { struct vldbentry oentry; - register int code, (*nproc)(); + register int code; if (newvlserver == 1) { tryold: @@ -158,7 +158,7 @@ VLDB_GetEntryByName(namep, entryp) struct nvldbentry *entryp; { struct vldbentry oentry; - register int code, (*nproc)(); + register int code; if (newvlserver == 1) { tryold: @@ -184,7 +184,7 @@ VLDB_ReplaceEntry(volid, voltype, entryp, releasetype) struct nvldbentry *entryp; { struct vldbentry oentry; - register int code, (*nproc)(); + register int code; if (newvlserver == 1) { tryold: @@ -270,8 +270,7 @@ extern int VL_GetAddrsU(); VLDB_IsSameAddrs(serv1, serv2, errorp) afs_int32 serv1, serv2, *errorp; { - struct vldbentry oentry; - register int code, (*nproc)(); + register int code; ListAddrByAttributes attrs; bulkaddrs addrs; afs_uint32 *addrp, nentries, unique, i, j, f1, f2; @@ -536,7 +535,7 @@ char *astring; { char *str,*ptr, volname[VOLSER_OLDMAXVOLNAME+1]; int tryname, curval; struct nvldbentry entry; - afs_int32 vcode; + afs_int32 vcode = 0; int total; *errp = 0; -- 2.39.5