ubik: remove unused UBIK_PAUSE code

This code has never been enabled, and is apparently not needed,
so remove it to simplify maintenance and future changes.

Change-Id: I7ff589e6bf1934aa0ae378ce550c8b69c508d171
Reviewed-on: http://gerrit.openafs.org/4139
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Marc Dionne 2011-01-19 21:25:21 -05:00 committed by Derrick Brashear
parent 4bd0f17e6d
commit 5b614c6cb0
7 changed files with 2 additions and 114 deletions

View File

@ -446,9 +446,6 @@ ubeacon_Interact(void *dummy)
ttid.counter = ubik_dbase->writeTidCounter;
} else
ttid.counter = ubik_dbase->tidCounter + 1;
#if defined(UBIK_PAUSE)
ubik_dbase->flags |= DBVOTING;
#endif /* UBIK_PAUSE */
/* now analyze return codes, counting up our votes */
yesVotes = 0; /* count how many to ensure we have quorum */
@ -519,9 +516,6 @@ ubeacon_Interact(void *dummy)
if (i < oldestYesVote)
oldestYesVote = i;
}
#if defined(UBIK_PAUSE)
ubik_dbase->flags &= ~DBVOTING;
#endif /* UBIK_PAUSE */
/* now decide if we have enough votes to become sync site.
* Note that we can still get enough votes even if we didn't for ourself. */

View File

@ -1000,19 +1000,6 @@ udisk_end(struct ubik_trans *atrans)
{
struct ubik_dbase *dbase;
#if defined(UBIK_PAUSE)
/* Another thread is trying to lock this transaction.
* That can only be an RPC doing SDISK_Lock.
* Unlock the transaction, 'cause otherwise the other
* thread will never wake up. Don't free it because
* the caller will do that already.
*/
if (atrans->flags & TRSETLOCK) {
atrans->flags |= TRSTALE;
ulock_relLock(atrans);
return UINTERNAL;
}
#endif /* UBIK_PAUSE */
if (!(atrans->flags & TRDONE))
udisk_abort(atrans);
dbase = atrans->dbase;

View File

@ -107,23 +107,10 @@ ulock_getLock(struct ubik_trans *atrans, int atype, int await)
}
/* Create new lock record and add to spec'd transaction:
* #if defined(UBIK_PAUSE)
* * locktype. Before doing that, set TRSETLOCK,
* * to tell udisk_end that another thread (us) is waiting.
* #else
* * locktype. This field also tells us if the thread is
* * waiting for a lock: It will be equal to LOCKWAIT.
* #endif
* locktype. This field also tells us if the thread is
* waiting for a lock: It will be equal to LOCKWAIT.
*/
#if defined(UBIK_PAUSE)
if (atrans->flags & TRSETLOCK) {
printf("Ubik: Internal Error: TRSETLOCK already set?\n");
return EBUSY;
}
atrans->flags |= TRSETLOCK;
#else
atrans->locktype = LOCKWAIT;
#endif /* UBIK_PAUSE */
DBRELE(dbase);
if (atrans->flags & TRREADWRITE) {
/* noop; don't actually lock anything for TRREADWRITE */
@ -134,18 +121,6 @@ ulock_getLock(struct ubik_trans *atrans, int atype, int await)
}
DBHOLD(dbase);
atrans->locktype = atype;
#if defined(UBIK_PAUSE)
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->flags & TRSTALE) {
udisk_end(atrans);
return UINTERNAL;
}
#endif
#endif /* UBIK_PAUSE */
/*
*ubik_print("Ubik: DEBUG: Thread 0x%x took %s lock\n", lwp_cpptr,

View File

@ -168,13 +168,9 @@ urecovery_CheckTid(struct ubik_tid *atid, int abortalways)
|| atid->counter > ubik_currentTrans->tid.counter || abortalways) {
/* don't match, abort it */
/* If the thread is not waiting for lock - ok to end it */
#if !defined(UBIK_PAUSE)
if (ubik_currentTrans->locktype != LOCKWAIT) {
#endif /* UBIK_PAUSE */
udisk_end(ubik_currentTrans);
#if !defined(UBIK_PAUSE)
}
#endif /* UBIK_PAUSE */
ubik_currentTrans = (struct ubik_trans *)0;
}
}
@ -566,17 +562,8 @@ urecovery_Interact(void *dummy)
urecovery_state |= UBIK_RECFOUNDDB;
urecovery_state &= ~UBIK_RECSENTDB;
}
#if defined(UBIK_PAUSE)
/* it's not possible for UBIK_RECFOUNDDB not to be set here.
* However, we might have lost UBIK_RECSYNCSITE, and that
* IS important.
*/
if (!(urecovery_state & UBIK_RECSYNCSITE))
continue; /* lost sync */
#else
if (!(urecovery_state & UBIK_RECFOUNDDB))
continue; /* not ready */
#endif /* UBIK_PAUSE */
/* If we, the sync site, do not have the best db version, then
* go and get it from the server that does.
@ -709,10 +696,6 @@ urecovery_Interact(void *dummy)
#endif
DBRELE(ubik_dbase);
}
#if defined(UBIK_PAUSE)
if (!(urecovery_state & UBIK_RECSYNCSITE))
continue; /* lost sync */
#endif /* UBIK_PAUSE */
if (!(urecovery_state & UBIK_RECHAVEDB))
continue; /* not ready */

View File

@ -153,13 +153,9 @@ SDISK_ReleaseLocks(struct rx_call *rxcall, struct ubik_tid *atid)
}
/* If the thread is not waiting for lock - ok to end it */
#if !defined(UBIK_PAUSE)
if (ubik_currentTrans->locktype != LOCKWAIT) {
#endif /* UBIK_PAUSE */
udisk_end(ubik_currentTrans);
#if !defined(UBIK_PAUSE)
}
#endif /* UBIK_PAUSE */
ubik_currentTrans = (struct ubik_trans *)0;
DBRELE(dbase);
return 0;
@ -193,13 +189,9 @@ SDISK_Abort(struct rx_call *rxcall, struct ubik_tid *atid)
code = udisk_abort(ubik_currentTrans);
/* If the thread is not waiting for lock - ok to end it */
#if !defined(UBIK_PAUSE)
if (ubik_currentTrans->locktype != LOCKWAIT) {
#endif /* UBIK_PAUSE */
udisk_end(ubik_currentTrans);
#if !defined(UBIK_PAUSE)
}
#endif /* UBIK_PAUSE */
ubik_currentTrans = (struct ubik_trans *)0;
DBRELE(dbase);
return code;

View File

@ -589,9 +589,6 @@ BeginTrans(struct ubik_dbase *dbase, afs_int32 transMode,
struct ubik_trans *jt;
struct ubik_trans *tt;
afs_int32 code;
#if defined(UBIK_PAUSE)
int count;
#endif /* UBIK_PAUSE */
if (readAny > 1 && ubik_SyncWriterCacheProc == NULL) {
/* it's not safe to use ubik_BeginTransReadAnyWrite without a
@ -606,37 +603,6 @@ BeginTrans(struct ubik_dbase *dbase, afs_int32 transMode,
if ((transMode != UBIK_READTRANS) && readAny)
return UBADTYPE;
DBHOLD(dbase);
#if defined(UBIK_PAUSE)
/* if we're polling the slave sites, wait until the returns
* are all in. Otherwise, the urecovery_CheckTid call may
* glitch us.
*/
if (transMode == UBIK_WRITETRANS)
for (count = 75; dbase->flags & DBVOTING; --count) {
DBRELE(dbase);
#ifdef GRAND_PAUSE_DEBUGGING
if (count == 75)
fprintf(stderr,
"%ld: myport=%d: BeginTrans is waiting 'cause of voting conflict\n",
time(0), ntohs(ubik_callPortal));
else
#endif
if (count <= 0) {
#if 1
fprintf(stderr,
"%ld: myport=%d: BeginTrans failed because of voting conflict\n",
time(0), ntohs(ubik_callPortal));
#endif
return UNOQUORUM; /* a white lie */
}
#ifdef AFS_PTHREAD_ENV
sleep(2);
#else
IOMGR_Sleep(2);
#endif
DBHOLD(dbase);
}
#endif /* UBIK_PAUSE */
if (urecovery_AllBetter(dbase, readAny) == 0) {
DBRELE(dbase);
return UNOQUORUM;

View File

@ -22,9 +22,7 @@
/*! \name ubik_lock types */
#define LOCKREAD 1
#define LOCKWRITE 2
#if !defined(UBIK_PAUSE)
#define LOCKWAIT 3
#endif /* UBIK_PAUSE */
/*\}*/
/*! \name ubik client flags */
@ -227,19 +225,12 @@ extern int (*ubik_SyncWriterCacheProc) (void);
/*! \name ubik_dbase flags */
#define DBWRITING 1 /*!< are any write trans. in progress */
#if defined(UBIK_PAUSE)
#define DBVOTING 2 /*!< the beacon task is polling */
#endif /* UBIK_PAUSE */
/*\}*/
/*!\name ubik trans flags */
#define TRDONE 1 /*!< commit or abort done */
#define TRABORT 2 /*!< if #TRDONE, tells if aborted */
#define TRREADANY 4 /*!< read any data available in trans */
#if defined(UBIK_PAUSE)
#define TRSETLOCK 8 /*!< SetLock is using trans */
#define TRSTALE 16 /*!< udisk_end during getLock */
#endif /* UBIK_PAUSE */
#define TRCACHELOCKED 32 /*!< this trans has locked dbase->cache_lock
* (meaning, this trans has called
* ubik_CheckCache at some point */