diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-02-17 12:34:26 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-02-17 12:34:26 +1030 |
commit | fba42f1fb4f81b8913cce5a23ca5350ba45f40e1 (patch) | |
tree | ede1d6f29fcb7af17af8b9010ef9247a9e397321 /lib/tdb/common/open.c | |
parent | b754f61d235bdc3e410b60014d6be4072645e16f (diff) | |
download | samba-fba42f1fb4f81b8913cce5a23ca5350ba45f40e1.tar.gz samba-fba42f1fb4f81b8913cce5a23ca5350ba45f40e1.tar.bz2 samba-fba42f1fb4f81b8913cce5a23ca5350ba45f40e1.zip |
tdb: cleanup: tdb_have_extra_locks() helper
In many places we check whether locks are held: add a helper to do this.
The _tdb_lockall() case has already checked for the allrecord lock, so
the extra work done by tdb_have_extra_locks() is merely redundant.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb/common/open.c')
-rw-r--r-- | lib/tdb/common/open.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c index 9fbd5fdea9..3fc9833863 100644 --- a/lib/tdb/common/open.c +++ b/lib/tdb/common/open.c @@ -465,7 +465,7 @@ static int tdb_reopen_internal(struct tdb_context *tdb, bool active_lock) return 0; /* Nothing to do. */ } - if (tdb->num_locks != 0 || tdb->allrecord_lock.count) { + if (tdb_have_extra_locks(tdb)) { TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_reopen: reopen not allowed with locks held\n")); goto fail; } |