From 1e2a0e46ea2db58c0ab4d817412303ab90be1be2 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Mon, 7 Mar 2011 13:55:19 -0500 Subject: [PATCH] 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 --- src/ubik/ubik.p.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 -- 2.39.5