+ if (tdb1_lock(tdb, -1, F_WRLCK) == -1) {
+ tdb_logerr(tdb, tdb->last_error, TDB_LOG_ERROR,
+ "lock failed in tdb1_expand");
+ return -1;
+ }
+
+ /* must know about any previous expansions by another process */
+ tdb->tdb1.io->tdb1_oob(tdb, tdb->file->map_size, 1, 1);
+
+ size = tdb1_expand_adjust(tdb->file->map_size, size,
+ tdb->tdb1.page_size);
+
+ if (!(tdb->flags & TDB_INTERNAL))