diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index 729725d..c32057c 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -3037,7 +3037,7 @@ mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mode_t mode) } if ((rc = mdb_env_open2(env, flags)) == MDB_SUCCESS) { - if (flags & (MDB_RDONLY|MDB_NOSYNC)) { + if (flags & (MDB_RDONLY|MDB_NOSYNC|MDB_NOMETASYNC)) { env->me_mfd = env->me_fd; } else { /* synchronous fd for meta writes */ @@ -6096,7 +6096,7 @@ mdb_put(MDB_txn *txn, MDB_dbi dbi, * at runtime. Changing other flags requires closing the environment * and re-opening it with the new flags. */ -#define CHANGEABLE (MDB_NOSYNC) +#define CHANGEABLE (MDB_NOSYNC|MDB_NOMETASYNC) int mdb_env_set_flags(MDB_env *env, unsigned int flag, int onoff) { diff --git a/libraries/libmdb/mdb.h b/libraries/libmdb/mdb.h index bcf3665..587013f 100644 --- a/libraries/libmdb/mdb.h +++ b/libraries/libmdb/mdb.h @@ -159,6 +159,8 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel #define MDB_NOSYNC 0x10000 /** read only */ #define MDB_RDONLY 0x20000 + /** don't fsync metapage after commit */ +#define MDB_NOMETASYNC 0x40000 /** @} */ /** @defgroup mdb_open Database Flags @@ -334,6 +336,13 @@ int mdb_env_create(MDB_env **env); * at risk is governed by how often the system flushes dirty buffers to disk * and how often #mdb_env_sync() is called. This flag may be changed * at any time using #mdb_env_set_flags(). + *