*/
#include <afsconfig.h>
-#include "../afs/param.h"
+#include "afs/param.h"
RCSID("$Header$");
-#include "../afs/sysincludes.h" /* Standard vendor system headers */
-#include "../afs/afsincludes.h" /* Afs-based standard headers */
-#include "../afs/afs_stats.h"
-#include "../rx/rx_globals.h"
+#include "afs/sysincludes.h" /* Standard vendor system headers */
+#include "afsincludes.h" /* Afs-based standard headers */
+#include "afs/afs_stats.h"
+#include "rx/rx_globals.h"
#if !defined(UKERNEL) && !defined(AFS_LINUX20_ENV)
#include "net/if.h"
#ifdef AFS_SGI62_ENV
-#include "../h/hashing.h"
+#include "h/hashing.h"
#endif
-#if !defined(AFS_HPUX110_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_DARWIN60_ENV)
#include "netinet/in_var.h"
#endif
#endif /* !defined(UKERNEL) */
#ifdef AFS_LINUX22_ENV
-#include "../h/smp_lock.h"
+#include "h/smp_lock.h"
#endif
struct afs_icl_set *afs_iclSetp = (struct afs_icl_set*)0;
struct afs_icl_set *afs_iclLongTermSetp = (struct afs_icl_set*)0;
-#if defined(AFS_GLOBAL_SUNLOCK) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX41_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
-
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
kmutex_t afs_global_lock;
kmutex_t afs_rxglobal_lock;
+#endif
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI64_ENV)
long afs_global_owner;
#endif
-#endif
#if defined(AFS_OSF_ENV)
simple_lock_data_t afs_global_lock;
-#elif defined(AFS_DARWIN_ENV)
+#endif
+
+#if defined(AFS_DARWIN_ENV)
struct lock__bsd__ afs_global_lock;
-#elif defined(AFS_FBSD_ENV)
+#endif
+
+#if defined(AFS_XBSD_ENV)
struct lock afs_global_lock;
+#ifdef AFS_FBSD50_ENV
+struct thread *afs_global_owner;
+#else
struct proc *afs_global_owner;
#endif
+#endif
+
#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
thread_t afs_global_owner;
#endif /* AFS_OSF_ENV */
static int afs_Go_Done = 0;
extern struct interfaceAddr afs_cb_interface;
static int afs_RX_Running = 0;
+static int afs_InitSetup_done = 0;
+
+afs_int32 afs_rx_deadtime = AFS_RXDEADTIME;
+afs_int32 afs_rx_harddead = AFS_HARDDEADTIME;
static int
Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval);
extern void afs_InitStats();
int code;
+ if (afs_InitSetup_done)
+ return EAGAIN;
+
#ifndef AFS_NOSTATS
/*
* Set up all the AFS statistics variables. This should be done
printf("AFS: RX failed to initialize.\n");
return code;
}
- rx_SetRxDeadTime(AFS_RXDEADTIME);
+ rx_SetRxDeadTime(afs_rx_deadtime);
/* resource init creates the services */
afs_ResourceInit(preallocs);
+ afs_InitSetup_done = 1;
+ afs_osi_Wakeup(&afs_InitSetup_done);
+
return code;
}
+#if defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS)
+struct afsd_thread_info {
+ unsigned long parm;
+ struct completion *complete;
+};
+
+static int afsd_thread(void *rock) {
+ struct afsd_thread_info *arg=rock;
+ unsigned long parm=arg->parm;
+#ifdef SYS_SETPRIORITY_EXPORTED
+ int (*sys_setpriority)(int,int,int) = sys_call_table[__NR_setpriority];
+#endif
+ daemonize(); /* doesn't do much, since we were forked from keventd, but
+ does call mm_release, which wakes up our parent (since it
+ used CLONE_VFORK) */
+ reparent_to_init();
+ afs_osi_MaskSignals();
+ switch (parm) {
+ case AFSOP_START_RXCALLBACK:
+ sprintf(current->comm, "afs_cbstart");
+ AFS_GLOCK();
+ complete(arg->complete);
+ afs_CB_Running = 1;
+ while (afs_RX_Running != 2)
+ afs_osi_Sleep(&afs_RX_Running);
+ sprintf(current->comm, "afs_callback");
+ afs_RXCallBackServer();
+ AFS_GUNLOCK();
+ complete_and_exit(0,0);
+ break;
+ case AFSOP_START_AFS:
+ sprintf(current->comm, "afs_afsstart");
+ AFS_GLOCK();
+ complete(arg->complete);
+ AFS_Running = 1;
+ while (afs_initState < AFSOP_START_AFS)
+ afs_osi_Sleep(&afs_initState);
+ afs_initState = AFSOP_START_BKG;
+ afs_osi_Wakeup(&afs_initState);
+ sprintf(current->comm, "afsd");
+ afs_Daemon();
+ AFS_GUNLOCK();
+ complete_and_exit(0,0);
+ break;
+ case AFSOP_START_BKG:
+ sprintf(current->comm, "afs_bkgstart");
+ AFS_GLOCK();
+ complete(arg->complete);
+ while (afs_initState < AFSOP_START_BKG)
+ afs_osi_Sleep(&afs_initState);
+ if (afs_initState < AFSOP_GO) {
+ afs_initState = AFSOP_GO;
+ afs_osi_Wakeup(&afs_initState);
+ }
+ sprintf(current->comm, "afs_background");
+ afs_BackgroundDaemon();
+ AFS_GUNLOCK();
+ complete_and_exit(0,0);
+ break;
+ case AFSOP_START_TRUNCDAEMON:
+ sprintf(current->comm, "afs_trimstart");
+ AFS_GLOCK();
+ complete(arg->complete);
+ while (afs_initState < AFSOP_GO)
+ afs_osi_Sleep(&afs_initState);
+ sprintf(current->comm, "afs_cachetrim");
+ afs_CacheTruncateDaemon();
+ AFS_GUNLOCK();
+ complete_and_exit(0,0);
+ break;
+ case AFSOP_START_CS:
+ sprintf(current->comm, "afs_checkserver");
+ AFS_GLOCK();
+ complete(arg->complete);
+ afs_CheckServerDaemon();
+ AFS_GUNLOCK();
+ complete_and_exit(0,0);
+ break;
+ case AFSOP_RXEVENT_DAEMON:
+ sprintf(current->comm, "afs_evtstart");
+#ifdef SYS_SETPRIORITY_EXPORTED
+ sys_setpriority(PRIO_PROCESS,0,-10);
+#else
+#ifdef CURRENT_INCLUDES_NICE
+ current->nice=-10;
+#endif
+#endif
+ AFS_GLOCK();
+ complete(arg->complete);
+ while (afs_initState < AFSOP_START_BKG)
+ afs_osi_Sleep(&afs_initState);
+ sprintf(current->comm, "afs_rxevent");
+ afs_rxevent_daemon();
+ AFS_GUNLOCK();
+ complete_and_exit(0,0);
+ break;
+ case AFSOP_RXLISTENER_DAEMON:
+ sprintf(current->comm, "afs_lsnstart");
+#ifdef SYS_SETPRIORITY_EXPORTED
+ sys_setpriority(PRIO_PROCESS,0,-10);
+#else
+#ifdef CURRENT_INCLUDES_NICE
+ current->nice=-10;
+#endif
+#endif
+ AFS_GLOCK();
+ complete(arg->complete);
+ afs_initState = AFSOP_START_AFS;
+ afs_osi_Wakeup(&afs_initState);
+ afs_RX_Running = 2;
+ afs_osi_Wakeup(&afs_RX_Running);
+ afs_osi_RxkRegister();
+ sprintf(current->comm, "afs_rxlistener");
+ rxk_Listener();
+ AFS_GUNLOCK();
+ complete_and_exit(0,0);
+ break;
+ default:
+ printf("Unknown op %d in StartDaemon()\n");
+ break;
+ }
+ return 0;
+}
+
+void afsd_launcher(void *rock) {
+ if (!kernel_thread(afsd_thread,rock, CLONE_VFORK|SIGCHLD))
+ printf("kernel_thread failed. afs startup will not complete\n");
+}
+
+void afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5,
+ long parm6)
+{
+ int code;
+ DECLARE_COMPLETION(c);
+ struct tq_struct tq;
+ struct afsd_thread_info info;
+ if (parm == AFSOP_START_RXCALLBACK) {
+ if (afs_CB_Running) return;
+ } else if (parm == AFSOP_RXLISTENER_DAEMON) {
+ if (afs_RX_Running) return;
+ afs_RX_Running=1;
+ code = afs_InitSetup(parm2);
+ if (parm3) {
+ rx_enablePeerRPCStats();
+ }
+ if (parm4) {
+ rx_enableProcessRPCStats();
+ }
+ if (code)
+ return;
+ } else if (parm == AFSOP_START_AFS) {
+ if (AFS_Running) return;
+ } /* other functions don't need setup in the parent */
+ info.complete=&c;
+ info.parm=parm;
+ tq.sync=0;
+ INIT_LIST_HEAD(&tq.list);
+ tq.routine=afsd_launcher;
+ tq.data=&info;
+ schedule_task(&tq);
+ AFS_GUNLOCK();
+ /* we need to wait cause we passed stack pointers around.... */
+ wait_for_completion(&c);
+ AFS_GLOCK();
+}
+#endif
+
+/* leaving as is, probably will barf if we add prototypes here since it's likely being called
+with partial list */
+int
afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
long parm, parm2, parm3, parm4, parm5, parm6;
{
afs_int32 code = 0;
+#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+ size_t bufferSize;
+#else /* AFS_SGI61_ENV */
+ u_int bufferSize;
+#endif /* AFS_SGI61_ENV */
AFS_STATCNT(afs_syscall_call);
#ifdef AFS_SUN5_ENV
if (!afs_suser() && (parm != AFSOP_GETMTU)
&& (parm != AFSOP_GETMASK)) {
/* only root can run this code */
-#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if defined(KERNEL_HAVE_UERROR)
setuerror(EACCES);
return(EACCES);
#else
-#if defined(AFS_OSF_ENV)
+#if defined(AFS_OSF_ENV)
return EACCES;
-#else /* AFS_OSF_ENV */
+#else /* AFS_OSF_ENV */
return EPERM;
-#endif
+#endif /* AFS_OSF_ENV */
#endif
#endif
}
AFS_GLOCK();
+#if defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS) && !defined(UKERNEL)
+ if (parm < AFSOP_ADDCELL || parm == AFSOP_RXEVENT_DAEMON
+ || parm == AFSOP_RXLISTENER_DAEMON) {
+ afs_DaemonOp(parm,parm2,parm3,parm4,parm5,parm6);
+ }
+#else /* !(AFS_LINUX24_ENV && !UKERNEL) */
if (parm == AFSOP_START_RXCALLBACK) {
if (afs_CB_Running) goto out;
afs_CB_Running = 1;
#ifndef RXK_LISTENER_ENV
code = afs_InitSetup(parm2);
if (!code)
-#endif /* RXK_LISTENER_ENV */
+#endif /* !RXK_LISTENER_ENV */
{
#ifdef RXK_LISTENER_ENV
while (afs_RX_Running != 2)
afs_osi_Sleep(&afs_RX_Running);
-#else
+#else /* !RXK_LISTENER_ENV */
afs_initState = AFSOP_START_AFS;
afs_osi_Wakeup(&afs_initState);
#endif /* RXK_LISTENER_ENV */
afs_osi_Invisible();
afs_RXCallBackServer();
}
-#ifdef AFS_SGI_ENV
+#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, code);
-#endif
+#endif /* AFS_SGI_ENV */
}
#ifdef RXK_LISTENER_ENV
else if (parm == AFSOP_RXLISTENER_DAEMON) {
afs_osi_Wakeup(&afs_RX_Running);
#ifndef UKERNEL
afs_osi_RxkRegister();
-#endif
+#endif /* !UKERNEL */
rxk_Listener();
}
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, code);
-#endif
+#endif /* AFS_SGI_ENV */
}
-#endif
+#endif /* RXK_LISTENER_ENV */
else if (parm == AFSOP_START_AFS) {
/* afs daemon */
- afs_int32 temp;
-
if (AFS_Running) goto out;
AFS_Running = 1;
while (afs_initState < AFSOP_START_AFS)
afs_osi_Sleep(&afs_initState);
-#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- temp = AFS_MINBUFFERS; /* Should fix this soon */
-#else
- temp = ((afs_bufferpages * NBPG)>>11); /* number of 2k buffers we could get from all of the buffer space */
- temp = temp>>2; /* don't take more than 25% (our magic parameter) */
- if (temp < AFS_MINBUFFERS) temp = AFS_MINBUFFERS; /* although we really should have this many */
-#endif
- DInit(temp);
afs_initState = AFSOP_START_BKG;
afs_osi_Wakeup(&afs_initState);
afs_osi_Invisible();
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, 0);
-#endif
+#endif /* AFS_SGI_ENV */
}
else if (parm == AFSOP_START_CS) {
afs_osi_Invisible();
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, 0);
-#endif
+#endif /* AFS_SGI_ENV */
}
else if (parm == AFSOP_START_BKG) {
while (afs_initState < AFSOP_START_BKG)
}
/* start the bkg daemon */
afs_osi_Invisible();
-#ifdef AFS_AIX32_ENV
+#ifdef AFS_AIX32_ENV
if (parm2)
afs_BioDaemon(parm2);
else
-#endif
+#endif /* AFS_AIX32_ENV */
afs_BackgroundDaemon();
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, 0);
-#endif
+#endif /* AFS_SGI_ENV */
}
else if (parm == AFSOP_START_TRUNCDAEMON) {
while (afs_initState < AFSOP_GO)
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, 0);
-#endif
+#endif /* AFS_SGI_ENV */
}
#if defined(AFS_SUN5_ENV) || defined(RXK_LISTENER_ENV)
else if (parm == AFSOP_RXEVENT_DAEMON) {
#ifdef AFS_SGI_ENV
AFS_GUNLOCK();
exit(CLD_EXITED, 0);
+#endif /* AFS_SGI_ENV */
+ }
+#endif /* AFS_SUN5_ENV || RXK_LISTENER_ENV */
+#endif /* AFS_LINUX24_ENV && !UKERNEL */
+ else if (parm == AFSOP_BASIC_INIT) {
+ afs_int32 temp;
+
+ while (!afs_InitSetup_done)
+ afs_osi_Sleep(&afs_InitSetup_done);
+
+#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+ temp = AFS_MINBUFFERS; /* Should fix this soon */
+#else
+ /* number of 2k buffers we could get from all of the buffer space */
+ temp = ((afs_bufferpages * NBPG)>>11);
+ temp = temp>>2; /* don't take more than 25% (our magic parameter) */
+ if (temp < AFS_MINBUFFERS)
+ temp = AFS_MINBUFFERS; /* though we really should have this many */
#endif
+ DInit(temp);
+ afs_rootFid.Fid.Volume = 0;
+ code = 0;
}
-#endif
else if (parm == AFSOP_ADDCELL) {
/* add a cell. Parameter 2 is 8 hosts (in net order), parm 3 is the null-terminated
name. Parameter 4 is the length of the name, including the null. Parm 5 is the
home cell flag (0x1 bit) and the nosuid flag (0x2 bit) */
struct afsop_cell tcell;
- while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
AFS_COPYIN((char *)parm2, (char *)tcell.hosts, sizeof(tcell.hosts), code);
if (!code) {
if (parm4 > sizeof(tcell.cellName))
else {
AFS_COPYIN((char *)parm3, tcell.cellName, parm4, code);
if (!code)
- afs_NewCell(tcell.cellName, tcell.hosts, parm5, (char *)0,
- (u_short)0, (u_short)0, (int)0, (char *)0);
+ afs_NewCell(tcell.cellName, tcell.hosts, parm5,
+ NULL, 0, 0, 0);
}
}
} else if (parm == AFSOP_ADDCELL2) {
struct afsop_cell tcell;
char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *lcnamep = 0;
- char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *cnamep = 0;
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- size_t bufferSize;
-#else /* AFS_SGI61_ENV */
- u_int bufferSize;
-#endif /* AFS_SGI61_ENV */
+ char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
int cflags = parm4;
- /* wait for basic init */
+#if 0
+ /* wait for basic init - XXX can't find any reason we need this? */
while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
+#endif
AFS_COPYIN((char *)parm2, (char *)tcell.hosts, sizeof(tcell.hosts), code);
if (!code) {
}
}
if (!code)
- afs_NewCell(tbuffer1, tcell.hosts, cflags, lcnamep,
- (u_short)0, (u_short)0, (int)0, (char *)0);
+ code = afs_NewCell(tbuffer1, tcell.hosts, cflags,
+ lcnamep, 0, 0, 0);
}
}
osi_FreeSmallSpace(tbuffer);
* parm2 is the alias name
* parm3 is the real cell name
*/
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- size_t bufferSize;
-#else /* AFS_SGI61_ENV */
- u_int bufferSize;
-#endif /* AFS_SGI61_ENV */
char *aliasName = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
char *cellName = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
AFS_COPYINSTR((char *)parm2, aliasName, AFS_SMALLOCSIZ, &bufferSize, code);
if (!code) AFS_COPYINSTR((char *)parm3, cellName, AFS_SMALLOCSIZ, &bufferSize, code);
- if (!code) afs_NewCell(aliasName, /* new entry name */
- 0, /* host list */
- CAlias, /* flags */
- (char *) 0, /* linked cell */
- 0, 0, /* fs & vl ports */
- 0, /* timeout */
- cellName); /* real cell name */
-
+ if (!code) afs_NewCellAlias(aliasName, cellName);
osi_FreeSmallSpace(aliasName);
osi_FreeSmallSpace(cellName);
}
+ else if (parm == AFSOP_SET_THISCELL) {
+ /*
+ * Call arguments:
+ * parm2 is the primary cell name
+ */
+ char *cell = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+
+ AFS_COPYINSTR((char *) parm2, cell, AFS_SMALLOCSIZ, &bufferSize, code);
+ if (!code)
+ afs_SetPrimaryCell(cell);
+ osi_FreeSmallSpace(cell);
+ }
else if (parm == AFSOP_CACHEINIT) {
struct afs_cacheParams cparms;
if (afs_CacheInit_Done) goto out;
- /* wait for basic init */
- while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
AFS_COPYIN((char *)parm2, (caddr_t) &cparms, sizeof(cparms), code);
if (code) {
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined (AFS_SGI64_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- goto out;
-#else
+#if defined(KERNEL_HAVE_UERROR)
setuerror(code);
code = -1;
- goto out;
#endif
+ goto out;
}
afs_CacheInit_Done = 1;
{
#ifdef AFS_SGI62_ENV
ainode = (ainode << 32) | (parm3 & 0xffffffff);
#endif
- code = afs_InitCacheFile((char *) 0, ainode);
+ code = afs_InitCacheFile(NULL, ainode);
}
else if (parm == AFSOP_ROOTVOLUME) {
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- size_t bufferSize;
-#else /* AFS_SGI61_ENV */
- u_int bufferSize;
-#endif /* AFS_SGI61_ENV */
-
/* wait for basic init */
while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
}
else code = 0;
}
- else if (parm == AFSOP_CACHEFILE || parm == AFSOP_CACHEINFO ||
- parm == AFSOP_VOLUMEINFO || parm == AFSOP_AFSLOG) {
+ else if (parm == AFSOP_CACHEFILE ||
+ parm == AFSOP_CACHEINFO ||
+ parm == AFSOP_VOLUMEINFO ||
+ parm == AFSOP_AFSLOG ||
+ parm == AFSOP_CELLINFO) {
char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- size_t bufferSize;
-#else /* AFS_SGI61_ENV */
- u_int bufferSize;
-#endif /* AFS_SGI61_ENV */
- /* wait for basic init */
- while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
code = 0;
- AFS_COPYINSTR((char *)parm2, tbuffer, AFS_SMALLOCSIZ, &bufferSize, code);
+ AFS_COPYINSTR((char *) parm2, tbuffer, AFS_SMALLOCSIZ,
+ &bufferSize, code);
if (code) {
osi_FreeSmallSpace(tbuffer);
goto out;
}
if (!code) {
- tbuffer[AFS_SMALLOCSIZ-1] = 0; /* null-terminate the name */
- /* we now have the cache dir copied in. Call the cache init routines */
- if (parm == AFSOP_CACHEFILE) code = afs_InitCacheFile(tbuffer, 0);
- else if (parm == AFSOP_CACHEINFO) code = afs_InitCacheInfo(tbuffer);
- else if (parm == AFSOP_VOLUMEINFO) code = afs_InitVolumeInfo(tbuffer);
+ tbuffer[AFS_SMALLOCSIZ-1] = '\0'; /* null-terminate the name */
+ /* We have the cache dir copied in. Call the cache init routine */
+ if (parm == AFSOP_CACHEFILE)
+ code = afs_InitCacheFile(tbuffer, 0);
+ else if (parm == AFSOP_CACHEINFO)
+ code = afs_InitCacheInfo(tbuffer);
+ else if (parm == AFSOP_VOLUMEINFO)
+ code = afs_InitVolumeInfo(tbuffer);
+ else if (parm == AFSOP_CELLINFO)
+ code = afs_InitCellInfo(tbuffer);
}
osi_FreeSmallSpace(tbuffer);
}
#endif /* AFS_SGI62_ENV && !AFS_SGI65_ENV */
#endif /* AFS_SGI53_ENV */
else if (parm == AFSOP_SHUTDOWN) {
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- extern struct mount *afs_globalVFS;
-#else /* AFS_OSF_ENV */
- extern struct vfs *afs_globalVFS;
-#endif
afs_cold_shutdown = 0;
if (parm == 1) afs_cold_shutdown = 1;
if (afs_globalVFS != 0) {
} else
afs_shutdown();
}
-
-#if ! defined(AFS_HPUX90_ENV) || defined(AFS_HPUX100_ENV)
else if (parm == AFSOP_AFS_VFSMOUNT) {
#ifdef AFS_HPUX_ENV
-#if defined(AFS_HPUX100_ENV)
vfsmount(parm2, parm3, parm4, parm5);
-#else
- afs_vfs_mount(parm2, parm3, parm4, parm5);
-#endif /* AFS_HPUX100_ENV */
#else /* defined(AFS_HPUX_ENV) */
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- code = EINVAL;
-#else
+#if defined(KERNEL_HAVE_UERROR)
setuerror(EINVAL);
+#else
+ code = EINVAL;
#endif
#endif /* defined(AFS_HPUX_ENV) */
}
-#endif
else if (parm == AFSOP_CLOSEWAIT) {
afs_SynchronousCloses = 'S';
}
mtu = ((i == -1) ? htonl(1500) : afs_cb_interface.mtu[i]);
#else /* AFS_USERSPACE_IP_ADDR */
struct ifnet *tifnp;
- struct in_ifaddr *tifadp = (struct in_ifaddr *) 0;
- extern struct ifnet *rxi_FindIfnet();
-
- tifnp = rxi_FindIfnet(parm2, &tifadp); /* make iterative */
+
+ tifnp = rxi_FindIfnet(parm2, NULL); /* make iterative */
mtu = (tifnp ? tifnp->if_mtu : htonl(1500));
#endif /* else AFS_USERSPACE_IP_ADDR */
#endif /* !AFS_SUN5_ENV */
}
#else /* AFS_USERSPACE_IP_ADDR */
struct ifnet *tifnp;
- struct in_ifaddr *tifadp = (struct in_ifaddr *) 0;
- extern struct ifnet *rxi_FindIfnet();
- tifnp = rxi_FindIfnet(parm2, &tifadp); /* make iterative */
- if (tifnp && tifadp) {
- mask = tifadp->ia_subnetmask;
- } else {
+
+ tifnp = rxi_FindIfnet(parm2, &mask); /* make iterative */
+ if (!tifnp)
code = -1;
- }
#endif /* else AFS_USERSPACE_IP_ADDR */
#endif /* !AFS_SUN5_ENV */
if (!code)
AFS_COPYIN((afs_int32 *)parm2, cellname, cellLen, code);
AFS_COPYIN((afs_int32 *)parm3, kmsg, kmsgLen, code);
if (!code) {
- code = afs_AfsdbHandler(cellname, cellLen, kmsg);
+ code = afs_AFSDBHandler(cellname, cellLen, kmsg);
if (*cellname == 1) *cellname = 0;
if (code == -2) { /* Shutting down? */
*cellname = 1;
}
#endif /* AFS_SUN57_64BIT_ENV */
-#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV)
+#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV) && !defined(AFS_IA64_LINUX20_ENV) && !defined(AFS_AMD64_LINUX20_ENV)
struct iparam32 dst32;
#ifdef AFS_SPARC64_LINUX24_ENV
};
#endif
-Afs_syscall (uap, rvp)
- register struct afssysa *uap;
- rval_t *rvp;
+Afs_syscall(register struct afssysa *uap, rval_t *rvp)
{
int *retval = &rvp->r_val1;
#else /* AFS_SUN5_ENV */
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+int
afs3_syscall(p, args, retval)
struct proc *p;
void *args;
long parm6;
} *uap = (struct a *)u.u_ap;
#else /* UKERNEL */
+int
#if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
afs_syscall ()
#else
#endif /* UKERNEL */
#if defined(AFS_DEC_ENV)
int *retval = &u.u_r.r_val1;
-#else
-#if defined(AFS_HPUX_ENV)
+#elif defined(AFS_HPUX_ENV)
long *retval = &u.u_rval1;
#else
int *retval = &u.u_rval1;
#endif
-#endif
#endif /* AFS_LINUX20_ENV */
#endif /* AFS_OSF_ENV */
#endif /* AFS_SUN5_ENV */
AFS_GUNLOCK();
#else
AFS_GLOCK();
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
code = afs_setpag(p, args, retval);
#else /* AFS_OSF_ENV */
code = afs_setpag();
#ifdef AFS_SUN5_ENV
code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, rvp, CRED());
#else
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, p->p_cred->pc_ucred);
#else
code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4);
code = copyin_iparam((char *)uap->parm3, &iparams);
if (code) {
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if defined(KERNEL_HAVE_UERROR)
setuerror(code);
#endif
} else
iparams.param3, iparams.param4, rvp, CRED());
#else
code = afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1, iparams.param2,
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
iparams.param3, iparams.param4, retval);
#else
iparams.param3, iparams.param4);
#ifdef AFS_SUN5_ENV
code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, rvp, CRED());
#else
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, retval);
#else
code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3);
}
#else
if (code) {
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if defined(KERNEL_HAVE_UERROR)
setuerror(code);
#endif
}
#endif /* !AFS_LINUX20_ENV */
} else {
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- code = EINVAL;
-#else
+#if defined(KERNEL_HAVE_UERROR)
setuerror(EINVAL);
-#endif /* AFS_SUN5_ENV */
+#else
+ code = EINVAL;
+#endif
}
-out:
+
#ifdef AFS_LINUX20_ENV
code = -code;
unlock_kernel();
* incorrectly.
* Initstate of 300 means that the volume has been *successfully* looked up.
*/
-afs_CheckInit() {
+int afs_CheckInit(void)
+{
register int code = 0;
AFS_STATCNT(afs_CheckInit);
}
int afs_shuttingdown = 0;
-void
-afs_shutdown()
+void afs_shutdown(void)
{
extern short afs_brsDaemons;
extern afs_int32 afs_CheckServerDaemonStarted;
}
#ifdef AFS_AFSDB_ENV
afs_warn("AFSDB... ");
- afs_StopAfsdb();
+ afs_StopAFSDB();
while (afs_termState == AFSOP_STOP_AFSDB)
afs_osi_Sleep(&afs_termState);
#endif
#if defined(AFS_SUN5_ENV) || defined(RXK_LISTENER_ENV)
afs_warn("RxEvent... ");
- /* cancel rx event deamon */
+ /* cancel rx event daemon */
while (afs_termState == AFSOP_STOP_RXEVENT)
afs_osi_Sleep(&afs_termState);
#if defined(RXK_LISTENER_ENV)
- afs_warn("RxListener... ");
#ifndef UKERNEL
+ afs_warn("UnmaskRxkSignals... ");
afs_osi_UnmaskRxkSignals();
#endif
/* cancel rx listener */
+ afs_warn("RxListener... ");
osi_StopListener(); /* This closes rx_socket. */
- while (afs_termState == AFSOP_STOP_RXK_LISTENER)
+ while (afs_termState == AFSOP_STOP_RXK_LISTENER) {
+ afs_warn("Sleep... ");
afs_osi_Sleep(&afs_termState);
+ }
#endif
#else
afs_termState = AFSOP_STOP_COMPLETE;
#endif
}
-shutdown_afstest()
+void shutdown_afstest(void)
{
AFS_STATCNT(shutdown_afstest);
afs_initState = afs_termState = afs_setTime = 0;
/* In case there is a bunch of dynamically build bkg daemons to free */
-afs_shutdown_BKG()
-{ AFS_STATCNT(shutdown_BKG); }
+void afs_shutdown_BKG(void)
+{
+ AFS_STATCNT(shutdown_BKG);
+}
#if defined(AFS_ALPHA_ENV) || defined(AFS_SGI61_ENV)
int afs_icl_inited = 0;
/* init function, called once, under afs_icl_lock */
-afs_icl_Init()
+int afs_icl_Init(void)
{
afs_icl_inited = 1;
return 0;
static int
Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval)
{
- register int i;
afs_int32 *lp, elts, flags;
register afs_int32 code;
struct afs_icl_log *logp;
struct afs_icl_set *setp;
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
size_t temp;
#else /* AFS_SGI61_ENV */
afs_uint32 temp;
}
#else
if (!afs_suser()) { /* only root can run this code */
-#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if defined(KERNEL_HAVE_UERROR)
setuerror(EACCES);
return EACCES;
#else
afs_lock_t afs_icl_lock;
/* exported routine: a 4 parameter event */
-afs_icl_Event4(setp, eventID, lAndT, p1, p2, p3, p4)
- register struct afs_icl_set *setp;
- afs_int32 eventID;
- afs_int32 lAndT;
- long p1, p2, p3, p4;
+int afs_icl_Event4(register struct afs_icl_set *setp, afs_int32 eventID,
+ afs_int32 lAndT, long p1, long p2, long p3, long p4)
{
- register struct afs_icl_log *logp;
afs_int32 mask;
register int i;
register afs_int32 tmask;
int ix;
/* If things aren't init'ed yet (or the set is inactive), don't panic */
- if (!ICL_SETACTIVE(setp)) return;
+ if (!ICL_SETACTIVE(setp))
+ return 0;
AFS_ASSERT_GLOCK();
mask = lAndT>>24 & 0xff; /* mask of which logs to log to */
}
}
ReleaseReadLock(&setp->lock);
+ return 0;
}
/* Next 4 routines should be implemented via var-args or something.
* Whole purpose is to avoid compiler warnings about parameter # mismatches.
* Otherwise, could call afs_icl_Event4 directly.
*/
-afs_icl_Event3(setp, eventID, lAndT, p1, p2, p3)
- register struct afs_icl_set *setp;
- afs_int32 eventID;
- afs_int32 lAndT;
- long p1, p2, p3;
+int afs_icl_Event3(register struct afs_icl_set *setp, afs_int32 eventID,
+ afs_int32 lAndT, long p1, long p2, long p3)
{
return afs_icl_Event4(setp, eventID, lAndT, p1, p2, p3, (long)0);
}
-afs_icl_Event2(setp, eventID, lAndT, p1, p2)
- register struct afs_icl_set *setp;
- afs_int32 eventID;
- afs_int32 lAndT;
- long p1, p2;
+int afs_icl_Event2(register struct afs_icl_set *setp, afs_int32 eventID,
+ afs_int32 lAndT, long p1, long p2)
{
return afs_icl_Event4(setp, eventID, lAndT, p1, p2, (long)0, (long)0);
}
-afs_icl_Event1(setp, eventID, lAndT, p1)
- register struct afs_icl_set *setp;
- afs_int32 eventID;
- afs_int32 lAndT;
- long p1;
+int afs_icl_Event1(register struct afs_icl_set *setp, afs_int32 eventID,
+ afs_int32 lAndT, long p1)
{
return afs_icl_Event4(setp, eventID, lAndT, p1, (long)0, (long)0, (long)0);
}
-afs_icl_Event0(setp, eventID, lAndT)
- register struct afs_icl_set *setp;
- afs_int32 eventID;
- afs_int32 lAndT;
+int afs_icl_Event0(register struct afs_icl_set *setp, afs_int32 eventID,
+ afs_int32 lAndT)
{
return afs_icl_Event4(setp, eventID, lAndT, (long)0, (long)0, (long)0, (long)0);
}
*
* Log must be write-locked.
*/
-static afs_icl_GetLogSpace(logp, minSpace)
- register struct afs_icl_log *logp;
- afs_int32 minSpace;
+static void afs_icl_GetLogSpace(register struct afs_icl_log *logp, afs_int32 minSpace)
{
register unsigned int tsize;
* log must be write-locked.
*/
#define ICL_CHARSPERLONG 4
-static afs_int32 afs_icl_AppendString(logp, astr)
- struct afs_icl_log *logp;
- char *astr;
+static void afs_icl_AppendString(struct afs_icl_log *logp, char *astr)
{
char *op; /* ptr to char to write */
int tc;
/* routine to tell whether we're dealing with the address or the
* object itself
*/
-afs_icl_UseAddr(type)
- int type;
+int afs_icl_UseAddr(int type)
{
if (type == ICL_TYPE_HYPER || type == ICL_TYPE_STRING
|| type == ICL_TYPE_FID || type == ICL_TYPE_INT64)
* pretty soon, anyway. The log must be unlocked.
*/
-afs_icl_AppendRecord(logp, op, types, p1, p2, p3, p4)
- register struct afs_icl_log *logp;
- afs_int32 op;
- afs_int32 types;
- long p1, p2, p3, p4;
+void afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op,
+ afs_int32 types, long p1, long p2, long p3, long p4)
{
int rsize; /* record size in longs */
register int tsize; /* temp size */
/* create a log with size logSize; return it in *outLogpp and tag
* it with name "name."
*/
-afs_icl_CreateLog(name, logSize, outLogpp)
- char *name;
- afs_int32 logSize;
- struct afs_icl_log **outLogpp;
+int afs_icl_CreateLog(char *name, afs_int32 logSize, struct afs_icl_log **outLogpp)
{
return afs_icl_CreateLogWithFlags(name, logSize, /*flags*/0, outLogpp);
}
/* create a log with size logSize; return it in *outLogpp and tag
* it with name "name." 'flags' can be set to make the log unclearable.
*/
-afs_icl_CreateLogWithFlags(name, logSize, flags, outLogpp)
- char *name;
- afs_int32 logSize;
- afs_uint32 flags;
- struct afs_icl_log **outLogpp;
+int afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize, afs_uint32 flags,
+ struct afs_icl_log **outLogpp)
{
register struct afs_icl_log *logp;
strcpy(logp->name, name);
LOCK_INIT(&logp->lock, "logp lock");
logp->logSize = logSize;
- logp->datap = (afs_int32 *)0; /* don't allocate it until we need it */
+ logp->datap = NULL; /* don't allocate it until we need it */
if (flags & ICL_CRLOG_FLAG_PERSISTENT)
logp->states |= ICL_LOGF_PERSISTENT;
* in *flagsp. The flag ICL_COPYOUTF_MISSEDSOME is set if we can't
* find the record with cookie value cookie.
*/
-afs_icl_CopyOut(logp, bufferp, bufSizep, cookiep, flagsp)
- register struct afs_icl_log *logp;
- afs_int32 *bufferp;
- afs_int32 *bufSizep;
- afs_uint32 *cookiep;
- afs_int32 *flagsp;
+int afs_icl_CopyOut(register struct afs_icl_log *logp, afs_int32 *bufferp,
+ afs_int32 *bufSizep, afs_uint32 *cookiep, afs_int32 *flagsp)
{
afs_int32 nwords; /* number of words to copy out */
afs_uint32 startCookie; /* first cookie to use */
- register afs_int32 i;
afs_int32 outWords; /* words we've copied out */
afs_int32 inWords; /* max words to copy out */
afs_int32 code; /* return code */
}
/* return basic parameter information about a log */
-afs_icl_GetLogParms(logp, maxSizep, curSizep)
- struct afs_icl_log *logp;
- afs_int32 *maxSizep;
- afs_int32 *curSizep;
+int afs_icl_GetLogParms(struct afs_icl_log *logp, afs_int32 *maxSizep,
+ afs_int32 *curSizep)
{
ObtainReadLock(&logp->lock);
*maxSizep = logp->logSize;
/* hold and release logs */
-afs_icl_LogHold(logp)
- register struct afs_icl_log *logp;
+int afs_icl_LogHold(register struct afs_icl_log *logp)
{
ObtainWriteLock(&afs_icl_lock,187);
logp->refCount++;
}
/* hold and release logs, called with lock already held */
-afs_icl_LogHoldNL(logp)
- register struct afs_icl_log *logp;
+int afs_icl_LogHoldNL(register struct afs_icl_log *logp)
{
logp->refCount++;
return 0;
}
/* keep track of how many sets believe the log itself is allocated */
-afs_icl_LogUse(logp)
- register struct afs_icl_log *logp;
+int afs_icl_LogUse(register struct afs_icl_log *logp)
{
ObtainWriteLock(&logp->lock,188);
if (logp->setCount == 0) {
logp->logSize = ICL_DEFAULT_LOGSIZE;
}
logp->datap = (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * logp->logSize);
-#ifdef AFS_AIX32_ENV
+#ifdef KERNEL_HAVE_PIN
pin((char *)logp->datap, sizeof(afs_int32) * logp->logSize);
#endif
}
}
/* decrement the number of real users of the log, free if possible */
-afs_icl_LogFreeUse(logp)
- register struct afs_icl_log *logp;
+int afs_icl_LogFreeUse(register struct afs_icl_log *logp)
{
ObtainWriteLock(&logp->lock,189);
if (--logp->setCount == 0) {
/* no more users -- free it (but keep log structure around)*/
afs_osi_Free(logp->datap, sizeof(afs_int32) * logp->logSize);
-#ifdef AFS_AIX32_ENV
+#ifdef KERNEL_HAVE_PIN
unpin((char *)logp->datap, sizeof(afs_int32) * logp->logSize);
#endif
logp->firstUsed = logp->firstFree = 0;
logp->logElements = 0;
- logp->datap = (afs_int32 *)0;
+ logp->datap = NULL;
}
ReleaseWriteLock(&logp->lock);
return 0;
}
/* set the size of the log to 'logSize' */
-afs_icl_LogSetSize(logp, logSize)
- register struct afs_icl_log *logp;
- afs_int32 logSize;
+int afs_icl_LogSetSize(register struct afs_icl_log *logp, afs_int32 logSize)
{
ObtainWriteLock(&logp->lock,190);
if (!logp->datap) {
/* free and allocate a new one */
afs_osi_Free(logp->datap, sizeof(afs_int32) * logp->logSize);
-#ifdef AFS_AIX32_ENV
+#ifdef KERNEL_HAVE_PIN
unpin((char *)logp->datap, sizeof(afs_int32) * logp->logSize);
#endif
logp->datap = (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * logSize);
-#ifdef AFS_AIX32_ENV
+#ifdef KERNEL_HAVE_PIN
pin((char *)logp->datap, sizeof(afs_int32) * logSize);
#endif
logp->logSize = logSize;
}
/* free a log. Called with afs_icl_lock locked. */
-afs_icl_ZapLog(logp)
- register struct afs_icl_log *logp;
+int afs_icl_ZapLog(register struct afs_icl_log *logp)
{
register struct afs_icl_log **lpp, *tp;
}
/* do the release, watching for deleted entries */
-afs_icl_LogRele(logp)
- register struct afs_icl_log *logp;
+int afs_icl_LogRele(register struct afs_icl_log *logp)
{
ObtainWriteLock(&afs_icl_lock,191);
if (--logp->refCount == 0 && (logp->states & ICL_LOGF_DELETED)) {
}
/* do the release, watching for deleted entries, log already held */
-afs_icl_LogReleNL(logp)
- register struct afs_icl_log *logp;
+int afs_icl_LogReleNL(register struct afs_icl_log *logp)
{
if (--logp->refCount == 0 && (logp->states & ICL_LOGF_DELETED)) {
afs_icl_ZapLog(logp); /* destroys logp's lock! */
}
/* zero out the log */
-afs_icl_ZeroLog(logp)
- register struct afs_icl_log *logp;
+int afs_icl_ZeroLog(register struct afs_icl_log *logp)
{
ObtainWriteLock(&logp->lock,192);
logp->firstUsed = logp->firstFree = 0;
}
/* free a log entry, and drop its reference count */
-afs_icl_LogFree(logp)
- register struct afs_icl_log *logp;
+int afs_icl_LogFree(register struct afs_icl_log *logp)
{
ObtainWriteLock(&logp->lock,193);
logp->states |= ICL_LOGF_DELETED;
}
/* find a log by name, returning it held */
-struct afs_icl_log *afs_icl_FindLog(name)
- char *name;
+struct afs_icl_log *afs_icl_FindLog(char *name)
{
register struct afs_icl_log *tp;
ObtainWriteLock(&afs_icl_lock,194);
return tp;
}
-afs_icl_EnumerateLogs(aproc, arock)
- int (*aproc)();
- char *arock;
+int afs_icl_EnumerateLogs(int (*aproc)(), char *arock)
{
register struct afs_icl_log *tp;
register afs_int32 code;
struct afs_icl_set *afs_icl_allSets = 0;
-afs_icl_CreateSet(name, baseLogp, fatalLogp, outSetpp)
- char *name;
- struct afs_icl_log *baseLogp;
- struct afs_icl_log *fatalLogp;
- struct afs_icl_set **outSetpp;
+int afs_icl_CreateSet(char *name, struct afs_icl_log *baseLogp,
+ struct afs_icl_log *fatalLogp, struct afs_icl_set **outSetpp)
{
return afs_icl_CreateSetWithFlags(name, baseLogp, fatalLogp,
/*flags*/0, outSetpp);
* addds references from the new afs_icl_set. When the set is destroyed,
* those references will be released.
*/
-afs_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 afs_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;
strcpy(setp->name, name);
setp->nevents = ICL_DEFAULTEVENTS;
setp->eventFlags = afs_osi_Alloc(ICL_DEFAULTEVENTS);
-#ifdef AFS_AIX32_ENV
+#ifdef KERNEL_HAVE_PIN
pin((char *)setp->eventFlags, ICL_DEFAULTEVENTS);
#endif
for(i=0; i<ICL_DEFAULTEVENTS; i++)
}
/* function to change event enabling information for a particular set */
-afs_icl_SetEnable(setp, eventID, setValue)
- struct afs_icl_set *setp;
- afs_int32 eventID;
- int setValue;
+int afs_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.
*/
-afs_icl_GetEnable(setp, eventID, getValuep)
- struct afs_icl_set *setp;
- afs_int32 eventID;
- int *getValuep;
+int afs_icl_GetEnable(struct afs_icl_set *setp, afs_int32 eventID,
+ int *getValuep)
{
ObtainReadLock(&setp->lock);
if (!ICL_EVENTOK(setp, eventID)) {
}
/* hold and release event sets */
-afs_icl_SetHold(setp)
- register struct afs_icl_set *setp;
+int afs_icl_SetHold(register struct afs_icl_set *setp)
{
ObtainWriteLock(&afs_icl_lock,201);
setp->refCount++;
}
/* free a set. Called with afs_icl_lock locked */
-afs_icl_ZapSet(setp)
- register struct afs_icl_set *setp;
+int afs_icl_ZapSet(register struct afs_icl_set *setp)
{
register struct afs_icl_set **lpp, *tp;
int i;
*lpp = setp->nextp;
osi_FreeSmallSpace(setp->name);
afs_osi_Free(setp->eventFlags, ICL_DEFAULTEVENTS);
-#ifdef AFS_AIX32_ENV
+#ifdef KERNEL_HAVE_PIN
unpin((char *)setp->eventFlags, ICL_DEFAULTEVENTS);
#endif
for(i=0; i < ICL_LOGSPERSET; i++) {
- if (tlp = setp->logs[i])
+ if ((tlp = setp->logs[i]))
afs_icl_LogReleNL(tlp);
}
osi_FreeSmallSpace(setp);
}
/* do the release, watching for deleted entries */
-afs_icl_SetRele(setp)
- register struct afs_icl_set *setp;
+int afs_icl_SetRele(register struct afs_icl_set *setp)
{
ObtainWriteLock(&afs_icl_lock,202);
if (--setp->refCount == 0 && (setp->states & ICL_SETF_DELETED)) {
}
/* free a set entry, dropping its reference count */
-afs_icl_SetFree(setp)
- register struct afs_icl_set *setp;
+int afs_icl_SetFree(register struct afs_icl_set *setp)
{
ObtainWriteLock(&setp->lock,203);
setp->states |= ICL_SETF_DELETED;
}
/* find a set by name, returning it held */
-struct afs_icl_set *afs_icl_FindSet(name)
- char *name;
+struct afs_icl_set *afs_icl_FindSet(char *name)
{
register struct afs_icl_set *tp;
ObtainWriteLock(&afs_icl_lock,204);
}
/* zero out all the logs in the set */
-afs_icl_ZeroSet(setp)
- struct afs_icl_set *setp;
+int afs_icl_ZeroSet(struct afs_icl_set *setp)
{
register int i;
int code = 0;
return code;
}
-afs_icl_EnumerateSets(aproc, arock)
- int (*aproc)();
- char *arock;
+int afs_icl_EnumerateSets(int (*aproc)(), char *arock)
{
register struct afs_icl_set *tp, *np;
register afs_int32 code;
return code;
}
-afs_icl_AddLogToSet(setp, newlogp)
- struct afs_icl_set *setp;
- struct afs_icl_log *newlogp;
+int afs_icl_AddLogToSet(struct afs_icl_set *setp, struct afs_icl_log *newlogp)
{
register int i;
int code = -1;
- struct afs_icl_log *logp;
ObtainWriteLock(&setp->lock,207);
for(i = 0; i < ICL_LOGSPERSET; i++) {
return code;
}
-afs_icl_SetSetStat(setp, op)
- struct afs_icl_set *setp;
- int op;
+int afs_icl_SetSetStat(struct afs_icl_set *setp, int op)
{
int i;
afs_int32 code;