#include <afs/afsutil.h>
#include <afs/com_err.h>
-extern struct hostent *hostutil_GetHostByName();
-
static int print_ctime = 0;
static int
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;
}
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 */
register afs_int32 code;
struct AFSDBCacheEntry64 centry;
char *cellname;
- int ce64 = 0;
for (i = 0; i < 1000000; i++) {
code = RXAFSCB_GetCE64(aconn, i, ¢ry);
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 */
static int
PrintCellServDBEntry(struct rx_connection *aconn, afs_int32 cellnum)
{
- static struct cell_cache *cache;
int code;
char *cellname;
serverList sl;
#include <stdlib.h>
#include <assert.h>
#include <afs/ptclient.h>
-
-
+#include <afs/ptuser.h>
+#include <afs/afsutil.h>
+#include <afs/sys_prototypes.h>
+
#define MAXHOSTS 13
#define OMAXHOSTS 8
#define MAXCELLHOSTS 8
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
};
static void
-ZapAcl(acl)
- struct Acl *acl;
+ZapAcl(struct Acl *acl)
{
if (!acl)
return;
free(acl);
}
-static
-foldcmp(a, b)
- char *a;
- char *b;
+static int
+foldcmp(char *a, char *b)
{
char t, u;
while (1) {
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;
* 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;
/* 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;
/* 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)) {
afs_int32 j;
afs_int32 temp;
char *tp;
- char tbuffer[128];
- afs_int32 interval;
struct afsconf_cell info;
struct chservinfo checkserv;
{
afs_int32 code = 0;
struct ViceIoctl blob;
- afs_int32 j;
- afs_int32 temp;
struct gaginfo gagflags;
struct cmd_item *show;
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"))
}
static int
-PreCacheCmd(struct cmd_syndesc *as, char *arock)
+PreCacheCmd(struct cmd_syndesc *as, void *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
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;
}
{
afs_int32 code;
afs_int32 i, j;
- char *tcp, *tp;
- afs_int32 clear;
+ char *tp;
struct ViceIoctl blob;
int resolve;
struct cmd_item *ti;
afs_int32 hostAddr;
struct hostent *thp;
- char *tp;
int setp;
ti = as->parms[0].items;
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
}
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)
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)
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)
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)
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)
struct setspref *ssp;
struct spref *sp;
struct hostent *thostent;
- afs_uint32 addr;
int error = 0;
#ifndef MAXUSHORT
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;
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;
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;
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;
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;
{
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;
afs_int32 code;
afs_int32 flags = 0;
struct ViceIoctl blob;
- struct cmd_item *ti;
if (as->parms[0].items) { /* -enable */
flags |= AFSCALL_RXSTATS_ENABLE;
afs_int32 code;
afs_int32 flags = 0;
struct ViceIoctl blob;
- struct cmd_item *ti;
if (as->parms[0].items) { /* -enable */
flags |= AFSCALL_RXSTATS_ENABLE;
#include <stdio.h>
#include <sys/types.h>
+#include <unistd.h>
#if !defined(AFS_SUN3_ENV) && !defined(sys_vax_ul43)
#include <time.h>
/*#ifdef AFS_AIX_ENV*/
#include <afs/afs_args.h>
#include <afs/icl.h>
#include <afs/afsutil.h>
+#include <rx/rx.h>
+#include <afs/vice.h>
+#include <afs/sys_prototypes.h>
#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. */
#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
char dumpFileName[256] = "";
void
-RegisterIclDumpFileName(name)
- char *name;
+RegisterIclDumpFileName(char *name)
{
(void)sprintf(dumpFileName, "icl.%.250s", 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;
*/
#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;
/* 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;
#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))
int pftix; /* index in printfTypes */
int status;
int printed; /* did we print the string yet? */
- afs_int32 *tlp;
time_t tmv;
/* decode parameters */
(((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;
#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 ----*/
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 ----*/
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]) {
static int
-make_sets(catd)
- nl_catd catd;
+make_sets(nl_catd catd)
{
struct _catset *cset;
char *base = catd->_mem;
*/
static FILE *
-open1catfile(file)
- char *file;
+open1catfile(char *file)
{
extern char *getenv();
char fl[PATH_MAX]; /*---- place to hold full path ----*/
*/
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 ----*/
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;
}
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 ----*/
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 ----*/
#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;
}
-
-icl_DumpKernel(outFilep, setname)
- FILE *outFilep;
- char *setname;
+int
+icl_DumpKernel(FILE *outFilep, char *setname)
{
afs_int32 bufferSize = 0;
afs_int32 *bufferp;
}
/* clear out log 'name' */
-icl_ClearLog(name)
- char *name;
+int
+icl_ClearLog(char *name)
{
afs_int32 code;
}
/* clear out set 'name' */
-icl_ClearSet(name)
- char *name;
+int
+icl_ClearSet(char *name)
{
afs_int32 code;
}
/* clear out all logs */
-icl_ClearAll()
+int
+icl_ClearAll(void)
{
afs_int32 code;
/* list out all available sets to outFileP */
int
-icl_ListSets(outFileP)
- FILE *outFileP;
+icl_ListSets(FILE *outFileP)
{
int i;
afs_int32 code = 0;
/* 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;
/* 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;
/* 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;
/* activate/deactivate/free all sets */
int
-icl_ChangeAllSetState(op)
- afs_int32 op;
+icl_ChangeAllSetState(afs_int32 op)
{
afs_int32 code;
/* set size if log */
int
-icl_ChangeLogSize(name, logSize)
- char *name;
- afs_int32 logSize;
+icl_ChangeLogSize(char *name, afs_int32 logSize)
{
afs_int32 code;
/* 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 =
/* 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 =
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;
afs_int32 ix;
afs_int32 rlength;
int allocated;
- struct logInfo *lip;
/* get information about the specified log */
code =
}
#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
int icl_inited = 0;
/* init function, called once, under icl_lock */
-icl_Init()
+int
+icl_Init(void)
{
icl_inited = 1;
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);
* 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;
}
/* 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;
* 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;
}
/* 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;
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));
}
/* 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! */
}
/* 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);
/* 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;
}
/* 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;
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;
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]) {
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;
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 */
}
/* 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) */
}
/* 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 */
}
/* 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;
}
/* 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! */
}
/* 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! */
}
/* 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);
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;
afs_icl_bulkSetinfo_t *
-GetBulkSetInfo()
+GetBulkSetInfo(void)
{
unsigned int infoSize;
}
afs_icl_bulkLoginfo_t *
-GetBulkLogInfo()
+GetBulkLogInfo(void)
{
unsigned int infoSize;
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;
}
static void
-SetUpDump()
+SetUpDump(void)
{
struct cmd_syndesc *dumpSyntax;
}
static void
-SetUpShowLog()
+SetUpShowLog(void)
{
struct cmd_syndesc *showSyntax;
}
static void
-SetUpShowSet()
+SetUpShowSet(void)
{
struct cmd_syndesc *showSyntax;
}
static void
-SetUpClear()
+SetUpClear(void)
{
struct cmd_syndesc *clearSyntax;
}
static void
-SetUpSet()
+SetUpSet(void)
{
struct cmd_syndesc *setSyntax;
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) {
}
static void
-SetUpResize()
+SetUpResize(void)
{
struct cmd_syndesc *setsizeSyntax;
#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
#else
#include "AFS_component_version_number.c"
-main()
+int
+main(int argc, char *argv[])
{
printf("fstrace is NOT supported for this OS\n");
}
#include <errno.h>
#include <stdlib.h> /* for malloc() */
+#include <afs/cmd.h>
+
+#if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
/* Here be hacks. */
#ifdef AFS_LINUX24_ENV
#define __KERNEL__
#endif /*defined(AFS_SUN5_ENV) */
+#endif /*!defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) */
#ifndef AFS_KDUMP_LIB
static int
{
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;
}
if (as->parms[31].items) { /* -dhash */
DdvnextTbl = 1, DdcnextTbl = 1, Dall = 0;
}
+#endif
code = kdump();
return code;
#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;
#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;
#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);
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;
}
int
-print_users(pnt)
- int pnt;
+print_users(int pnt)
{
off_t symoff;
struct unixuser *afs_users[NUSERS], ue, *uentry = &ue, *uep;
#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;
}
int
-find_server(sep)
- struct server *sep;
+find_server(struct server *sep)
{
int i;
}
int
-print_servers(pnt)
- int pnt;
+print_servers(int pnt)
{
off_t symoff;
struct server *afs_servers[NSERVERS], se, *sentry = &se, *sep;
void
-print_Conns(pnt)
- int pnt;
+print_Conns(int pnt)
{
off_t symoff;
struct server *afs_servers[NSERVERS], se, *sentry = &se, *sep;
int
-print_volumes(pnt)
- int pnt;
+print_volumes(int pnt)
{
off_t symoff;
struct volume *afs_volumes[NVOLS], ve, *ventry = &ve, *vep;
}
void
-print_cbHash(pnt)
- int pnt;
+print_cbHash(int pnt)
{
off_t symoff;
struct afs_q cbHashT[CBHTSIZE];
}
int
-print_vcaches(pnt)
- int pnt;
+print_vcaches(int pnt)
{
off_t symoff;
struct vcache *afs_vhashTable[VCSIZE], Ve, *Ventry = &Ve, *Vep;
}
int
-print_dcaches(pnt)
- int pnt;
+print_dcaches(int pnt)
{
off_t symoff;
long table, *ptr;
void
-print_DindexTimes(pnt)
- int pnt;
+print_DindexTimes(int pnt)
{
off_t symoff;
long table;
void
-print_DdvnextTbl(pnt)
- int pnt;
+print_DdvnextTbl(int pnt)
{
off_t symoff;
long table;
void
-print_DdcnextTbl(pnt)
- int pnt;
+print_DdcnextTbl(int pnt)
{
off_t symoff;
long table;
void
-print_DindexFlags(pnt)
- int pnt;
+print_DindexFlags(int pnt)
{
off_t symoff;
afs_int32 count;
void
-print_buffers(pnt)
- int pnt;
+print_buffers(int pnt)
{
off_t symoff;
long table;
int
-print_nfss(pnt)
- int pnt;
+print_nfss(int pnt)
{
off_t symoff;
struct afs_exporter *exp_entry, ex, *exp = &ex, *exp1;
#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;
* the macro RDSYMBOLS
*/
-rdsymbols()
+void
+rdsymbols(void)
{
FILE *fp;
int
-opencore(core)
- char *core;
+opencore(char *core)
{
#ifdef AFS_KDUMP_LIB
return 0;
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,
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;
#if defined(AFS_SUN5_ENV)
-pmutex(sp, mp)
- char *sp;
- kmutex_t *mp;
+void
+pmutex(char *sp, kmutex_t *mp)
{
#ifdef AFS_SUN54_ENV
#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) {
}
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];
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;
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;
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;
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;
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);
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;
}
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;
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;
}
void
-print_bkg(kmem)
- int kmem;
+print_bkg(int kmem)
{
off_t symoff;
struct brequest afs_brs[NBRS], ue, *uentry = &ue, *uep;
}
void
-print_vlru(kmem)
- int kmem;
+print_vlru(int kmem)
{
off_t symoff;
struct vcache Ve, *Ventry = &Ve, *Vep, *tvc;
}
void
-print_dlru(kmem)
- int kmem;
+print_dlru(int kmem)
{
off_t symoff;
struct dcache Ve, *Ventry = &Ve, *Vep, *tdc;
}
int
-print_gcpags(pnt)
- int pnt;
+print_gcpags(int pnt)
{
off_t symoff;
afs_int32 afs_gcpags;
#endif
void
-print_callout(kmem)
- int kmem;
+print_callout(int kmem)
{
off_t symoff;
#ifndef AFS_AIX_ENV
}
void
-print_dnlc(kmem)
- int kmem;
+print_dnlc(int kmem)
{
struct nc *nameHash[256];
void
-print_global_locks(kmem)
- int kmem;
+print_global_locks(int kmem)
{
off_t symoff;
afs_int32 count;
void
-print_global_afs_resource(kmem)
- int kmem;
+print_global_afs_resource(int kmem)
{
off_t symoff;
char sysname[100];
void
-print_global_afs_cache(kmem)
- int kmem;
+print_global_afs_cache(int kmem)
{
off_t symoff;
char sysname[100];
void
-print_rxstats(kmem)
- int kmem;
+print_rxstats(int kmem)
{
off_t symoff;
char sysname[100];
void
-print_rx(kmem)
- int kmem;
+print_rx(int kmem)
{
off_t symoff;
char sysname[100], c;
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;
#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;
#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;
#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;
#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;
#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;
#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;
}
void
-print_eventtable(kmem)
- afs_int32 kmem;
+print_eventtable(afs_int32 kmem)
{
off_t symoff;
struct rx_queue epq;
* 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 */
/*
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 */
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);
#include <afs/vice.h>
#include <afs/venus.h>
#include <afs/com_err.h>
+#include <afs/sys_prototypes.h>
#ifdef AFS_AIX32_ENV
#include <signal.h>
#endif
static char space[MAXSIZE];
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
afs_int32 code;
struct ViceIoctl blob;
#endif
#include <string.h>
+#include <stdlib.h>
#include <afs/venus.h>
+#include <afs/sys_prototypes.h>
/* ************************************************************* */
if (verbose) {
printf(" Copy file %s to %s (%u Bytes)\n", file1, file2,
- s1.st_size);
+ (unsigned int) s1.st_size);
fflush(stdout);
}
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);
}
}