Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8541:ca3dd777b405 HEAD
mmap_disable=yes: Opening index always tried to read it from transaction log.
This caused more disk I/O than necessary.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 13 Dec 2008 15:22:34 +0200 |
parents | 868ce575a3e6 |
children | 4799b4fe4e45 |
files | src/lib-index/mail-index-map.c src/lib-index/mail-index-private.h |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-map.c Sat Dec 13 15:01:21 2008 +0200 +++ b/src/lib-index/mail-index-map.c Sat Dec 13 15:22:34 2008 +0200 @@ -927,8 +927,8 @@ index->map = mail_index_map_alloc(index); /* first try updating the existing mapping from transaction log. */ - if (index->map->hdr.indexid != 0 && index->indexid != 0) { - /* we're not creating the index, or opening transaction log. + if (index->initial_mapped) { + /* we're not creating/opening the index. sync this as a view from transaction log. */ ret = mail_index_sync_map(&index->map, type, FALSE); } else { @@ -957,6 +957,7 @@ } } + index->initial_mapped = TRUE; index->mapping = FALSE; return ret; }
--- a/src/lib-index/mail-index-private.h Sat Dec 13 15:01:21 2008 +0200 +++ b/src/lib-index/mail-index-private.h Sat Dec 13 15:22:34 2008 +0200 @@ -226,6 +226,7 @@ unsigned int need_recreate:1; unsigned int modseqs_enabled:1; unsigned int initial_create:1; + unsigned int initial_mapped:1; }; extern struct mail_index_module_register mail_index_module_register;