linux-warning-reduction-20090318
[openafs.git] / src / afs / afs_call.c
index 8e0f728..bccb764 100644 (file)
@@ -72,6 +72,7 @@ char afs_cachebasedir[1024];
 
 afs_int32 afs_rx_deadtime = AFS_RXDEADTIME;
 afs_int32 afs_rx_harddead = AFS_HARDDEADTIME;
+afs_int32 afs_rx_idledead = AFS_IDLEDEADTIME;
 
 static int afscall_set_rxpck_received = 0;
 
@@ -85,7 +86,6 @@ extern int afs_vfs_mount();
 static int
 afs_InitSetup(int preallocs)
 {
-    extern void afs_InitStats();
     int code;
 
     if (afs_InitSetup_done)
@@ -414,8 +414,10 @@ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5,
 {
     int code;
     DECLARE_COMPLETION(c);
-#if defined(AFS_LINUX26_ENV)
+#if defined(AFS_LINUX26_ENV) 
+#if defined(INIT_WORK_HAS_DATA)
     struct work_struct tq;
+#endif
 #else
     struct tq_struct tq;
 #endif
@@ -467,19 +469,17 @@ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5,
 static void
 wait_for_cachedefs(void) {
 #ifdef AFS_CACHE_VNODE_PATH
-    while ((afs_numcachefiles < 1) || (afs_numfilesperdir < 1) ||
-          (afs_cachebasedir[0] != '/')) {
-       printf("afs: waiting for cache parameter definitions\n");
-       afs_osi_Sleep(&afs_initState);
-    }
+    if (cacheDiskType != AFS_FCACHE_TYPE_MEM) 
+       while ((afs_numcachefiles < 1) || (afs_numfilesperdir < 1) ||
+              (afs_cachebasedir[0] != '/')) {
+           printf("afs: waiting for cache parameter definitions\n");
+           afs_osi_Sleep(&afs_initState);
+       }
 #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_syscall_call(long parm, long parm2, long parm3, long parm4, long parm5, long parm6)
 {
     afs_int32 code = 0;
 #if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
@@ -539,6 +539,7 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
 #endif /* RXK_LISTENER_ENV */
            afs_osi_Invisible();
            afs_RXCallBackServer();
+           afs_osi_Visible();
        }
 #ifdef AFS_SGI_ENV
        AFS_GUNLOCK();
@@ -567,6 +568,7 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
            afs_osi_RxkRegister();
 #endif /* !UKERNEL */
            rxk_Listener();
+           afs_osi_Visible();
        }
 #ifdef AFS_SGI_ENV
        AFS_GUNLOCK();
@@ -586,6 +588,7 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
        afs_osi_Wakeup(&afs_initState);
        afs_osi_Invisible();
        afs_Daemon();
+       afs_osi_Visible();
 #ifdef AFS_SGI_ENV
        AFS_GUNLOCK();
        exit(CLD_EXITED, 0);
@@ -593,6 +596,7 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
     } else if (parm == AFSOP_START_CS) {
        afs_osi_Invisible();
        afs_CheckServerDaemon();
+       afs_osi_Visible();
 #ifdef AFS_SGI_ENV
        AFS_GUNLOCK();
        exit(CLD_EXITED, 0);
@@ -612,6 +616,7 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
        else
 #endif /* AFS_AIX32_ENV */
            afs_BackgroundDaemon();
+       afs_osi_Visible();
 #ifdef AFS_SGI_ENV
        AFS_GUNLOCK();
        exit(CLD_EXITED, 0);
@@ -622,6 +627,7 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
        /* start the bkg daemon */
        afs_osi_Invisible();
        afs_CacheTruncateDaemon();
+       afs_osi_Visible();
 #ifdef AFS_SGI_ENV
        AFS_GUNLOCK();
        exit(CLD_EXITED, 0);
@@ -633,6 +639,7 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
            afs_osi_Sleep(&afs_initState);
        afs_osi_Invisible();
        afs_rxevent_daemon();
+       afs_osi_Visible();
 #ifdef AFS_SGI_ENV
        AFS_GUNLOCK();
        exit(CLD_EXITED, 0);
@@ -865,22 +872,24 @@ afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
        osi_FreeSmallSpace(tbuffer);
     } else if (parm == AFSOP_GO) {
 #ifdef AFS_CACHE_VNODE_PATH
-       afs_int32 dummy;
-
-       wait_for_cachedefs();
-
+       if (cacheDiskType != AFS_FCACHE_TYPE_MEM) {
+           afs_int32 dummy;
+           
+           wait_for_cachedefs();
+           
 #ifdef AFS_DARWIN80_ENV
-       get_vfs_context();
+           get_vfs_context();
 #endif
-       if ((afs_numcachefiles > 0) && (afs_numfilesperdir > 0) && 
-           (afs_cachebasedir[0] == '/')) {
-           for (dummy = 0; dummy < afs_numcachefiles; dummy++) {
-               code = afs_InitCacheFile(NULL, dummy);
-           }
-       }
+           if ((afs_numcachefiles > 0) && (afs_numfilesperdir > 0) && 
+               (afs_cachebasedir[0] == '/')) {
+               for (dummy = 0; dummy < afs_numcachefiles; dummy++) {
+                   code = afs_InitCacheFile(NULL, dummy);
+               }
+           }
 #ifdef AFS_DARWIN80_ENV
-       put_vfs_context();
+           put_vfs_context();
 #endif
+       }
 #endif
        /* the generic initialization calls come here.  One parameter: should we do the
         * set-time operation on this workstation */
@@ -1252,12 +1261,10 @@ afs_shutdown(void)
 #endif
     afs_warn("\n");
 
-    /* Close file only after daemons which can write to it are stopped. */
-    if (afs_cacheInodep) {     /* memcache won't set this */
-       osi_UFSClose(afs_cacheInodep);  /* Since we always leave it open */
-       afs_cacheInodep = 0;
-    }
-    return;                    /* Just kill daemons for now */
+#ifdef AFS_AIX51_ENV
+    shutdown_daemons();
+#endif
+
 #ifdef notdef
     shutdown_CB();
     shutdown_AFS();
@@ -1265,21 +1272,16 @@ afs_shutdown(void)
     shutdown_rxevent();
     shutdown_rx();
     afs_shutdown_BKG();
-    shutdown_bufferpackage();
-#endif
-#ifdef AFS_AIX51_ENV
-    shutdown_daemons();
 #endif
-#ifdef notdef
+    shutdown_bufferpackage();
     shutdown_cache();
     shutdown_osi();
     shutdown_osinet();
     shutdown_osifile();
     shutdown_vnodeops();
-    shutdown_vfsops();
-    shutdown_exporter();
     shutdown_memcache();
 #if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)) && !defined(AFS_OSF_ENV)
+    shutdown_exporter();
     shutdown_nfsclnt();
 #endif
     shutdown_afstest();
@@ -1290,8 +1292,16 @@ afs_shutdown(void)
     memset(&afs_stats_cmfullperf, 0, sizeof(struct afs_stats_CMFullPerf));
 */
     afs_warn(" ALL allocated tables\n");
+
+    /* Close file only after daemons which can write to it are stopped. */
+    if (afs_cacheInodep) {     /* memcache won't set this */
+       osi_UFSClose(afs_cacheInodep);  /* Since we always leave it open */
+       afs_cacheInodep = 0;
+    }
+
     afs_shuttingdown = 0;
-#endif
+
+    return;                    /* Just kill daemons for now */
 }
 
 void