From 24755d75b0ee7170195bc26cf28bab4ffdb6f752 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 14 Dec 2012 09:24:06 +0100 Subject: [PATCH] tdb: Use tdb_lock_covered_by_allrecord_lock in tdb_unlock Reviewed-by: Rusty Russell Reviewed-by: Stefan Metzmacher --- lib/tdb/common/lock.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/tdb/common/lock.c b/lib/tdb/common/lock.c index 4d06a41b7d4..b89cb2dd32b 100644 --- a/lib/tdb/common/lock.c +++ b/lib/tdb/common/lock.c @@ -471,14 +471,8 @@ int tdb_nest_unlock(struct tdb_context *tdb, uint32_t offset, int ltype, _PUBLIC_ int tdb_unlock(struct tdb_context *tdb, int list, int ltype) { /* a global lock allows us to avoid per chain locks */ - if (tdb->allrecord_lock.count && - (ltype == tdb->allrecord_lock.ltype || ltype == F_RDLCK)) { - return 0; - } - if (tdb->allrecord_lock.count) { - tdb->ecode = TDB_ERR_LOCK; - return -1; + return tdb_lock_covered_by_allrecord_lock(tdb, ltype); } return tdb_nest_unlock(tdb, lock_offset(list), ltype, false); -- 2.11.4.GIT