From 0a8f1e16ae1a18094fa28521f29bee911aa6dcfb Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Mon, 16 Mar 2009 13:24:25 +0000 Subject: [PATCH] venus-prototypes-20090316 LICENSE IPL10 FIXES 124250 prototype the venus directory --- src/venus/cmdebug.c | 18 ++- src/venus/fs.c | 98 +++++++-------- src/venus/fstrace.c | 296 +++++++++++++++++++------------------------- src/venus/kdump.c | 204 +++++++++++------------------- src/venus/livesys.c | 5 +- src/venus/up.c | 7 +- 6 files changed, 255 insertions(+), 373 deletions(-) diff --git a/src/venus/cmdebug.c b/src/venus/cmdebug.c index 1685113b1..957e62706 100644 --- a/src/venus/cmdebug.c +++ b/src/venus/cmdebug.c @@ -38,8 +38,6 @@ RCSID #include #include -extern struct hostent *hostutil_GetHostByName(); - static int print_ctime = 0; static int @@ -62,7 +60,7 @@ PrintCacheConfig(struct rx_connection *aconn) struct cm_initparams_v1 *c1; if (c.cacheConfig_len != sizeof(*c1) / sizeof(afs_uint32)) { - printf("cmdebug: configuration data size mismatch (%d != %d)\n", + printf("cmdebug: configuration data size mismatch (%d != %lu)\n", c.cacheConfig_len, sizeof(*c1) / sizeof(afs_uint32)); return 0; } @@ -284,9 +282,9 @@ PrintCacheEntries32(struct rx_connection *aconn, int aint32) continue; } - if (aint32 == 0 && !IsLocked(¢ry.lock) || - aint32 == 2 && centry.refCount == 0 || - aint32 == 4 && centry.callback == 0) + if ((aint32 == 0 && !IsLocked(¢ry.lock)) || + (aint32 == 2 && centry.refCount == 0) || + (aint32 == 4 && centry.callback == 0)) continue; /* otherwise print this entry */ @@ -361,7 +359,6 @@ PrintCacheEntries64(struct rx_connection *aconn, int aint32) register afs_int32 code; struct AFSDBCacheEntry64 centry; char *cellname; - int ce64 = 0; for (i = 0; i < 1000000; i++) { code = RXAFSCB_GetCE64(aconn, i, ¢ry); @@ -381,9 +378,9 @@ PrintCacheEntries64(struct rx_connection *aconn, int aint32) continue; } - if (aint32 == 0 && !IsLocked(¢ry.lock) || - aint32 == 2 && centry.refCount == 0 || - aint32 == 4 && centry.callback == 0) + if ((aint32 == 0 && !IsLocked(¢ry.lock)) || + (aint32 == 2 && centry.refCount == 0) || + (aint32 == 4 && centry.callback == 0)) continue; /* otherwise print this entry */ @@ -477,7 +474,6 @@ PrintCacheEntries(struct rx_connection *aconn, int aint32) static int PrintCellServDBEntry(struct rx_connection *aconn, afs_int32 cellnum) { - static struct cell_cache *cache; int code; char *cellname; serverList sl; diff --git a/src/venus/fs.c b/src/venus/fs.c index f59cc5748..7112e08a9 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -49,8 +49,10 @@ RCSID #include #include #include - - +#include +#include +#include + #define MAXHOSTS 13 #define OMAXHOSTS 8 #define MAXCELLHOSTS 8 @@ -63,23 +65,26 @@ static char space[MAXSIZE]; static char tspace[1024]; static struct ubik_client *uclient; -static int GetClientAddrsCmd(), SetClientAddrsCmd(), FlushMountCmd(); -static int RxStatProcCmd(), RxStatPeerCmd(), GetFidCmd(), UuidCmd(); - -extern char *hostutil_GetNameByINet(); -extern struct hostent *hostutil_GetHostByName(); - +static int GetClientAddrsCmd(struct cmd_syndesc *, void *); +static int SetClientAddrsCmd(struct cmd_syndesc *, void *); +static int FlushMountCmd(struct cmd_syndesc *, void *); +static int RxStatProcCmd(struct cmd_syndesc *, void *); +static int RxStatPeerCmd(struct cmd_syndesc *, void *); +static int GetFidCmd(struct cmd_syndesc *, void *); +static int UuidCmd(struct cmd_syndesc *, void *); static char pn[] = "fs"; static int rxInitDone = 0; -static void ZapList(); -static int PruneList(); -static CleanAcl(); +struct AclEntry; +struct Acl; +static void ZapList(struct AclEntry *); +static int PruneList(struct AclEntry **, int); +static int CleanAcl(struct Acl *, char *); static int SetVolCmd(struct cmd_syndesc *as, void *arock); -static GetCellName(); -static VLDBInit(); -static void Die(); +static int GetCellName(char *, struct afsconf_cell *); +static int VLDBInit(int, struct afsconf_cell *); +static void Die(int, char *); /* * Character to use between name and rights in printed representation for @@ -114,8 +119,7 @@ struct vcxstat2 { }; static void -ZapAcl(acl) - struct Acl *acl; +ZapAcl(struct Acl *acl) { if (!acl) return; @@ -124,10 +128,8 @@ ZapAcl(acl) free(acl); } -static -foldcmp(a, b) - char *a; - char *b; +static int +foldcmp(char *a, char *b) { char t, u; while (1) { @@ -869,9 +871,7 @@ CopyACLCmd(struct cmd_syndesc *as, void *arock) struct ViceIoctl blob; struct Acl *fa, *ta = 0; struct AclEntry *tp; - struct cmd_item *ti, *ui; - int plusp; - afs_int32 rights; + struct cmd_item *ti; int clear; int idf = getidf(as, parm_copyacl_id); int error = 0; @@ -970,14 +970,14 @@ GetCell(char *fname, char *cellname) * negative sign), then it might be bad. We then query the ptserver * to see. */ -static +static int BadName(char *aname, char *fname) { afs_int32 tc, code, id; char *nm; char cell[MAXCELLCHARS]; - for (nm = aname; tc = *nm; nm++) { + for (nm = aname; (tc = *nm); nm++) { /* all must be '-' or digit to be bad */ if (tc != '-' && (tc < '0' || tc > '9')) return 0; @@ -999,7 +999,7 @@ BadName(char *aname, char *fname) /* clean up an access control list of its bad entries; return 1 if we made any changes to the list, and 0 otherwise */ -static +static int CleanAcl(struct Acl *aa, char *fname) { struct AclEntry *te, **le, *ne; @@ -1778,7 +1778,7 @@ defect #3069 /* Check for a cellname in the volume specification, and complain * if it doesn't match what was specified with -cell */ - if (tmpName = strchr(volName, ':')) { + if ((tmpName = strchr(volName, ':'))) { *tmpName = '\0'; if (cellName) { if (strcasecmp(cellName, volName)) { @@ -1912,8 +1912,6 @@ CheckServersCmd(struct cmd_syndesc *as, void *arock) afs_int32 j; afs_int32 temp; char *tp; - char tbuffer[128]; - afs_int32 interval; struct afsconf_cell info; struct chservinfo checkserv; @@ -2008,8 +2006,6 @@ MessagesCmd(struct cmd_syndesc *as, void *arock) { afs_int32 code = 0; struct ViceIoctl blob; - afs_int32 j; - afs_int32 temp; struct gaginfo gagflags; struct cmd_item *show; @@ -2020,7 +2016,7 @@ MessagesCmd(struct cmd_syndesc *as, void *arock) blob.out = space; memset(space, 0, sizeof(afs_int32)); /* so we assure zero when nothing is copied back */ - if (show = as->parms[0].items) { + if ((show = as->parms[0].items)) { if (!strcasecmp(show->data, "user")) gagflags.showflags |= GAGUSER; else if (!strcasecmp(show->data, "console")) @@ -2068,7 +2064,7 @@ CheckVolumesCmd(struct cmd_syndesc *as, void *arock) } static int -PreCacheCmd(struct cmd_syndesc *as, char *arock) +PreCacheCmd(struct cmd_syndesc *as, void *arock) { afs_int32 code; struct ViceIoctl blob; @@ -2209,9 +2205,9 @@ GetCacheParmsCmd(struct cmd_syndesc *as, void *arock) } if (percentBlocks > 90) - printf("[cache size usage over 90%, consider increasing cache size]\n"); + printf("[cache size usage over 90%%, consider increasing cache size]\n"); if (percentFiles > 90) - printf("[cache file usage over 90%, consider increasing '-files' argument to afsd]\n"); + printf("[cache file usage over 90%%, consider increasing '-files' argument to afsd]\n"); return 0; } @@ -2221,8 +2217,7 @@ ListCellsCmd(struct cmd_syndesc *as, void *arock) { afs_int32 code; afs_int32 i, j; - char *tcp, *tp; - afs_int32 clear; + char *tp; struct ViceIoctl blob; int resolve; @@ -2305,7 +2300,6 @@ CallBackRxConnCmd(struct cmd_syndesc *as, void *arock) struct cmd_item *ti; afs_int32 hostAddr; struct hostent *thp; - char *tp; int setp; ti = as->parms[0].items; @@ -2376,7 +2370,7 @@ NewCellCmd(struct cmd_syndesc *as, void *arock) char *tp, *cellname = 0; struct hostent *thp; afs_int32 fsport = 0, vlport = 0; - afs_int32 magic, scount; /* Number of servers to pass in pioctl call */ + afs_int32 scount; /* Number of servers to pass in pioctl call */ /* Yuck! * With the NEWCELL pioctl call, 3.4 clients take an array of @@ -2714,7 +2708,7 @@ ExportAfsCmd(struct cmd_syndesc *as, void *arock) } exp = 1; } - if (ti = as->parms[2].items) { /* -noconvert */ + if ((ti = as->parms[2].items)) { /* -noconvert */ if (strcmp(ti->data, "on") == 0) mode = 2; else if (strcmp(ti->data, "off") == 0) @@ -2724,7 +2718,7 @@ ExportAfsCmd(struct cmd_syndesc *as, void *arock) return 1; } } - if (ti = as->parms[3].items) { /* -uidcheck */ + if ((ti = as->parms[3].items)) { /* -uidcheck */ if (strcmp(ti->data, "on") == 0) pwsync = 3; else if (strcmp(ti->data, "off") == 0) @@ -2734,7 +2728,7 @@ ExportAfsCmd(struct cmd_syndesc *as, void *arock) return 1; } } - if (ti = as->parms[4].items) { /* -submounts */ + if ((ti = as->parms[4].items)) { /* -submounts */ if (strcmp(ti->data, "on") == 0) smounts = 3; else if (strcmp(ti->data, "off") == 0) @@ -2744,7 +2738,7 @@ ExportAfsCmd(struct cmd_syndesc *as, void *arock) return 1; } } - if (ti = as->parms[5].items) { /* -clipags */ + if ((ti = as->parms[5].items)) { /* -clipags */ if (strcmp(ti->data, "on") == 0) clipags = 3; else if (strcmp(ti->data, "off") == 0) @@ -2754,7 +2748,7 @@ ExportAfsCmd(struct cmd_syndesc *as, void *arock) return 1; } } - if (ti = as->parms[6].items) { /* -pagcb */ + if ((ti = as->parms[6].items)) { /* -pagcb */ if (strcmp(ti->data, "on") == 0) pagcb = 3; else if (strcmp(ti->data, "off") == 0) @@ -3003,7 +2997,6 @@ addServer(char *name, afs_int32 rank) struct setspref *ssp; struct spref *sp; struct hostent *thostent; - afs_uint32 addr; int error = 0; #ifndef MAXUSHORT @@ -3039,7 +3032,7 @@ addServer(char *name, afs_int32 rank) if (debug) fprintf(stderr, "adding server %s, rank %d, ip addr 0x%lx\n", - name, sp->rank, sp->server.s_addr); + name, sp->rank, (long unsigned int) sp->server.s_addr); } return error; @@ -3080,7 +3073,7 @@ SetPrefCmd(struct cmd_syndesc *as, void *arock) perror(ti->data); error = -1; } else { - while (fscanf(infd, "%79s%ld", name, &rank) != EOF) { + while (fscanf(infd, "%79s%ld", name, (long int *)&rank) != EOF) { code = addServer(name, (unsigned short)rank); if (code) error = code; @@ -3090,7 +3083,7 @@ SetPrefCmd(struct cmd_syndesc *as, void *arock) ti = as->parms[3].items; /* -stdin */ if (ti) { - while (scanf("%79s%ld", name, &rank) != EOF) { + while (scanf("%79s%ld", name, (long int *)&rank) != EOF) { code = addServer(name, (unsigned short)rank); if (code) error = code; @@ -3158,7 +3151,7 @@ GetPrefCmd(struct cmd_syndesc *as, void *arock) afs_int32 code; struct cmd_item *ti; char *name, tbuffer[20]; - afs_int32 rank, addr; + afs_int32 addr; FILE *outfd; int resolve; int vlservers = 0; @@ -3860,8 +3853,6 @@ static int GetClientAddrsCmd(struct cmd_syndesc *as, void *arock) { afs_int32 code; - struct cmd_item *ti; - char *name; struct ViceIoctl blob; struct sprefrequest *in; struct sprefinfo *out; @@ -3907,11 +3898,10 @@ SetClientAddrsCmd(struct cmd_syndesc *as, void *arock) { afs_int32 code, addr; struct cmd_item *ti; - char name[80]; struct ViceIoctl blob; struct setspref *ssp; int sizeUsed = 0, i, flag; - afs_int32 existingAddr[1024]; /* existing addresses on this host */ + afs_uint32 existingAddr[1024]; /* existing addresses on this host */ int existNu; int error = 0; @@ -4102,7 +4092,6 @@ RxStatProcCmd(struct cmd_syndesc *as, void *arock) afs_int32 code; afs_int32 flags = 0; struct ViceIoctl blob; - struct cmd_item *ti; if (as->parms[0].items) { /* -enable */ flags |= AFSCALL_RXSTATS_ENABLE; @@ -4137,7 +4126,6 @@ RxStatPeerCmd(struct cmd_syndesc *as, void *arock) afs_int32 code; afs_int32 flags = 0; struct ViceIoctl blob; - struct cmd_item *ti; if (as->parms[0].items) { /* -enable */ flags |= AFSCALL_RXSTATS_ENABLE; diff --git a/src/venus/fstrace.c b/src/venus/fstrace.c index c8cfc586f..70f831d1b 100644 --- a/src/venus/fstrace.c +++ b/src/venus/fstrace.c @@ -18,6 +18,7 @@ RCSID #include #include +#include #if !defined(AFS_SUN3_ENV) && !defined(sys_vax_ul43) #include /*#ifdef AFS_AIX_ENV*/ @@ -34,6 +35,9 @@ RCSID #include #include #include +#include +#include +#include #if defined(AFS_OSF_ENV) || defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) /* For SGI 6.2, this is changed to 1 if it's a 32 bit kernel. */ @@ -68,6 +72,20 @@ set_kernel_sizeof_long(void) #endif /* AFS_SGI62_ENV */ #endif /* AFS_SGI61_ENV */ +int afs_syscall(long call, long parm0, long parm1, long parm2, long parm3, + long parm4, long parm5, long parm6); +void dce1_error_inq_text(afs_uint32 status_to_convert, + char *error_text, int *status); +int icl_CreateSetWithFlags(char *name, struct afs_icl_log *baseLogp, + struct afs_icl_log *fatalLogp, afs_uint32 flags, + struct afs_icl_set **outSetpp); +int icl_LogHold(register struct afs_icl_log *logp); +int icl_LogUse(register struct afs_icl_log *logp); +int icl_LogReleNL(register struct afs_icl_log *logp); +int icl_LogRele(register struct afs_icl_log *logp); +int icl_ZeroLog(register struct afs_icl_log *logp); +int icl_LogFreeUse(register struct afs_icl_log *logp); + #define BUFFER_MULTIPLIER 1024 /* make it big enough to snapshot everything at once, since @@ -82,8 +100,7 @@ struct logInfo { char dumpFileName[256] = ""; void -RegisterIclDumpFileName(name) - char *name; +RegisterIclDumpFileName(char *name) { (void)sprintf(dumpFileName, "icl.%.250s", name); } @@ -99,10 +116,8 @@ char *name; /* given a type and an address, get the size of the thing * in words. */ -static -icl_GetSize(type, addr) - afs_int32 type; - char *addr; +static int +icl_GetSize(afs_int32 type, char *addr) { int rsize; int tsize; @@ -119,11 +134,7 @@ icl_GetSize(type, addr) */ #if defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) static int -CheckTypes(bufferp, typesp, typeCount, outMsgBuffer) - char *bufferp; - int *typesp; - int typeCount; - char *outMsgBuffer; +CheckTypes(char *bufferp, int *typesp, int typeCount, char *outMsgBuffer) { register char tc; int inPercent; @@ -197,11 +208,8 @@ CheckTypes(bufferp, typesp, typeCount, outMsgBuffer) /* not reached */ } #else /* AFS_SGI61_ENV */ -static -CheckTypes(bufferp, typesp, typeCount) - char *bufferp; - int *typesp; - int typeCount; +static int +CheckTypes(char *bufferp, int *typesp, int typeCount) { register char tc; int inPercent; @@ -254,10 +262,7 @@ CheckTypes(bufferp, typesp, typeCount) #define uint64_t long long #endif static void -DisplayRecord(outFilep, alp, rsize) - FILE *outFilep; - register afs_int32 *alp; - afs_int32 rsize; +DisplayRecord(FILE *outFilep, register afs_int32 *alp, afs_int32 rsize) { char msgBuffer[1024]; #if defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) @@ -279,7 +284,6 @@ DisplayRecord(outFilep, alp, rsize) int pftix; /* index in printfTypes */ int status; int printed; /* did we print the string yet? */ - afs_int32 *tlp; time_t tmv; /* decode parameters */ @@ -547,9 +551,7 @@ static CATD *catsopen[NL_MAXOPEN]; (((num_holes) > 100) && ((num_holes) > (num_non_holes))) char * -rmalloc(n) - int n; - +rmalloc(int n) /*---- n: the number of bytes to be malloc'ed ----*/ { char *t; @@ -563,9 +565,7 @@ rmalloc(n) #ifdef notdef #endif nl_catd -catopen1(cat, dummy) - char *cat; - int dummy; +catopen1(char *cat, int dummy) /*---- char *cat: the name of the cat to be opened ----*/ /*---- int dummy: dummy variable ----*/ @@ -609,11 +609,8 @@ catopen1(cat, dummy) nl_catd -_do1_open(catd) - nl_catd catd; - +_do1_open(nl_catd catd) /*---- pointer to the partially set up cat descriptor ----*/ - { int make_sets(); /*---- routine to unpack the sets into fast acccess mode ----*/ @@ -747,10 +744,8 @@ _do1_open(catd) static void -add_open_cat(catd) - nl_catd catd; +add_open_cat(nl_catd catd) /*---- catd to be added to the list of catalogs ----*/ - { int i = 0; /*---- Misc counter(s) used for loops ----*/ while (i < NL_MAXOPEN && catsopen[i]) { @@ -787,8 +782,7 @@ add_open_cat(catd) static int -make_sets(catd) - nl_catd catd; +make_sets(nl_catd catd) { struct _catset *cset; char *base = catd->_mem; @@ -888,8 +882,7 @@ make_sets(catd) */ static FILE * -open1catfile(file) - char *file; +open1catfile(char *file) { extern char *getenv(); char fl[PATH_MAX]; /*---- place to hold full path ----*/ @@ -1057,10 +1050,8 @@ open1catfile(file) */ static nl_catd -cat_already_open(cat) - char *cat; +cat_already_open(char *cat) /*---- name of the catalog to be opened ----*/ - { int i; /*---- Misc counter(s) used for loops ----*/ @@ -1078,9 +1069,8 @@ cat_already_open(cat) int -catclose1(catd) /*---- the catd to be closed ----*/ - nl_catd catd; /*---- the catd to be closed ----*/ - +catclose1(nl_catd catd) + /*---- the catd to be closed ----*/ { int i; @@ -1116,10 +1106,8 @@ catclose1(catd) /*---- the catd to be closed ----*/ } static void -cat_hard_close(catd) - nl_catd catd; +cat_hard_close(nl_catd catd) /*---- the catd to be closed ----*/ - { int i; /*---- Misc counter(s) used for loops ----*/ int j; /*---- Misc counter ----*/ @@ -1177,7 +1165,6 @@ cat_hard_close(catd) static char * _do1_read_msg(nl_catd catd, int setno, int msgno) - /*---- catd: the catd of the catalog to be read from ----*/ /*---- setno: the set number of the message ----*/ /*---- msgno: the msgno of the message ----*/ @@ -1473,11 +1460,9 @@ catgets1(nl_catd catd, int setno, int msgno, char *def) #define RPC_NLS_FORMAT "%s.cat" #endif -dce1_error_inq_text(status_to_convert, error_text, status) - afs_uint32 status_to_convert; - unsigned char *error_text; - int *status; - +void +dce1_error_inq_text(afs_uint32 status_to_convert, + char *error_text, int *status) { unsigned short facility_code; unsigned short component_code; @@ -1639,10 +1624,8 @@ dce1_error_inq_text(status_to_convert, error_text, status) } - -icl_DumpKernel(outFilep, setname) - FILE *outFilep; - char *setname; +int +icl_DumpKernel(FILE *outFilep, char *setname) { afs_int32 bufferSize = 0; afs_int32 *bufferp; @@ -1781,8 +1764,8 @@ icl_DumpKernel(outFilep, setname) } /* clear out log 'name' */ -icl_ClearLog(name) - char *name; +int +icl_ClearLog(char *name) { afs_int32 code; @@ -1791,8 +1774,8 @@ icl_ClearLog(name) } /* clear out set 'name' */ -icl_ClearSet(name) - char *name; +int +icl_ClearSet(char *name) { afs_int32 code; @@ -1801,7 +1784,8 @@ icl_ClearSet(name) } /* clear out all logs */ -icl_ClearAll() +int +icl_ClearAll(void) { afs_int32 code; @@ -1811,8 +1795,7 @@ icl_ClearAll() /* list out all available sets to outFileP */ int -icl_ListSets(outFileP) - FILE *outFileP; +icl_ListSets(FILE *outFileP) { int i; afs_int32 code = 0; @@ -1836,9 +1819,7 @@ icl_ListSets(outFileP) /* list out all available logs to outFileP */ int -icl_ListLogs(outFileP, int32flg) - FILE *outFileP; - int int32flg; +icl_ListLogs(FILE *outFileP, int int32flg) { int i; int allocated; @@ -1871,10 +1852,7 @@ icl_ListLogs(outFileP, int32flg) /* list out all available logs to outFileP */ int -icl_ListLogsBySet(outFileP, setname, int32flg) - FILE *outFileP; - char *setname; - int int32flg; +icl_ListLogsBySet(FILE *outFileP, char *setname, int int32flg) { int i; afs_int32 code = 0; @@ -1912,9 +1890,7 @@ icl_ListLogsBySet(outFileP, setname, int32flg) /* activate/deactivate/free specified set */ int -icl_ChangeSetState(name, op) - char *name; - afs_int32 op; +icl_ChangeSetState(char *name, afs_int32 op) { afs_int32 code; @@ -1924,8 +1900,7 @@ icl_ChangeSetState(name, op) /* activate/deactivate/free all sets */ int -icl_ChangeAllSetState(op) - afs_int32 op; +icl_ChangeAllSetState(afs_int32 op) { afs_int32 code; @@ -1935,9 +1910,7 @@ icl_ChangeAllSetState(op) /* set size if log */ int -icl_ChangeLogSize(name, logSize) - char *name; - afs_int32 logSize; +icl_ChangeLogSize(char *name, afs_int32 logSize) { afs_int32 code; @@ -1949,10 +1922,7 @@ icl_ChangeLogSize(name, logSize) /* get logsize of specified log */ int -icl_GetLogsize(logname, logSizeP, allocatedP) - char *logname; - afs_int32 *logSizeP; - int *allocatedP; +icl_GetLogsize(char *logname, afs_int32 *logSizeP, int *allocatedP) { afs_int32 code; code = @@ -1963,9 +1933,7 @@ icl_GetLogsize(logname, logSizeP, allocatedP) /* get state of specified set */ int -icl_GetSetState(setname, stateP) - char *setname; - afs_int32 *stateP; +icl_GetSetState(char *setname, afs_int32 *stateP) { afs_int32 code; code = @@ -1974,10 +1942,8 @@ icl_GetSetState(setname, stateP) return code; } -icl_TailKernel(outFilep, logname, waitTime) - FILE *outFilep; - char *logname; - afs_int32 waitTime; +int +icl_TailKernel(FILE *outFilep, char *logname, afs_int32 waitTime) { afs_int32 bufferSize = 0; afs_int32 newBufferSize; @@ -1988,7 +1954,6 @@ icl_TailKernel(outFilep, logname, waitTime) afs_int32 ix; afs_int32 rlength; int allocated; - struct logInfo *lip; /* get information about the specified log */ code = @@ -2121,8 +2086,9 @@ icl_TailKernel(outFilep, logname, waitTime) } #if !defined(AFS_SGI_ENV) -afs_syscall(call, parm0, parm1, parm2, parm3, parm4, parm5, parm6) - long call, parm0, parm1, parm2, parm3, parm4, parm5, parm6; +int +afs_syscall(long call, long parm0, long parm1, long parm2, long parm3, + long parm4, long parm5, long parm6) { int code, rval; #ifdef AFS_LINUX20_ENV @@ -2178,7 +2144,8 @@ afs_syscall(call, parm0, parm1, parm2, parm3, parm4, parm5, parm6) int icl_inited = 0; /* init function, called once, under icl_lock */ -icl_Init() +int +icl_Init(void) { icl_inited = 1; @@ -2189,11 +2156,9 @@ icl_Init() return 0; } -icl_CreateSet(name, baseLogp, fatalLogp, outSetpp) - char *name; - struct afs_icl_log *baseLogp; - struct afs_icl_log *fatalLogp; - struct afs_icl_set **outSetpp; +int +icl_CreateSet(char *name, struct afs_icl_log *baseLogp, + struct afs_icl_log *fatalLogp, struct afs_icl_set **outSetpp) { return icl_CreateSetWithFlags(name, baseLogp, fatalLogp, /*flags */ 0, outSetpp); @@ -2205,12 +2170,10 @@ icl_CreateSet(name, baseLogp, fatalLogp, outSetpp) * addds references from the new icl_set. When the set is destroyed, * those references will be released. */ -icl_CreateSetWithFlags(name, baseLogp, fatalLogp, flags, outSetpp) - char *name; - struct afs_icl_log *baseLogp; - struct afs_icl_log *fatalLogp; - afs_uint32 flags; - struct afs_icl_set **outSetpp; +int +icl_CreateSetWithFlags(char *name, struct afs_icl_log *baseLogp, + struct afs_icl_log *fatalLogp, afs_uint32 flags, + struct afs_icl_set **outSetpp) { register struct afs_icl_set *setp; register int i; @@ -2275,10 +2238,8 @@ icl_CreateSetWithFlags(name, baseLogp, fatalLogp, flags, outSetpp) } /* function to change event enabling information for a particular set */ -icl_SetEnable(setp, eventID, setValue) - struct afs_icl_set *setp; - afs_int32 eventID; - int setValue; +int +icl_SetEnable(struct afs_icl_set *setp, afs_int32 eventID, int setValue) { char *tp; @@ -2297,10 +2258,8 @@ icl_SetEnable(setp, eventID, setValue) * for tracing. If *getValuep is set to 0, the event is disabled, * otherwise it is enabled. All events start out enabled by default. */ -icl_GetEnable(setp, eventID, getValuep) - struct afs_icl_set *setp; - afs_int32 eventID; - int *getValuep; +int +icl_GetEnable(struct afs_icl_set *setp, afs_int32 eventID, int *getValuep) { if (!ICL_EVENTOK(setp, eventID)) { return -1; @@ -2313,16 +2272,16 @@ icl_GetEnable(setp, eventID, getValuep) } /* hold and release event sets */ -icl_SetHold(setp) - register struct afs_icl_set *setp; +int +icl_SetHold(register struct afs_icl_set *setp) { setp->refCount++; return 0; } /* free a set. Called with icl_lock locked */ -icl_ZapSet(setp) - register struct afs_icl_set *setp; +int +icl_ZapSet(register struct afs_icl_set *setp) { register struct afs_icl_set **lpp, *tp; int i; @@ -2335,7 +2294,7 @@ icl_ZapSet(setp) osi_Free(setp->name, 1 + strlen(setp->name)); osi_Free(setp->eventFlags, ICL_EVENTBYTES(setp->nevents)); for (i = 0; i < ICL_LOGSPERSET; i++) { - if (tlp = setp->logs[i]) + if ((tlp = setp->logs[i])) icl_LogReleNL(tlp); } osi_Free(setp, sizeof(struct afs_icl_set)); @@ -2346,8 +2305,8 @@ icl_ZapSet(setp) } /* do the release, watching for deleted entries */ -icl_SetRele(setp) - register struct afs_icl_set *setp; +int +icl_SetRele(register struct afs_icl_set *setp) { if (--setp->refCount == 0 && (setp->states & ICL_SETF_DELETED)) { icl_ZapSet(setp); /* destroys setp's lock! */ @@ -2356,8 +2315,8 @@ icl_SetRele(setp) } /* free a set entry, dropping its reference count */ -icl_SetFree(setp) - register struct afs_icl_set *setp; +int +icl_SetFree(register struct afs_icl_set *setp) { setp->states |= ICL_SETF_DELETED; icl_SetRele(setp); @@ -2366,8 +2325,7 @@ icl_SetFree(setp) /* find a set by name, returning it held */ struct afs_icl_set * -icl_FindSet(name) - char *name; +icl_FindSet(char *name) { register struct afs_icl_set *tp; @@ -2382,8 +2340,8 @@ icl_FindSet(name) } /* zero out all the logs in the set */ -icl_ZeroSet(setp) - struct afs_icl_set *setp; +int +icl_ZeroSet(struct afs_icl_set *setp) { register int i; int code = 0; @@ -2403,9 +2361,9 @@ icl_ZeroSet(setp) return code; } -icl_EnumerateSets(aproc, arock) - int (*aproc) (); - char *arock; +int +icl_EnumerateSets(int (*aproc) (char *, void *, struct afs_icl_set *), + void *arock) { register struct afs_icl_set *tp, *np; register afs_int32 code; @@ -2423,13 +2381,11 @@ icl_EnumerateSets(aproc, arock) return code; } -icl_AddLogToSet(setp, newlogp) - struct afs_icl_set *setp; - struct afs_icl_log *newlogp; +int +icl_AddLogToSet(struct afs_icl_set *setp, struct afs_icl_log *newlogp) { register int i; int code = -1; - struct afs_icl_log *logp; for (i = 0; i < ICL_LOGSPERSET; i++) { if (!setp->logs[i]) { @@ -2446,9 +2402,8 @@ icl_AddLogToSet(setp, newlogp) return code; } -icl_SetSetStat(setp, op) - struct afs_icl_set *setp; - int op; +int +icl_SetSetStat(struct afs_icl_set *setp, int op) { int i; afs_int32 code; @@ -2518,24 +2473,24 @@ icl_SetSetStat(setp, op) struct afs_icl_log *afs_icl_allLogs = 0; /* hold and release logs */ -icl_LogHold(logp) - register struct afs_icl_log *logp; +int +icl_LogHold(register struct afs_icl_log *logp) { logp->refCount++; return 0; } /* hold and release logs, called with lock already held */ -icl_LogHoldNL(logp) - register struct afs_icl_log *logp; +int +icl_LogHoldNL(register struct afs_icl_log *logp) { logp->refCount++; return 0; } /* keep track of how many sets believe the log itself is allocated */ -icl_LogUse(logp) - register struct afs_icl_log *logp; +int +icl_LogUse(register struct afs_icl_log *logp) { if (logp->setCount == 0) { /* this is the first set actually using the log -- allocate it */ @@ -2551,8 +2506,8 @@ icl_LogUse(logp) } /* decrement the number of real users of the log, free if possible */ -icl_LogFreeUse(logp) - register struct afs_icl_log *logp; +int +icl_LogFreeUse(register struct afs_icl_log *logp) { if (--logp->setCount == 0) { /* no more users -- free it (but keep log structure around) */ @@ -2565,9 +2520,8 @@ icl_LogFreeUse(logp) } /* set the size of the log to 'logSize' */ -icl_LogSetSize(logp, logSize) - register struct afs_icl_log *logp; - afs_int32 logSize; +int +icl_LogSetSize(register struct afs_icl_log *logp, afs_int32 logSize) { if (!logp->datap) { /* nothing to worry about since it's not allocated */ @@ -2587,8 +2541,8 @@ icl_LogSetSize(logp, logSize) } /* free a log. Called with icl_lock locked. */ -icl_ZapLog(logp) - register struct afs_icl_log *logp; +int +icl_ZapLog(register struct afs_icl_log *logp) { register struct afs_icl_log **lpp, *tp; @@ -2606,8 +2560,8 @@ icl_ZapLog(logp) } /* do the release, watching for deleted entries */ -icl_LogRele(logp) - register struct afs_icl_log *logp; +int +icl_LogRele(register struct afs_icl_log *logp) { if (--logp->refCount == 0 && (logp->states & ICL_LOGF_DELETED)) { icl_ZapLog(logp); /* destroys logp's lock! */ @@ -2616,8 +2570,8 @@ icl_LogRele(logp) } /* do the release, watching for deleted entries, log already held */ -icl_LogReleNL(logp) - register struct afs_icl_log *logp; +int +icl_LogReleNL(register struct afs_icl_log *logp) { if (--logp->refCount == 0 && (logp->states & ICL_LOGF_DELETED)) { icl_ZapLog(logp); /* destroys logp's lock! */ @@ -2635,8 +2589,8 @@ icl_ZeroLog(register struct afs_icl_log *logp) } /* free a log entry, and drop its reference count */ -icl_LogFree(logp) - register struct afs_icl_log *logp; +int +icl_LogFree(register struct afs_icl_log *logp) { logp->states |= ICL_LOGF_DELETED; icl_LogRele(logp); @@ -2646,8 +2600,8 @@ icl_LogFree(logp) int icl_EnumerateLogs(int (*aproc) - (char *name, char *arock, struct afs_icl_log * tp), - char *arock) + (char *name, void *arock, struct afs_icl_log * tp), + void *arock) { register struct afs_icl_log *tp; register afs_int32 code; @@ -2666,7 +2620,7 @@ icl_EnumerateLogs(int (*aproc) afs_icl_bulkSetinfo_t * -GetBulkSetInfo() +GetBulkSetInfo(void) { unsigned int infoSize; @@ -2687,7 +2641,7 @@ GetBulkSetInfo() } afs_icl_bulkLoginfo_t * -GetBulkLogInfo() +GetBulkLogInfo(void) { unsigned int infoSize; @@ -2714,9 +2668,7 @@ DoDump(struct cmd_syndesc *as, void *arock) afs_int32 code = 0; afs_int32 tcode; afs_int32 waitTime = 10 /* seconds */ ; - int error = 0; char *logname; - char *filename; FILE *outfp = stdout; time_t startTime; struct cmd_item *itemp; @@ -2780,7 +2732,7 @@ DoDump(struct cmd_syndesc *as, void *arock) } static void -SetUpDump() +SetUpDump(void) { struct cmd_syndesc *dumpSyntax; @@ -2854,7 +2806,7 @@ DoShowLog(register struct cmd_syndesc *as, void *arock) } static void -SetUpShowLog() +SetUpShowLog(void) { struct cmd_syndesc *showSyntax; @@ -2910,7 +2862,7 @@ DoShowSet(register struct cmd_syndesc *as, void *arock) } static void -SetUpShowSet() +SetUpShowSet(void) { struct cmd_syndesc *showSyntax; @@ -2967,7 +2919,7 @@ DoClear(register struct cmd_syndesc *as, void *arock) } static void -SetUpClear() +SetUpClear(void) { struct cmd_syndesc *clearSyntax; @@ -3054,7 +3006,7 @@ DoSet(register struct cmd_syndesc *as, void *arock) } static void -SetUpSet() +SetUpSet(void) { struct cmd_syndesc *setSyntax; @@ -3086,7 +3038,7 @@ DoResize(register struct cmd_syndesc *as, void *arock) bufferSize = ICL_DEFAULT_LOGSIZE; /* set the size of the specified logs */ - if (itemp = as->parms[0].items) { + if ((itemp = as->parms[0].items)) { for (; itemp; itemp = itemp->next) { code = icl_ChangeLogSize(itemp->data, bufferSize); if (code) { @@ -3111,7 +3063,7 @@ DoResize(register struct cmd_syndesc *as, void *arock) } static void -SetUpResize() +SetUpResize(void) { struct cmd_syndesc *setsizeSyntax; @@ -3126,9 +3078,8 @@ SetUpResize() #include "AFS_component_version_number.c" -main(argc, argv) - IN int argc; - IN char *argv[]; +int +main(int argc, char *argv[]) { setlocale(LC_ALL, ""); #ifdef AFS_SGI62_ENV @@ -3148,7 +3099,8 @@ main(argc, argv) #else #include "AFS_component_version_number.c" -main() +int +main(int argc, char *argv[]) { printf("fstrace is NOT supported for this OS\n"); } diff --git a/src/venus/kdump.c b/src/venus/kdump.c index 42977829f..03cc9587d 100644 --- a/src/venus/kdump.c +++ b/src/venus/kdump.c @@ -17,6 +17,9 @@ RCSID #include #include /* for malloc() */ +#include + +#if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) /* Here be hacks. */ #ifdef AFS_LINUX24_ENV #define __KERNEL__ @@ -823,6 +826,7 @@ symsrch(s) #endif /*defined(AFS_SUN5_ENV) */ +#endif /*!defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) */ #ifndef AFS_KDUMP_LIB static int @@ -830,6 +834,7 @@ cmdproc(register struct cmd_syndesc *as, void *arock) { register afs_int32 code = 0; +#if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) if (as->parms[0].items) { /* -kobj */ obj = as->parms[0].items->data; } @@ -929,6 +934,7 @@ cmdproc(register struct cmd_syndesc *as, void *arock) if (as->parms[31].items) { /* -dhash */ DdvnextTbl = 1, DdcnextTbl = 1, Dall = 0; } +#endif code = kdump(); return code; @@ -936,9 +942,8 @@ cmdproc(register struct cmd_syndesc *as, void *arock) #include "AFS_component_version_number.c" -main(argc, argv) - int argc; - char **argv; +int +main(int argc, char **argv) { register struct cmd_syndesc *ts; register afs_int32 code; @@ -1015,9 +1020,8 @@ main(argc, argv) #ifdef AFS_AIX_ENV #ifndef AFS_KDUMP_LIB -Knlist(sp, cnt, size) - struct afs_nlist *sp; - int cnt, size; +int +Knlist(struct afs_nlist *sp, int cnt, int size) { register int code; @@ -1097,12 +1101,13 @@ findsym(char *sname, off_t * offset) #define CBHTSIZE 128 -kdump() +int +kdump(void) { - int cell, cnt, cnt1; #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) printf("Kdump not supported\n"); #else + int cell, cnt, cnt1; #ifndef AFS_KDUMP_LIB kmem = opencore(core); @@ -1247,8 +1252,7 @@ int Sum_vcachemvids = 0, Sum_vcachelinkData = 0, Sum_vcacheacc = int Sum_cellaliases = 0, Sum_cellname_names = 0; int -print_cells(pnt) - int pnt; +print_cells(int pnt) { off_t symoff; struct cell *cells, cle, *clentry = &cle, *clep; @@ -1339,8 +1343,7 @@ print_cellnames(int pnt) } int -print_users(pnt) - int pnt; +print_users(int pnt) { off_t symoff; struct unixuser *afs_users[NUSERS], ue, *uentry = &ue, *uep; @@ -1366,8 +1369,7 @@ afs_int32 NserversFound = 0; #define SF_ALLOCATION_STEP 500 int -add_found_server(sep) - struct server *sep; +add_found_server(struct server *sep) { static afs_int32 NserversAllocated = 0; static afs_int32 failed = 0; @@ -1400,8 +1402,7 @@ add_found_server(sep) } int -find_server(sep) - struct server *sep; +find_server(struct server *sep) { int i; @@ -1413,8 +1414,7 @@ find_server(sep) } int -print_servers(pnt) - int pnt; +print_servers(int pnt) { off_t symoff; struct server *afs_servers[NSERVERS], se, *sentry = &se, *sep; @@ -1538,8 +1538,7 @@ print_servers(pnt) void -print_Conns(pnt) - int pnt; +print_Conns(int pnt) { off_t symoff; struct server *afs_servers[NSERVERS], se, *sentry = &se, *sep; @@ -1561,8 +1560,7 @@ print_Conns(pnt) int -print_volumes(pnt) - int pnt; +print_volumes(int pnt) { off_t symoff; struct volume *afs_volumes[NVOLS], ve, *ventry = &ve, *vep; @@ -1584,8 +1582,7 @@ print_volumes(pnt) } void -print_cbHash(pnt) - int pnt; +print_cbHash(int pnt) { off_t symoff; struct afs_q cbHashT[CBHTSIZE]; @@ -1605,8 +1602,7 @@ print_cbHash(pnt) } int -print_vcaches(pnt) - int pnt; +print_vcaches(int pnt) { off_t symoff; struct vcache *afs_vhashTable[VCSIZE], Ve, *Ventry = &Ve, *Vep; @@ -1636,8 +1632,7 @@ print_vcaches(pnt) } int -print_dcaches(pnt) - int pnt; +print_dcaches(int pnt) { off_t symoff; long table, *ptr; @@ -1676,8 +1671,7 @@ print_dcaches(pnt) void -print_DindexTimes(pnt) - int pnt; +print_DindexTimes(int pnt) { off_t symoff; long table; @@ -1713,8 +1707,7 @@ print_DindexTimes(pnt) void -print_DdvnextTbl(pnt) - int pnt; +print_DdvnextTbl(int pnt) { off_t symoff; long table; @@ -1743,8 +1736,7 @@ print_DdvnextTbl(pnt) void -print_DdcnextTbl(pnt) - int pnt; +print_DdcnextTbl(int pnt) { off_t symoff; long table; @@ -1773,8 +1765,7 @@ print_DdcnextTbl(pnt) void -print_DindexFlags(pnt) - int pnt; +print_DindexFlags(int pnt) { off_t symoff; afs_int32 count; @@ -1804,8 +1795,7 @@ print_DindexFlags(pnt) void -print_buffers(pnt) - int pnt; +print_buffers(int pnt) { off_t symoff; long table; @@ -1845,8 +1835,7 @@ print_buffers(pnt) int -print_nfss(pnt) - int pnt; +print_nfss(int pnt) { off_t symoff; struct afs_exporter *exp_entry, ex, *exp = &ex, *exp1; @@ -1952,8 +1941,7 @@ print_alloced_memlist(void) #endif void -print_allocs(pnt) - int pnt; +print_allocs(int pnt) { off_t symoff; long count, i, j, k, l, m, n, T = 0, tvs; @@ -2389,7 +2377,8 @@ kread(int kmem, off_t loc, void *buf, KDUMP_SIZE_T len) * the macro RDSYMBOLS */ -rdsymbols() +void +rdsymbols(void) { FILE *fp; @@ -2452,8 +2441,7 @@ rdsymbols() int -opencore(core) - char *core; +opencore(char *core) { #ifdef AFS_KDUMP_LIB return 0; @@ -2489,9 +2477,8 @@ opencore(core) void -print_exporter(kmem, exporter, ptr, pnt) - int kmem, pnt; - struct afs_exporter *exporter, *ptr; +print_exporter(int kmem, struct afs_exporter *exporter, + struct afs_exporter *ptr, int pnt) { if (pnt) { printf("\tstates=%x, type=%x, *data=%lx\n", exporter->exp_states, @@ -2505,9 +2492,8 @@ print_exporter(kmem, exporter, ptr, pnt) void -print_nfsclient(kmem, ep, ptr, pnt) - int kmem, pnt; - struct nfsclientpag *ep, *ptr; +print_nfsclient(int kmem, struct nfsclientpag *ep, + struct nfsclientpag *ptr, int pnt) { char sysname[100]; int count; @@ -2527,9 +2513,8 @@ print_nfsclient(kmem, ep, ptr, pnt) #if defined(AFS_SUN5_ENV) -pmutex(sp, mp) - char *sp; - kmutex_t *mp; +void +pmutex(char *sp, kmutex_t *mp) { #ifdef AFS_SUN54_ENV @@ -2543,9 +2528,8 @@ pmutex(sp, mp) #endif void -print_unixuser(kmem, uep, ptr, pnt) - int kmem, pnt; - struct unixuser *uep, *ptr; +print_unixuser(int kmem, struct unixuser *uep, + struct unixuser *ptr, int pnt) { Sum_userstp += uep->stLen; if (pnt) { @@ -2565,9 +2549,7 @@ print_unixuser(kmem, uep, ptr, pnt) } void -print_cell(kmem, clep, ptr, pnt) - int kmem, pnt; - struct cell *clep, *ptr; +print_cell(int kmem, struct cell *clep, struct cell *ptr, int pnt) { int i; char cellName[100]; @@ -2598,9 +2580,8 @@ print_cell(kmem, clep, ptr, pnt) void -print_server(kmem, sep, ptr, conns, pnt) - int kmem, conns, pnt; - struct server *sep, *ptr; +print_server(int kmem, struct server *sep, struct server *ptr, int conns, + int pnt) { struct srvAddr sa, *sap = &sa, *sap1; int j, mh = 0, cnt; @@ -2666,10 +2647,8 @@ print_server(kmem, sep, ptr, conns, pnt) void -print_conns(kmem, srv, conns, Con, pnt) - int kmem, Con, pnt; - struct srvAddr *srv; - struct afs_conn *conns; +print_conns(int kmem, struct srvAddr *srv, struct afs_conn *conns, int Con, + int pnt) { struct afs_conn *cep, ce, *centry = &ce; int i = 1; @@ -2691,9 +2670,7 @@ print_conns(kmem, srv, conns, Con, pnt) void -print_conn(kmem, conns, ptr, pnt) - int kmem, pnt; - struct afs_conn *conns, *ptr; +print_conn(int kmem, struct afs_conn *conns, struct afs_conn *ptr, int pnt) { if (!pnt) return; @@ -2705,9 +2682,7 @@ print_conn(kmem, conns, ptr, pnt) void -print_volume(kmem, vep, ptr, pnt) - int kmem, pnt; - struct volume *vep, *ptr; +print_volume(int kmem, struct volume *vep, struct volume *ptr, int pnt) { int i; afs_int32 *loc; @@ -2762,9 +2737,7 @@ print_volume(kmem, vep, ptr, pnt) void -print_venusfid(string, vid) - char *string; - struct VenusFid *vid; +print_venusfid(char *string, struct VenusFid *vid) { printf("%s(c=%x, v=%d, n=%d, u=%d)", string, vid->Cell, vid->Fid.Volume, vid->Fid.Vnode, vid->Fid.Unique); @@ -2772,9 +2745,7 @@ print_venusfid(string, vid) void -print_vnode(kmem, vep, ptr, pnt) - int kmem, pnt; - struct vnode *vep, *ptr; +print_vnode(int kmem, struct vnode *vep, struct vnode *ptr, int pnt) { #ifdef AFS_AIX_ENV struct gnode gnode; @@ -2860,9 +2831,7 @@ print_vnode(kmem, vep, ptr, pnt) } void -print_vcache(kmem, vep, ptr, pnt) - int kmem, pnt; - struct vcache *vep, *ptr; +print_vcache(int kmem, struct vcache *vep, struct vcache *ptr, int pnt) { long *loc, j = 0; char *cloc; @@ -2999,9 +2968,7 @@ print_vcache(kmem, vep, ptr, pnt) void -print_dcache(kmem, dcp, dp, pnt) - int kmem, pnt; - struct dcache *dcp, *dp; +print_dcache(int kmem, struct dcache *dcp, struct dcache *dp, int pnt) { if (!pnt) return; @@ -3031,8 +2998,7 @@ print_dcache(kmem, dcp, dp, pnt) } void -print_bkg(kmem) - int kmem; +print_bkg(int kmem) { off_t symoff; struct brequest afs_brs[NBRS], ue, *uentry = &ue, *uep; @@ -3065,8 +3031,7 @@ print_bkg(kmem) } void -print_vlru(kmem) - int kmem; +print_vlru(int kmem) { off_t symoff; struct vcache Ve, *Ventry = &Ve, *Vep, *tvc; @@ -3104,8 +3069,7 @@ print_vlru(kmem) } void -print_dlru(kmem) - int kmem; +print_dlru(int kmem) { off_t symoff; struct dcache Ve, *Ventry = &Ve, *Vep, *tdc; @@ -3143,8 +3107,7 @@ print_dlru(kmem) } int -print_gcpags(pnt) - int pnt; +print_gcpags(int pnt) { off_t symoff; afs_int32 afs_gcpags; @@ -3188,8 +3151,7 @@ struct callo { #endif void -print_callout(kmem) - int kmem; +print_callout(int kmem) { off_t symoff; #ifndef AFS_AIX_ENV @@ -3219,8 +3181,7 @@ print_callout(kmem) } void -print_dnlc(kmem) - int kmem; +print_dnlc(int kmem) { struct nc *nameHash[256]; @@ -3228,8 +3189,7 @@ print_dnlc(kmem) void -print_global_locks(kmem) - int kmem; +print_global_locks(int kmem) { off_t symoff; afs_int32 count; @@ -3267,8 +3227,7 @@ print_global_locks(kmem) void -print_global_afs_resource(kmem) - int kmem; +print_global_afs_resource(int kmem) { off_t symoff; char sysname[100]; @@ -3305,8 +3264,7 @@ print_global_afs_resource(kmem) void -print_global_afs_cache(kmem) - int kmem; +print_global_afs_cache(int kmem) { off_t symoff; char sysname[100]; @@ -3402,8 +3360,7 @@ print_global_afs_cache(kmem) void -print_rxstats(kmem) - int kmem; +print_rxstats(int kmem) { off_t symoff; char sysname[100]; @@ -3466,8 +3423,7 @@ print_rxstats(kmem) void -print_rx(kmem) - int kmem; +print_rx(int kmem) { off_t symoff; char sysname[100], c; @@ -3592,8 +3548,7 @@ print_rx(kmem) void -print_services(kmem) - afs_int32 kmem; +print_services(afs_int32 kmem) { off_t symoff; struct rx_service *rx_services[RX_MAX_SERVICES], se, *sentry = &se, *sep; @@ -3628,8 +3583,7 @@ print_services(kmem) #ifdef KDUMP_RX_LOCK void -print_peertable_lock(kmem) - afs_int32 kmem; +print_peertable_lock(afs_int32 kmem) { off_t symoff; struct rx_peer_rx_lock *rx_peerTable[256], se, *sentry = &se, *sep; @@ -3668,8 +3622,7 @@ print_peertable_lock(kmem) #endif /* KDUMP_RX_LOCK */ void -print_peertable(kmem) - afs_int32 kmem; +print_peertable(afs_int32 kmem) { off_t symoff; struct rx_peer *rx_peerTable[256], se, *sentry = &se, *sep; @@ -3707,8 +3660,7 @@ print_peertable(kmem) #ifdef KDUMP_RX_LOCK void -print_conntable_lock(kmem) - afs_int32 kmem; +print_conntable_lock(afs_int32 kmem) { off_t symoff; struct rx_connection_rx_lock *rx_connTable[256], se, *sentry = &se; @@ -3763,8 +3715,7 @@ print_conntable_lock(kmem) #endif /* KDUMP_RX_LOCK */ void -print_conntable(kmem) - afs_int32 kmem; +print_conntable(afs_int32 kmem) { off_t symoff; struct rx_connection *rx_connTable[256], se, *sentry = &se, *sep; @@ -3817,8 +3768,7 @@ print_conntable(kmem) #ifdef KDUMP_RX_LOCK void -print_calltable_lock(kmem) - afs_int32 kmem; +print_calltable_lock(afs_int32 kmem) { off_t symoff; struct rx_connection_rx_lock *rx_connTable[256], se; @@ -3900,8 +3850,7 @@ print_calltable_lock(kmem) #endif /* KDUMP_RX_LOCK */ void -print_calltable(kmem) - afs_int32 kmem; +print_calltable(afs_int32 kmem) { off_t symoff; struct rx_connection *rx_connTable[256], se, *sentry = &se, *sep; @@ -3977,8 +3926,7 @@ print_calltable(kmem) } void -print_eventtable(kmem) - afs_int32 kmem; +print_eventtable(afs_int32 kmem) { off_t symoff; struct rx_queue epq; @@ -4004,9 +3952,7 @@ print_eventtable(kmem) * provided. */ void -print_upDownStats(a_upDownP) - struct afs_stats_SrvUpDownInfo *a_upDownP; /*Ptr to server up/down info */ - +print_upDownStats(struct afs_stats_SrvUpDownInfo *a_upDownP) { /*print_upDownStats */ /* @@ -4050,8 +3996,7 @@ print_upDownStats(a_upDownP) void -print_cmperfstats(perfP) - struct afs_stats_CMPerf *perfP; +print_cmperfstats(struct afs_stats_CMPerf *perfP) { struct afs_stats_SrvUpDownInfo *upDownP; /*Ptr to server up/down info */ @@ -4119,8 +4064,7 @@ print_cmperfstats(perfP) void -print_cmstats(cmp) - struct afs_CMStats *cmp; +print_cmstats(struct afs_CMStats *cmp) { printf("\t%10d afs_init\n", cmp->callInfo.C_afs_init); printf("\t%10d gop_rdwr\n", cmp->callInfo.C_gop_rdwr); diff --git a/src/venus/livesys.c b/src/venus/livesys.c index cde3204bc..8e960133a 100644 --- a/src/venus/livesys.c +++ b/src/venus/livesys.c @@ -28,6 +28,7 @@ RCSID #include #include #include +#include #ifdef AFS_AIX32_ENV #include #endif @@ -36,9 +37,7 @@ RCSID static char space[MAXSIZE]; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { afs_int32 code; struct ViceIoctl blob; diff --git a/src/venus/up.c b/src/venus/up.c index a5b4c3fca..04a14d1be 100644 --- a/src/venus/up.c +++ b/src/venus/up.c @@ -44,8 +44,10 @@ RCSID #endif #include +#include #include +#include /* ************************************************************* */ @@ -273,7 +275,7 @@ Copy(char *file1, char *file2, short recursive, int level) if (verbose) { printf(" Copy file %s to %s (%u Bytes)\n", file1, file2, - s1.st_size); + (unsigned int) s1.st_size); fflush(stdout); } @@ -356,7 +358,8 @@ Copy(char *file1, char *file2, short recursive, int level) if (s1.st_size != s2.st_size) { fprintf(stderr, "WARNING: New file %s is %u bytes long; should be %u\n", - file2, s2.st_size, s1.st_size); + file2, (unsigned int) s2.st_size, + (unsigned int) s1.st_size); } } -- 2.39.5