From: Marc Dionne Date: Mon, 7 Mar 2011 18:55:19 +0000 (-0500) Subject: ubik: Document lock ordering X-Git-Tag: upstream/1.8.0_pre1^2~3897 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=1e2a0e46ea2db58c0ab4d817412303ab90be1be2;p=packages%2Fo%2Fopenafs.git ubik: Document lock ordering Document the required lock ordering for the new locks. The text is adapated from Jeffrey Hutzelman's notes. Change-Id: I72d0578f456eab133f36e00a3e99051b9a733020 Reviewed-on: http://gerrit.openafs.org/4174 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- diff --git a/src/ubik/ubik.p.h b/src/ubik/ubik.p.h index 7b4f7d67c..1d0834f2e 100644 --- a/src/ubik/ubik.p.h +++ b/src/ubik/ubik.p.h @@ -345,7 +345,18 @@ extern struct ubik_trans *ubik_currentTrans; /* current trans */ extern afs_int32 ubik_debugFlag; /* ubik debug flag */ extern int ubikPrimaryAddrOnly; /* use only primary address */ -/* this extern gives the sync site's db version, with epoch of 0 if none yet */ +/* + * Lock ordering + * + * Any of the locks may be acquired singly; when acquiring multiple locks, they + * should be acquired in the listed order: + * application cache lock (dbase->cache_lock) + * database lock DBHOLD/DBRELE + * beacon lock UBIK_BEACON_LOCK/UNLOCK + * vote lock UBIK_VOTE_LOCK/UNLOCK + * version lock UBIK_VERSION_LOCK/UNLOCK + * server address lock UBIK_ADDR_LOCK/UNLOCK + */ /*! * \brief Global beacon data. All values are protected by beacon_lock