]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb/open.c
tdb: cleanup: tdb_release_extra_locks() helper
[ccan] / ccan / tdb / open.c
index 9a3457bc47555960ec0dce4b8665e3b242dfa446..b7aa6e745e0aa388b6162b63952137be3a047b2f 100644 (file)
@@ -461,7 +461,7 @@ static int tdb_reopen_internal(struct tdb_context *tdb, bool active_lock)
                return 0; /* Nothing to do. */
        }
 
-       if (tdb->num_locks != 0 || tdb->global_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;
        }