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))
* #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 */
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;
}
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 */