diff --git a/src/core.c b/src/core.c index e23bf107..f8a2b827 100644 --- a/src/core.c +++ b/src/core.c @@ -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; } } diff --git a/src/internals.h b/src/internals.h index ab748f3a..721a6131 100644 --- a/src/internals.h +++ b/src/internals.h @@ -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 */ /* * /