]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mmap_disable=yes: Opening index always tried to read it from transaction log.
authorTimo Sirainen <tss@iki.fi>
Sat, 13 Dec 2008 13:22:34 +0000 (15:22 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 13 Dec 2008 13:22:34 +0000 (15:22 +0200)
This caused more disk I/O than necessary.

--HG--
branch : HEAD

src/lib-index/mail-index-map.c
src/lib-index/mail-index-private.h

index 891d1131c67bc0772911c94908d3258a51ad95da..2e32a92f5dd3c7662ce95670c0d1e32defb47c56 100644 (file)
@@ -927,8 +927,8 @@ int mail_index_map(struct mail_index *index,
                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 *index,
                }
        }
 
+       index->initial_mapped = TRUE;
        index->mapping = FALSE;
        return ret;
 }
index aa247a99e1ede64571a0bfc5138a49280346267f..e2486180729f185d845227510cca66f06ed1d0f9 100644 (file)
@@ -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;