ubik: Introduce new vote lock
authorMarc Dionne <marc.c.dionne@gmail.com>
Sun, 23 Jan 2011 03:17:14 +0000 (22:17 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 5 Apr 2011 18:20:07 +0000 (11:20 -0700)
commit2385d26293b9f5b3bd62b7afd5a4e9da17efe7cc
treea04e14888f0463215dbc267c8f5b2cb50fd2ef38
parent7c4fc5278e037104450d22a199a46f938aa929aa
ubik: Introduce new vote lock

Introduce a new lock to protect ubik data related to voting.
Specifically, it protects the following globals:
ubik_lastYesTime
lastYesHost
lastYesClaim
lastYesState
lowestHost
lowestTime
syncHost
syncTime
ubik_dbVersion
ubik_dbTid

Variables are grouped along with the lock in a new structure.

Also introduce a few helper functions to safely deal with ubik_dbVersion:
uvote_eq_dbVersion: Return true if the passed version is equal to the
current ubik_dbVersion
uvote_set_dbVersion: Set ubik_dbVersion to a specified value

Change-Id: I9bb248d0dfedc363181661ea723cac0af4928644
Reviewed-on: http://gerrit.openafs.org/4156
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/ubik/recovery.c
src/ubik/remote.c
src/ubik/ubik.c
src/ubik/ubik.p.h
src/ubik/vote.c