[Do we want this?
Now users won't mistakenly think they have robust mutexes.
Unless another process like mdb_stat inited the lockfile with
another config. Does mdb_stat need a -R(obust) flag?
OTOH a working config on one system can now EINVAL on another,
though the user could use mdb_env_set_flags() to get the EINVAL
there instead of in mdb_env_open().]
Catch mutex_lock errors.
Prepare for next commit (robust mutexes), no change in behavior:
- Replace LOCK_MUTEX_R,... -> mdb_mutex_t, MDB_MUTEX, LOCK_MUTEX0,...
- Rename mti_mutex -> mti_rmutex, so MDB_MUTEX() can get at it.
We mainly use Win32 functions, so cannot just use C-runtime strerror
to return error messages. We have to use Win32-specific messages.
Unfortunately, we document the API to return C-runtime error codes,
so we can't just switch to all Win32 error codes.
Set read txn's dbiseqs to env's. Set child txn's dbiseqs to parent's.
Simplify DBI_CHANGED test, no need to check md_name. No-op dbi_close
of already closed handle.
'#ifdef MDB_DEVEL' -> '#if MDB_DEVEL'
Fix comments, use actual PAGEBASE macro as originally intended.
Actually enable 64K pages. Set MDB_DATA_VERSION for testing only.
mdb_txn_commit(child): Give loose pages to parent.
Use a pointer beyond the page header instead of mp_next, so
we will not need to save/restore mp_pgno. This avoids a crash
caused by references to mp_pgno.
Fix mp_lower/mp_upper to exclude PAGEHDRSZ, which means our
max mp_upper is now pagesize - PAGEHDRSZ and won't overflow.
Currently must define MDB_DEVEL to use. Will be default for
LMDB 1.0/OpenLDAP 2.5
And mdb_env_copyfd2(). Perform compaction on the copy. Trims out
freed pages and renumbers data pages in sequential order. This is
more CPU-intensive since it copies and modifies data pages.