Linux: Use the kernel's credentials structure
[openafs.git] / src / afs / afs_osi.c
index 79493ef..1257902 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000, International Business Machines Corporation and others.
+ * Copyrigh 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
  *
  * This software has been released under the terms of the IBM Public
@@ -10,8 +10,6 @@
 #include <afsconfig.h>
 #include "afs/param.h"
 
-RCSID
-    ("$Header$");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
@@ -36,7 +34,7 @@ lock_t afs_event_lock;
 flid_t osi_flid;
 #endif
 
-struct AFS_UCRED *afs_osi_credp;
+afs_ucred_t *afs_osi_credp;
 
 #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
 kmutex_t afs_global_lock;
@@ -47,10 +45,6 @@ kmutex_t afs_rxglobal_lock;
 long afs_global_owner;
 #endif
 
-#if defined(AFS_OSF_ENV)
-simple_lock_data_t afs_global_lock;
-#endif
-
 #if defined(AFS_DARWIN_ENV) 
 #ifdef AFS_DARWIN80_ENV
 lck_mtx_t  *afs_global_lock;
@@ -61,15 +55,15 @@ struct lock__bsd__ afs_global_lock;
 
 #if defined(AFS_XBSD_ENV) && !defined(AFS_FBSD50_ENV)
 struct lock afs_global_lock;
-struct proc *afs_global_owner;
+afs_proc_t *afs_global_owner;
 #endif
 #ifdef AFS_FBSD50_ENV
 struct mtx afs_global_mtx;
 #endif
 
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
+#if defined(AFS_DARWIN_ENV)
 thread_t afs_global_owner;
-#endif /* AFS_OSF_ENV */
+#endif /* AFS_DARWIN_ENV */
 
 #if defined(AFS_AIX41_ENV)
 simple_lock_data afs_global_lock;
@@ -87,9 +81,6 @@ osi_Init(void)
 #if defined(AFS_GLOBAL_SUNLOCK)
 #if defined(AFS_SGI62_ENV)
     mutex_init(&afs_global_lock, MUTEX_DEFAULT, "afs_global_lock");
-#elif defined(AFS_OSF_ENV)
-    usimple_lock_init(&afs_global_lock);
-    afs_global_owner = (thread_t) 0;
 #elif defined(AFS_FBSD50_ENV)
 #if defined(AFS_FBSD80_ENV) && defined(WITNESS)
     /* "lock_initalized" (sic) can panic, checks a flag bit
@@ -122,9 +113,9 @@ osi_Init(void)
        /* Can't just invent one, must use crget() because of mutex */
        afs_osi_credp = crdup(osi_curcred());
 #else
-       memset(&afs_osi_cred, 0, sizeof(struct AFS_UCRED));
+       memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
 #if defined(AFS_LINUX26_ENV)
-        afs_osi_cred.cr_group_info = groups_alloc(0);
+        afs_set_cr_group_info(&afs_osi_cred, groups_alloc(0));
 #endif
 #if defined(AFS_DARWIN80_ENV)
         afs_osi_cred.cr_ref = 1; /* kauth_cred_get_ref needs 1 existing ref */
@@ -171,7 +162,7 @@ afs_osi_MaskUserLoop()
 }
 
 void 
-afs_osi_UnmaskUserLoop()
+afs_osi_UnmaskUserLoop(void)
 {
 #ifdef AFS_DARWIN_ENV
     afs_osi_fullSigRestore();