From 28fb8f1e02e1a8f4f058281b41311b9846656388 Mon Sep 17 00:00:00 2001 From: Kevin Coffman Date: Fri, 8 Aug 2003 22:34:28 +0000 Subject: [PATCH] ptserver-supergroups-cleanup-20030808 FIXES 1834 last changes needed for nested pts groups --- src/ptserver/ptint.xg | 8 +++---- src/ptserver/ptserver.h | 4 ++-- src/ptserver/utils.c | 2 ++ src/ubik/lock.c | 46 ++++------------------------------------- 4 files changed, 12 insertions(+), 48 deletions(-) diff --git a/src/ptserver/ptint.xg b/src/ptserver/ptint.xg index 3a5ccabcd..0b54be165 100644 --- a/src/ptserver/ptint.xg +++ b/src/ptserver/ptint.xg @@ -237,10 +237,10 @@ ListEntries( OUT afs_int32 *nextstartindex ) = 521; -#if defined(SUPERGROUPS) +/* #if defined(SUPERGROUPS) */ ListSuperGroups( - IN long id, + IN afs_int32 id, OUT prlist *elist, - OUT long *over + OUT afs_int32 *over ) = 530; -#endif +/* #endif */ diff --git a/src/ptserver/ptserver.h b/src/ptserver/ptserver.h index 80d866c9e..2e777ab96 100644 --- a/src/ptserver/ptserver.h +++ b/src/ptserver/ptserver.h @@ -51,12 +51,12 @@ struct prheader { extern struct prheader cheader; #define set_header_word(tt,field,value) \ - pr_Write ((tt), 0, ((char *)&(cheader.field) - (char *)&cheader), \ + pr_Write ((tt), 0, (afs_int32)((char *)&(cheader.field) - (char *)&cheader), \ ((cheader.field = (value)), (char *)&(cheader.field)), \ sizeof(afs_int32)) #define inc_header_word(tt,field,inc) \ - pr_Write ((tt), 0, ((char *)&(cheader.field) - (char *)&cheader), \ + pr_Write ((tt), 0, (afs_int32)((char *)&(cheader.field) - (char *)&cheader), \ ((cheader.field = (htonl(ntohl(cheader.field)+(inc)))), \ (char *)&(cheader.field)), \ sizeof(afs_int32)) diff --git a/src/ptserver/utils.c b/src/ptserver/utils.c index 8652c98df..886d39cac 100644 --- a/src/ptserver/utils.c +++ b/src/ptserver/utils.c @@ -35,6 +35,8 @@ RCSID #if defined(SUPERGROUPS) extern afs_int32 depthsg; +afs_int32 IsAMemberOfSG(struct ubik_trans *at, afs_int32 aid, + afs_int32 gid, afs_int32 depth); #endif afs_int32 diff --git a/src/ubik/lock.c b/src/ubik/lock.c index 55a9e585e..23d41eb5a 100644 --- a/src/ubik/lock.c +++ b/src/ubik/lock.c @@ -108,11 +108,11 @@ ulock_getLock(atrans, atype, await) * #endif */ #if defined(UBIK_PAUSE) - if (atrans->flag & TRSETLOCK) { + if (atrans->flags & TRSETLOCK) { printf("Ubik: Internal Error: TRSETLOCK already set?\n"); return EBUSY; } - atrans->flag |= TRSETLOCK; + atrans->flags |= TRSETLOCK; #else atrans->locktype = LOCKWAIT; #endif /* UBIK_PAUSE */ @@ -125,12 +125,12 @@ ulock_getLock(atrans, atype, await) DBHOLD(dbase); atrans->locktype = atype; #if defined(UBIK_PAUSE) - atrans->flag &= ~TRSETLOCK; + atrans->flags &= ~TRSETLOCK; #if 0 /* We don't do this here, because this can only happen in SDISK_Lock, * and there's already code there to catch this condition. */ - if (atrans->flag & TRSTALE) { + if (atrans->flags & TRSTALE) { udisk_end(atrans); return UINTERNAL; } @@ -178,41 +178,3 @@ ulock_Debug(aparm) aparm->anyWriteLocks = ((rwlock.excl_locked == WRITE_LOCK) ? 1 : 0); } } - -#if defined(UBIK_PAUSE) -/* Find the TID of the current write lock (or the best approximation thereof) */ -ulock_FindWLock(struct ubik_dbase *dbase, struct ubik_tid *atid) -{ - register struct ubik_lock *tl; - register struct ubik_trans *tt, *best; - - best = 0; - for (tt = dbase->activeTrans; tt; tt = tt->next) { - if (tt->type != UBIK_WRITETRANS) - continue; - if (!best || best->tid.counter > tt->tid.counter) { - best = tt; - } - for (tl = tt->activeLocks; tl; tl = tl->next) { - if (tl->type == LOCKWRITE) { - *atid = tt->tid; -#ifdef GRAND_PAUSE_DEBUGGING - ubik_print("Found real write lock tid %d.%d\n", atid->epoch, - atid->counter); -#endif - return 0; - } - } - } - /* if we get here, no locks pending, return the best guess */ - if (best) { - *atid = best->tid; -#ifdef GRAND_PAUSE_DEBUGGING - ubik_print("Found possible write transaction tid %d.%d\n", - atid->epoch, atid->counter); -#endif - return 0; - } - return EINVAL; -} -#endif /* UBIK_PAUSE */ -- 2.39.5