From: Howard Chu Date: Thu, 6 Sep 2012 18:17:25 +0000 (-0700) Subject: msync should default to fully synchronous X-Git-Tag: OPENLDAP_REL_ENG_2_4_33~24^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2e677bcb995b63d36461eea254f2134ebfe29da2;p=openldap msync should default to fully synchronous --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index d44b1ec191..e13f8615c2 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -1478,7 +1478,7 @@ mdb_env_sync(MDB_env *env, int force) int rc = 0; if (force || !F_ISSET(env->me_flags, MDB_NOSYNC)) { if (env->me_flags & MDB_WRITEMAP) { - int flags = (env->me_flags & MDB_MAPSYNC) ? MS_SYNC : MS_ASYNC; + int flags = (env->me_flags & MDB_MAPASYNC) ? MS_ASYNC : MS_SYNC; if (MDB_MSYNC(env->me_map, env->me_mapsize, flags)) rc = ErrCode(); #ifdef _WIN32 @@ -2383,7 +2383,7 @@ mdb_env_write_meta(MDB_txn *txn) mp->mm_last_pg = txn->mt_next_pgno - 1; mp->mm_txnid = txn->mt_txnid; if (!(env->me_flags & (MDB_NOMETASYNC|MDB_NOSYNC))) { - rc = (env->me_flags & MDB_MAPSYNC) ? MS_SYNC : MS_ASYNC; + rc = (env->me_flags & MDB_MAPASYNC) ? MS_ASYNC : MS_SYNC; ptr = env->me_map; if (toggle) ptr += env->me_psize; diff --git a/libraries/libmdb/mdb.h b/libraries/libmdb/mdb.h index 8eefc7d516..4430c58622 100644 --- a/libraries/libmdb/mdb.h +++ b/libraries/libmdb/mdb.h @@ -163,8 +163,8 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel #define MDB_NOMETASYNC 0x40000 /** use writable mmap */ #define MDB_WRITEMAP 0x80000 - /** use synchronous msync */ -#define MDB_MAPSYNC 0x100000 + /** use asynchronous msync */ +#define MDB_MAPASYNC 0x100000 /** @} */ /** @defgroup mdb_open Database Flags