mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 18:54:13 +08:00
mdbx: refine page_flush().
Change-Id: I8270226e4eae721404dbb56d5d591bceaa4613b9
This commit is contained in:
parent
7f9502fbfe
commit
edbdb682d5
@ -6595,11 +6595,15 @@ __hot static int mdbx_page_flush(MDBX_txn *txn, const unsigned keep) {
|
|||||||
mdbx_tassert(txn, dp->mp_flags & P_DIRTY);
|
mdbx_tassert(txn, dp->mp_flags & P_DIRTY);
|
||||||
|
|
||||||
/* Don't flush this page yet */
|
/* Don't flush this page yet */
|
||||||
if (dp->mp_flags & (P_LOOSE | P_KEEP)) {
|
if (dp->mp_flags & P_KEEP) {
|
||||||
dp->mp_flags &= ~P_KEEP;
|
dp->mp_flags &= ~P_KEEP;
|
||||||
dl[++w] = dl[r];
|
dl[++w] = dl[r];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (dp->mp_flags & P_LOOSE) {
|
||||||
|
dl[++w] = dl[r];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const unsigned npages = IS_OVERFLOW(dp) ? dp->mp_pages : 1;
|
const unsigned npages = IS_OVERFLOW(dp) ? dp->mp_pages : 1;
|
||||||
flush_begin = (flush_begin < dp->mp_pgno) ? flush_begin : dp->mp_pgno;
|
flush_begin = (flush_begin < dp->mp_pgno) ? flush_begin : dp->mp_pgno;
|
||||||
@ -7671,7 +7675,7 @@ static int mdbx_sync_locked(MDBX_env *env, unsigned flags,
|
|||||||
if (unlikely(rc != MDBX_SUCCESS))
|
if (unlikely(rc != MDBX_SUCCESS))
|
||||||
goto fail;
|
goto fail;
|
||||||
#endif /* MacOS */
|
#endif /* MacOS */
|
||||||
*env->me_meta_sync_txnid = (uint32_t)pending->mm_txnid_a.inconsistent;
|
*env->me_meta_sync_txnid = pending->mm_txnid_a.low;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -7697,7 +7701,7 @@ static int mdbx_sync_locked(MDBX_env *env, unsigned flags,
|
|||||||
if (rc != MDBX_SUCCESS)
|
if (rc != MDBX_SUCCESS)
|
||||||
goto undo;
|
goto undo;
|
||||||
}
|
}
|
||||||
*env->me_meta_sync_txnid = (uint32_t)pending->mm_txnid_a.inconsistent;
|
*env->me_meta_sync_txnid = pending->mm_txnid_a.low;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user