From 2acd8a9b3e1bd3885c5865e4b44ac3b4d92655d3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 12 Feb 2007 23:16:02 +0000 Subject: r21303: As discussed on samba-technical: Change the static array for the in-memory mirrors of the hash chain locks to a dynamically allocated one. Jeremy, I count on you to revert it if the build farm freaks out, it's after midnight here :-) Volker (This used to be commit 7b5db2e472c7e27231fa432d3930789e708abd09) --- source4/lib/tdb/common/transaction.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source4/lib/tdb/common/transaction.c') diff --git a/source4/lib/tdb/common/transaction.c b/source4/lib/tdb/common/transaction.c index 7dff9a95e3..5c94eb0afe 100644 --- a/source4/lib/tdb/common/transaction.c +++ b/source4/lib/tdb/common/transaction.c @@ -516,12 +516,10 @@ int tdb_transaction_cancel(struct tdb_context *tdb) /* remove any locks created during the transaction */ if (tdb->num_locks != 0) { - int h; - for (h=0;hheader.hash_size+1;h++) { - if (tdb->locked[h].count != 0) { - tdb_brlock(tdb,FREELIST_TOP+4*h,F_UNLCK,F_SETLKW, 0, 1); - tdb->locked[h].count = 0; - } + int i; + for (i=0;inum_lockrecs;i++) { + tdb_brlock(tdb,FREELIST_TOP+4*tdb->lockrecs[i].list, + F_UNLCK,F_SETLKW, 0, 1); } tdb->num_locks = 0; } -- cgit