summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-12-14 09:24:06 +0100
committerStefan Metzmacher <metze@samba.org>2012-12-21 11:56:20 +0100
commit24755d75b0ee7170195bc26cf28bab4ffdb6f752 (patch)
tree5e0b1eabf6436a0b6bf52786f73b74f62070e1d8 /lib
parentf8dafe5685008671f4f983a4defc90b4a05cf992 (diff)
downloadsamba-24755d75b0ee7170195bc26cf28bab4ffdb6f752.tar.gz
samba-24755d75b0ee7170195bc26cf28bab4ffdb6f752.tar.bz2
samba-24755d75b0ee7170195bc26cf28bab4ffdb6f752.zip
tdb: Use tdb_lock_covered_by_allrecord_lock in tdb_unlock
Reviewed-by: Rusty Russell <rusty@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/tdb/common/lock.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/tdb/common/lock.c b/lib/tdb/common/lock.c
index 4d06a41b7d..b89cb2dd32 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);