summaryrefslogtreecommitdiff
path: root/lib/tdb/common
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2010-02-24 10:45:14 +1030
committerRusty Russell <rusty@rustcorp.com.au>2010-02-24 10:45:14 +1030
commit9341f230f8968b4b18e451d15dda5ccbe7787768 (patch)
tree5172fcac92e12bbd255fdb556c9091eb85fd90bb /lib/tdb/common
parent1ab8776247f89b143b6e58f4b038ab4bcea20d3a (diff)
downloadsamba-9341f230f8968b4b18e451d15dda5ccbe7787768.tar.gz
samba-9341f230f8968b4b18e451d15dda5ccbe7787768.tar.bz2
samba-9341f230f8968b4b18e451d15dda5ccbe7787768.zip
tdb: cleanup: always grab allrecord lock to infinity.
We were previously inconsistent with our "global" lock: the transaction code grabbed it from FREELIST_TOP to end of file, and the rest of the code grabbed it from FREELIST_TOP to end of the hash chains. Change it to always grab to end of file for simplicity and so we can merge the two. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb/common')
-rw-r--r--lib/tdb/common/lock.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/tdb/common/lock.c b/lib/tdb/common/lock.c
index 73d34417e7..b1153b2e6f 100644
--- a/lib/tdb/common/lock.c
+++ b/lib/tdb/common/lock.c
@@ -449,9 +449,7 @@ static int _tdb_lockall(struct tdb_context *tdb, int ltype,
return -1;
}
- if (tdb->methods->brlock(tdb, ltype,
- FREELIST_TOP, 4*tdb->header.hash_size,
- flags)) {
+ if (tdb->methods->brlock(tdb, ltype, FREELIST_TOP, 0, flags)) {
if (flags & TDB_LOCK_WAIT) {
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_lockall failed (%s)\n", strerror(errno)));
}
@@ -486,8 +484,7 @@ static int _tdb_unlockall(struct tdb_context *tdb, int ltype, bool mark_lock)
}
if (!mark_lock &&
- tdb->methods->brunlock(tdb, ltype,
- FREELIST_TOP, 4*tdb->header.hash_size)) {
+ tdb->methods->brunlock(tdb, ltype, FREELIST_TOP, 0)) {
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_unlockall failed (%s)\n", strerror(errno)));
return -1;
}
@@ -688,8 +685,7 @@ void tdb_release_extra_locks(struct tdb_context *tdb)
unsigned int i, extra = 0;
if (tdb->allrecord_lock.count != 0) {
- tdb_brunlock(tdb, tdb->allrecord_lock.ltype,
- FREELIST_TOP, 4*tdb->header.hash_size);
+ tdb_brunlock(tdb, tdb->allrecord_lock.ltype, FREELIST_TOP, 0);
tdb->allrecord_lock.count = 0;
}