tdb->methods = tdb->transaction->io_methods;
tdb_transaction_unlock(tdb, F_WRLCK);
- tdb_unlock_expand(tdb, F_WRLCK);
if (tdb_has_open_lock(tdb))
tdb_unlock_open(tdb);
goto fail_allrecord_lock;
}
- if (tdb_lock_expand(tdb, F_WRLCK) != 0) {
- goto fail_expand_lock;
- }
-
/* make sure we know about any file expansions already done by
anyone else */
tdb->methods->oob(tdb, tdb->map_size + 1, true);
tdb->methods = &transaction_methods;
return 0;
-fail_expand_lock:
- tdb_allrecord_unlock(tdb, F_RDLCK);
fail_allrecord_lock:
tdb_transaction_unlock(tdb, F_WRLCK);
SAFE_FREE(tdb->transaction->blocks);
return -1;
}
+ /* Since we have whole db locked, we don't need the expansion lock. */
if (!(tdb->flags & TDB_NOSYNC)) {
/* write the recovery data to the end of the file */
if (transaction_setup_recovery(tdb, &tdb->transaction->magic_offset) == -1) {