afs: Move init_hckernel_init to osi_Init
[openafs.git] / src / afs / afs_osi.c
index 95579c1..9398376 100644 (file)
  *     -- On HP called from afsc_link.
  *     -- On SGI called from afs_init. */
 
+/* No hckernel-specific header for this prototype. */
+#ifndef UKERNEL
+extern void init_hckernel_mutex(void);
+#endif
+
 afs_lock_t afs_ftf;            /* flush text lock */
 
 #ifdef AFS_SGI53_ENV
@@ -78,6 +83,12 @@ osi_Init(void)
 
     osi_InitGlock();
 
+    /* Initialize a lock for the kernel hcrypto bits. */
+#ifndef UKERNEL
+    init_hckernel_mutex();
+#endif
+
+
     if (!afs_osicred_initialized) {
 #if defined(AFS_DARWIN80_ENV)
         afs_osi_ctxtp_initialized = 0;
@@ -88,6 +99,8 @@ osi_Init(void)
        /* Can't just invent one, must use crget() because of mutex */
        afs_osi_credp =
          crdup(osi_curcred());
+#elif defined(AFS_SUN5_ENV)
+       afs_osi_credp = kcred;
 #else
        memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
 #if defined(AFS_LINUX26_ENV)