return;
afs_shuttingdown = 1;
if (afs_cold_shutdown)
- afs_warn("COLD ");
+ afs_warn("afs: COLD ");
else
- afs_warn("WARM ");
+ afs_warn("afs: WARM ");
afs_warn("shutting down of: CB... ");
afs_termState = AFSOP_STOP_RXCALLBACK;
#ifdef AFS_AIX51_ENV
shutdown_rxkernel();
#endif
- /* shutdown_rxkernel(); */
+ /* close rx server connections here? */
while (afs_termState == AFSOP_STOP_RXCALLBACK)
afs_osi_Sleep(&afs_termState);
#else
afs_termState = AFSOP_STOP_COMPLETE;
#endif
- afs_warn("\n");
#ifdef AFS_AIX51_ENV
shutdown_daemons();
#endif
-
-#ifdef notdef
shutdown_CB();
- shutdown_AFS();
- shutdown_rxkernel();
- shutdown_rxevent();
- shutdown_rx();
- afs_shutdown_BKG();
-#endif
shutdown_bufferpackage();
shutdown_cache();
shutdown_osi();
shutdown_nfsclnt();
#endif
shutdown_afstest();
+ shutdown_AFS();
/* The following hold the cm stats */
-/*
memset(&afs_cmstats, 0, sizeof(struct afs_CMStats));
memset(&afs_stats_cmperf, 0, sizeof(struct afs_stats_CMPerf));
memset(&afs_stats_cmfullperf, 0, sizeof(struct afs_stats_CMFullPerf));
-*/
- afs_warn(" ALL allocated tables\n");
+ afs_warn(" ALL allocated tables... ");
afs_shuttingdown = 0;
+ afs_warn("done\n");
return; /* Just kill daemons for now */
}
*afs_rootVolumeName = 0;
}
}
-
-
-/* In case there is a bunch of dynamically build bkg daemons to free */
-void
-afs_shutdown_BKG(void)
-{
- AFS_STATCNT(shutdown_BKG);
-}
}
+static void
+shutdown_server(void)
+{
+ int i;
+ struct afs_conn *tc, *ntc;
+ struct afs_cbr *tcbrp, *tbrp;
+ struct srvAddr *sa;
+
+ for (i = 0; i < NSERVERS; i++) {
+ struct server *ts, *next;
+
+ ts = afs_servers[i];
+ while(ts) {
+ next = ts->next;
+ for (sa = ts->addr; sa; sa = sa->next_sa) {
+ if (sa->conns) {
+ /*
+ * Free all server's connection structs
+ */
+ tc = sa->conns;
+ while (tc) {
+ ntc = tc->next;
+#if 0
+ /* we should destroy all connections
+ when shutting down Rx, not here */
+ AFS_GUNLOCK();
+ rx_DestroyConnection(tc->id);
+ AFS_GLOCK();
+#endif
+ afs_osi_Free(tc, sizeof(struct afs_conn));
+ tc = ntc;
+ }
+ }
+ }
+ for (tcbrp = ts->cbrs; tcbrp; tcbrp = tbrp) {
+ /*
+ * Free all server's callback structs
+ */
+ tbrp = tcbrp->next;
+ afs_FreeCBR(tcbrp);
+ }
+ afs_osi_Free(ts, sizeof(struct server));
+ ts = next;
+ }
+ }
+
+ for (i = 0; i < NSERVERS; i++) {
+ struct srvAddr *sa, *next;
+
+ sa = afs_srvAddrs[i];
+ while(sa) {
+ next = sa->next_bkt;
+ afs_osi_Free(sa, sizeof(struct srvAddr));
+ sa = next;
+ }
+ }
+}
+
+static void
+shutdown_volume(void)
+{
+ struct volume *tv;
+ int i;
+
+ for (i = 0; i < NVOLS; i++) {
+ for (tv = afs_volumes[i]; tv; tv = tv->next) {
+ if (tv->name) {
+ afs_osi_Free(tv->name, strlen(tv->name) + 1);
+ tv->name = 0;
+ }
+ }
+ afs_volumes[i] = 0;
+ }
+}
+
void
shutdown_AFS(void)
{
int i;
- register struct srvAddr *sa;
AFS_STATCNT(shutdown_AFS);
if (afs_cold_shutdown) {
afs_resourceinit_flag = 0;
- /*
- * Free Volumes table allocations
- */
- {
- struct volume *tv;
- for (i = 0; i < NVOLS; i++) {
- for (tv = afs_volumes[i]; tv; tv = tv->next) {
- if (tv->name) {
- afs_osi_Free(tv->name, strlen(tv->name) + 1);
- tv->name = 0;
- }
- }
- afs_volumes[i] = 0;
- }
- }
+
+ shutdown_volume();
/*
* Free FreeVolList allocations
afs_memvolumes * sizeof(struct volume));
afs_freeVolList = Initialafs_freeVolList = 0;
- /* XXX HACK fort MEM systems XXX
+ /* XXX HACK for MEM systems XXX
*
* For -memcache cache managers when we run out of free in memory volumes
* we simply malloc more; we won't be able to free those additional volumes.
*/
-
-
/*
* Free Users table allocation
*/
}
}
- /*
- * Free Servers table allocation
- */
- {
- struct server *ts, *nts;
- struct afs_conn *tc, *ntc;
- register struct afs_cbr *tcbrp, *tbrp;
-
- for (i = 0; i < NSERVERS; i++) {
- for (ts = afs_servers[i]; ts; ts = nts) {
- nts = ts->next;
- for (sa = ts->addr; sa; sa = sa->next_sa) {
- if (sa->conns) {
- /*
- * Free all server's connection structs
- */
- tc = sa->conns;
- while (tc) {
- ntc = tc->next;
- AFS_GUNLOCK();
- rx_DestroyConnection(tc->id);
- AFS_GLOCK();
- afs_osi_Free(tc, sizeof(struct afs_conn));
- tc = ntc;
- }
- }
- }
- for (tcbrp = ts->cbrs; tcbrp; tcbrp = tbrp) {
- /*
- * Free all server's callback structs
- */
- tbrp = tcbrp->next;
- afs_FreeCBR(tcbrp);
- }
- afs_osi_Free(ts, sizeof(struct server));
- }
- afs_servers[i] = 0;
- }
- }
for (i = 0; i < NFENTRIES; i++)
fvTable[i] = 0;
/* Reinitialize local globals to defaults */
extern int afs_CheckInit(void);
extern void afs_shutdown(void);
extern void shutdown_afstest(void);
-extern void afs_shutdown_BKG(void);
extern int afs_syscall_call(long parm, long parm2, long parm3,
long parm4, long parm5, long parm6);
#if defined(AFS_DARWIN100_ENV)
#endif
#endif
extern int afs_HaveCallBacksFrom(struct server *aserver);
-extern void shutdown_server(void);
extern void afs_RemoveAllConns(void);
extern void afs_MarkAllServersUp(void);
extern struct volume *afs_UFSGetVolSlot(void);
extern void afs_CheckVolumeNames(int flags);
-
/* Prototypes for generated files that aren't really in src/afs/ */
/* afs_uuid.c */
ReleaseWriteLock(&afs_xsrvAddr);
ReleaseWriteLock(&afs_xserver);
}
-
-void shutdown_server(void)
-{
- int i;
-
- for (i = 0; i < NSERVERS; i++) {
- struct server *ts, *next;
-
- ts = afs_servers[i];
- while(ts) {
- next = ts->next;
- afs_osi_Free(ts, sizeof(struct server));
- ts = next;
- }
- }
-
- for (i = 0; i < NSERVERS; i++) {
- struct srvAddr *sa, *next;
-
- sa = afs_srvAddrs[i];
- while(sa) {
- next = sa->next_bkt;
- afs_osi_Free(sa, sizeof(struct srvAddr));
- sa = next;
- }
- }
-}