tdb: suppress record write locks when allrecord lock is taken.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 22 Apr 2010 04:24:05 +0000 (13:54 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 22 Apr 2010 04:24:05 +0000 (13:54 +0930)
commit7a99cdf5d0a91764a750c1a264e90e5b66f910a1
tree1608ba889b6e48980d1628be45aad9a269ac4238
parent46f2c33357c999c31a8064c159c6162269c28d9d
tdb: suppress record write locks when allrecord lock is taken.

Records themselves get (read) locked by the traversal code against delete.
Interestingly, this locking isn't done when the allrecord lock has been
taken, though the allrecord lock until recently didn't cover the actual
records (it now goes to end of file).

The write record lock, grabbed by the delete code, is not suppressed
by the allrecord lock.  This is now bad: it causes us to punch a hole
in the allrecord lock when we release the write record lock.  Make this
consistent: *no* record locks of any kind when the allrecord lock is
taken.

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