static int afs_pag_sleepcnt = 0;
-static int
-afs_pag_sleep(struct AFS_UCRED **acred)
+static int
+afs_pag_sleep(struct AFS_UCRED **acred)
{
- int rv = 0;
- if(!afs_suser(acred)) {
- if(osi_Time() - pag_epoch < pagCounter) {
- rv = 1;
+ int rv = 0;
+
+ if (!afs_suser(acred)) {
+ if(osi_Time() - pag_epoch < pagCounter) {
+ rv = 1;
+ }
}
- }
- return rv;
+ return rv;
}
-static int
+static int
afs_pag_wait(struct AFS_UCRED **acred)
{
- if(afs_pag_sleep(acred)) {
- if(!afs_pag_sleepcnt) {
- printf("%s() PAG throttling triggered, pid %d... sleeping. sleepcnt %d\n",
- __func__, getpid(), afs_pag_sleepcnt);
+ if (afs_pag_sleep(acred)) {
+ if (!afs_pag_sleepcnt) {
+ printf("%s() PAG throttling triggered, pid %d... sleeping. sleepcnt %d\n",
+ "afs_pag_wait", osi_getpid(), afs_pag_sleepcnt);
+ }
+
+ afs_pag_sleepcnt++;
+
+ do {
+ /* XXX spins on EINTR */
+ afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0);
+ } while (afs_pag_sleep(acred));
+
+ afs_pag_sleepcnt--;
}
-
- afs_pag_sleepcnt++;
-
- do {
- /* XXX spins on EINTR */
- afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0);
- } while(afs_pag_sleep(acred));
-
- afs_pag_sleepcnt--;
- }
-
- return 0;
+
+ return 0;
}
int
#if defined(AFS_SUN5_ENV)
struct AFS_UCRED **acred = *credpp;
#elif defined(AFS_OBSD_ENV)
- struct AFS_UCRED **acred = p->p_ucred;
+ struct AFS_UCRED **acred = &p->p_ucred;
#else
struct AFS_UCRED **acred = NULL;
#endif
code = AddPag(genpag(), &credp);
crfree(credp);
}
+#elif defined(AFS_DARWIN80_ENV)
+ {
+ struct ucred *credp = kauth_cred_dup(proc_ucred(p));
+ code = AddPag(p, genpag(), &credp);
+ kauth_cred_rele(credp);
+ }
#elif defined(AFS_DARWIN_ENV)
{
struct ucred *credp = crdup(p->p_cred->pc_ucred);
#if defined(AFS_SUN5_ENV)
struct AFS_UCRED **acred = *credp;
#elif defined(AFS_OBSD_ENV)
- struct AFS_UCRED **acred = p->p_ucred;
+ struct AFS_UCRED **acred = &p->p_ucred;
#else
struct AFS_UCRED **acred = NULL;
#endif