mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:24:13 +08:00
mdbx: переименование MDBX_COMMIT_PAGES
в MDBX_AUXILARY_IOV_MAX
.
This commit is contained in:
parent
753fa13048
commit
4e95a079ee
@ -4047,15 +4047,15 @@ __cold static void kill_page(MDBX_txn *txn, MDBX_page *mp, pgno_t pgno,
|
||||
if ((txn->mt_flags & MDBX_WRITEMAP) == 0)
|
||||
osal_pwrite(env->me_lazy_fd, mp, bytes, pgno2bytes(env, pgno));
|
||||
} else {
|
||||
struct iovec iov[MDBX_COMMIT_PAGES];
|
||||
struct iovec iov[MDBX_AUXILARY_IOV_MAX];
|
||||
iov[0].iov_len = env->me_psize;
|
||||
iov[0].iov_base = (char *)env->me_pbuf + env->me_psize;
|
||||
size_t iov_off = pgno2bytes(env, pgno), n = 1;
|
||||
while (--npages) {
|
||||
iov[n] = iov[0];
|
||||
if (++n == MDBX_COMMIT_PAGES) {
|
||||
osal_pwritev(env->me_lazy_fd, iov, MDBX_COMMIT_PAGES, iov_off);
|
||||
iov_off += pgno2bytes(env, MDBX_COMMIT_PAGES);
|
||||
if (++n == MDBX_AUXILARY_IOV_MAX) {
|
||||
osal_pwritev(env->me_lazy_fd, iov, MDBX_AUXILARY_IOV_MAX, iov_off);
|
||||
iov_off += pgno2bytes(env, MDBX_AUXILARY_IOV_MAX);
|
||||
n = 0;
|
||||
}
|
||||
}
|
||||
|
@ -1579,12 +1579,12 @@ typedef struct MDBX_node {
|
||||
#error "Oops, some flags overlapped or wrong"
|
||||
#endif
|
||||
|
||||
/* max number of pages to commit in one writev() call */
|
||||
#define MDBX_COMMIT_PAGES 64
|
||||
#if defined(IOV_MAX) && IOV_MAX < MDBX_COMMIT_PAGES /* sysconf(_SC_IOV_MAX) */
|
||||
#undef MDBX_COMMIT_PAGES
|
||||
#define MDBX_COMMIT_PAGES IOV_MAX
|
||||
#endif
|
||||
/* Max length of iov-vector passed to writev() call, used for auxilary writes */
|
||||
#define MDBX_AUXILARY_IOV_MAX 64
|
||||
#if defined(IOV_MAX) && IOV_MAX < MDBX_AUXILARY_IOV_MAX
|
||||
#undef MDBX_AUXILARY_IOV_MAX
|
||||
#define MDBX_AUXILARY_IOV_MAX IOV_MAX
|
||||
#endif /* MDBX_AUXILARY_IOV_MAX */
|
||||
|
||||
/*
|
||||
* /
|
||||
|
Loading…
x
Reference in New Issue
Block a user