dovecot-1.2: mmap_disable=yes: Opening index always tried to rea...
dovecot at dovecot.org
dovecot at dovecot.org
Sat Dec 13 15:22:38 EET 2008
details: http://hg.dovecot.org/dovecot-1.2/rev/ca3dd777b405
changeset: 8541:ca3dd777b405
user: Timo Sirainen <tss at iki.fi>
date: Sat Dec 13 15:22:34 2008 +0200
description:
mmap_disable=yes: Opening index always tried to read it from transaction log.
This caused more disk I/O than necessary.
diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
src/lib-index/mail-index-map.c | 5 +++--
src/lib-index/mail-index-private.h | 1 +
diffs (33 lines):
diff -r 868ce575a3e6 -r ca3dd777b405 src/lib-index/mail-index-map.c
--- 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 @@ int mail_index_map(struct mail_index *in
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 @@ int mail_index_map(struct mail_index *in
}
}
+ index->initial_mapped = TRUE;
index->mapping = FALSE;
return ret;
}
diff -r 868ce575a3e6 -r ca3dd777b405 src/lib-index/mail-index-private.h
--- 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 @@ struct mail_index {
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;
More information about the dovecot-cvs
mailing list