1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/ctdb/lib
Rusty Russell ce635cef5b tdb: tdb_allrecord_lock/tdb_allrecord_unlock/tdb_allrecord_upgrade
Centralize locking of all chains of the tdb; rename _tdb_lockall to
tdb_allrecord_lock and _tdb_unlockall to tdb_allrecord_unlock, and
tdb_brlock_upgrade to tdb_allrecord_upgrade.

Then we use this in the transaction code.  Unfortunately, if the transaction
code records that it has grabbed the allrecord lock read-only, write locks
will fail, so we treat this upgradable lock as a write lock, and mark it
as upgradable using the otherwise-unused offset field.

One subtlety: now the transaction code is using the allrecord_lock, the
tdb_release_extra_locks() function drops it for us, so we no longer need
to do it manually in _tdb_transaction_cancel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

(Imported from commit fca1621965)

(This used to be ctdb commit d7fdb38ac05b5f2af9eb485e98673280835273dd)
2010-04-22 13:54:05 +09:30
..
events lib/events: finish "Run only one event for each epoll_wait/select call" 2010-01-20 09:44:35 +01:00
popt enabled built in popt if system doesn't have it 2007-05-03 05:21:14 +10:00
replace Correction of spelling errors. 2010-02-24 23:22:00 +11:00
talloc Import "talloc_array_length" from upstream talloc 2009-12-12 00:45:39 +01:00
tdb tdb: tdb_allrecord_lock/tdb_allrecord_unlock/tdb_allrecord_upgrade 2010-04-22 13:54:05 +09:30
util ctdb: migrate to new dlinklist.h from Samba 2010-02-09 09:20:55 +11:00