tdb: don't suppress the transaction lock because of the allrecord lock.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 22 Apr 2010 04:23:51 +0000 (13:53 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 22 Apr 2010 04:23:51 +0000 (13:53 +0930)
commit495f3554259b9dbf9ee673c4fe420d98e50e4901
tree94941fd302805ffa98a98d05a8308bbe5bafeb7b
parent28576ddbd9bf91049db8a4f9e9e7856ac5b8f48a
tdb: don't suppress the transaction lock because of the allrecord lock.

tdb_transaction_lock() and tdb_transaction_unlock() do nothing if we
hold the allrecord lock.  However, the two locks don't overlap, so
this is wrong.

This simplification makes the transaction lock a straight-forward nested
lock.

There are two callers for these functions:
1) The transaction code, which already makes sure the allrecord_lock
   isn't held.
2) The traverse code, which wants to stop transactions whether it has the
   allrecord lock or not.  There have been deadlocks here before, however
   this should not bring them back (I hope!)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from commit b754f61d235bdc3e410b60014d6be4072645e16f)
lib/tdb/common/lock.c