mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 22:47:16 +08:00
mdbx: rename bootid' fields to be neutral for endianess.
Change-Id: I7d52d3c2c93dcc6e886d336885070eb1aee1c284
This commit is contained in:
parent
989a7c992e
commit
12339d4e7c
2
mdbx.h
2
mdbx.h
@ -1936,7 +1936,7 @@ struct MDBX_envinfo {
|
|||||||
relevant information is available from the system. */
|
relevant information is available from the system. */
|
||||||
struct {
|
struct {
|
||||||
struct {
|
struct {
|
||||||
uint64_t l, h;
|
uint64_t x, y;
|
||||||
} current, meta0, meta1, meta2;
|
} current, meta0, meta1, meta2;
|
||||||
} mi_bootid;
|
} mi_bootid;
|
||||||
|
|
||||||
|
16
src/core.c
16
src/core.c
@ -16834,12 +16834,12 @@ int __cold mdbx_env_info_ex(const MDBX_env *env, const MDBX_txn *txn,
|
|||||||
arg->mi_meta2_txnid = mdbx_meta_txnid_fluid(env, meta2);
|
arg->mi_meta2_txnid = mdbx_meta_txnid_fluid(env, meta2);
|
||||||
arg->mi_meta2_sign = meta2->mm_datasync_sign;
|
arg->mi_meta2_sign = meta2->mm_datasync_sign;
|
||||||
if (likely(bytes > size_before_bootid)) {
|
if (likely(bytes > size_before_bootid)) {
|
||||||
arg->mi_bootid.meta0.l = meta0->mm_bootid.x;
|
arg->mi_bootid.meta0.x = meta0->mm_bootid.x;
|
||||||
arg->mi_bootid.meta1.l = meta0->mm_bootid.x;
|
arg->mi_bootid.meta1.x = meta0->mm_bootid.x;
|
||||||
arg->mi_bootid.meta2.l = meta0->mm_bootid.x;
|
arg->mi_bootid.meta2.x = meta0->mm_bootid.x;
|
||||||
arg->mi_bootid.meta0.h = meta0->mm_bootid.y;
|
arg->mi_bootid.meta0.y = meta0->mm_bootid.y;
|
||||||
arg->mi_bootid.meta1.h = meta0->mm_bootid.y;
|
arg->mi_bootid.meta1.y = meta0->mm_bootid.y;
|
||||||
arg->mi_bootid.meta2.h = meta0->mm_bootid.y;
|
arg->mi_bootid.meta2.y = meta0->mm_bootid.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MDBX_meta *txn_meta = recent_meta;
|
const MDBX_meta *txn_meta = recent_meta;
|
||||||
@ -16894,8 +16894,8 @@ int __cold mdbx_env_info_ex(const MDBX_env *env, const MDBX_txn *txn,
|
|||||||
arg->mi_autosync_threshold = pgno2bytes(env, *env->me_autosync_threshold);
|
arg->mi_autosync_threshold = pgno2bytes(env, *env->me_autosync_threshold);
|
||||||
arg->mi_autosync_period_seconds16dot16 =
|
arg->mi_autosync_period_seconds16dot16 =
|
||||||
mdbx_osal_monotime_to_16dot16(*env->me_autosync_period);
|
mdbx_osal_monotime_to_16dot16(*env->me_autosync_period);
|
||||||
arg->mi_bootid.current.l = bootid.x;
|
arg->mi_bootid.current.x = bootid.x;
|
||||||
arg->mi_bootid.current.h = bootid.y;
|
arg->mi_bootid.current.y = bootid.y;
|
||||||
arg->mi_mode = lck ? lck->mti_envmode : env->me_flags;
|
arg->mi_mode = lck ? lck->mti_envmode : env->me_flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -967,13 +967,13 @@ static int meta_steady(void) { return meta_recent(true); }
|
|||||||
|
|
||||||
static int meta_head(void) { return meta_recent(false); }
|
static int meta_head(void) { return meta_recent(false); }
|
||||||
|
|
||||||
void verbose_meta(int num, txnid_t txnid, uint64_t sign, uint64_t bootid_h,
|
void verbose_meta(int num, txnid_t txnid, uint64_t sign, uint64_t bootid_x,
|
||||||
uint64_t bootid_l) {
|
uint64_t bootid_y) {
|
||||||
print(" - meta-%d: %s %" PRIu64, num, meta_synctype(sign), txnid);
|
print(" - meta-%d: %s %" PRIu64, num, meta_synctype(sign), txnid);
|
||||||
bool stay = true;
|
bool stay = true;
|
||||||
const bool bootid_match = bootid_h == envinfo.mi_bootid.current.h &&
|
const bool bootid_match = bootid_x == envinfo.mi_bootid.current.x &&
|
||||||
bootid_l == envinfo.mi_bootid.current.l &&
|
bootid_y == envinfo.mi_bootid.current.y &&
|
||||||
(bootid_h | bootid_l) != 0;
|
(bootid_x | bootid_y) != 0;
|
||||||
|
|
||||||
const int steady = meta_steady();
|
const int steady = meta_steady();
|
||||||
const int head = meta_head();
|
const int head = meta_head();
|
||||||
@ -1368,11 +1368,11 @@ int main(int argc, char *argv[]) {
|
|||||||
envinfo.mi_recent_txnid - envinfo.mi_latter_reader_txnid);
|
envinfo.mi_recent_txnid - envinfo.mi_latter_reader_txnid);
|
||||||
|
|
||||||
verbose_meta(0, envinfo.mi_meta0_txnid, envinfo.mi_meta0_sign,
|
verbose_meta(0, envinfo.mi_meta0_txnid, envinfo.mi_meta0_sign,
|
||||||
envinfo.mi_bootid.meta0.h, envinfo.mi_bootid.meta0.l);
|
envinfo.mi_bootid.meta0.x, envinfo.mi_bootid.meta0.y);
|
||||||
verbose_meta(1, envinfo.mi_meta1_txnid, envinfo.mi_meta1_sign,
|
verbose_meta(1, envinfo.mi_meta1_txnid, envinfo.mi_meta1_sign,
|
||||||
envinfo.mi_bootid.meta1.h, envinfo.mi_bootid.meta1.l);
|
envinfo.mi_bootid.meta1.x, envinfo.mi_bootid.meta1.y);
|
||||||
verbose_meta(2, envinfo.mi_meta2_txnid, envinfo.mi_meta2_sign,
|
verbose_meta(2, envinfo.mi_meta2_txnid, envinfo.mi_meta2_sign,
|
||||||
envinfo.mi_bootid.meta2.h, envinfo.mi_bootid.meta2.l);
|
envinfo.mi_bootid.meta2.x, envinfo.mi_bootid.meta2.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose > 1)
|
if (verbose > 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user