dovecot-1.1: mmap_disable=yes: Opening index always tried to rea...

dovecot at dovecot.org dovecot at dovecot.org
Sat Dec 13 15:49:34 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/096e7d7838c8
changeset: 8044:096e7d7838c8
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 09fa46d40dc8 -r 096e7d7838c8 src/lib-index/mail-index-map.c
--- a/src/lib-index/mail-index-map.c	Sat Dec 13 14:59:39 2008 +0200
+++ b/src/lib-index/mail-index-map.c	Sat Dec 13 15:22:34 2008 +0200
@@ -926,8 +926,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 {
@@ -956,6 +956,7 @@ int mail_index_map(struct mail_index *in
 		}
 	}
 
+	index->initial_mapped = TRUE;
 	index->mapping = FALSE;
 	return ret;
 }
diff -r 09fa46d40dc8 -r 096e7d7838c8 src/lib-index/mail-index-private.h
--- a/src/lib-index/mail-index-private.h	Sat Dec 13 14:59:39 2008 +0200
+++ b/src/lib-index/mail-index-private.h	Sat Dec 13 15:22:34 2008 +0200
@@ -219,6 +219,7 @@ struct mail_index {
 	unsigned int syncing:1;
 	unsigned int need_recreate: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