changeset 4312:2cb75f2e25c6 HEAD

Keep track of write_atomic and write_seq_first/last while copying memory mappings. This is important with mmap_disable=yes because the maps can later be written to index file, and if this information is wrong the file is being updated wrong..
author Timo Sirainen <tss@iki.fi>
date Thu, 08 Jun 2006 19:52:15 +0300
parents d593e3094256
children d301901c20a5
files src/lib-index/mail-index.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index.c	Thu Jun 08 19:51:11 2006 +0300
+++ b/src/lib-index/mail-index.c	Thu Jun 08 19:52:15 2006 +0300
@@ -1184,6 +1184,15 @@
 	mem_map->hdr = *hdr;
 	mem_map->hdr_base = hdr;
 
+	/* if we're syncing transaction log into memory and later use the
+	   mapping for updating the index, we need to remember what has
+	   changed */
+	mem_map->write_atomic = map->write_atomic;
+	if (map->write_to_disk) {
+		mem_map->write_seq_first = map->write_seq_first;
+		mem_map->write_seq_last = map->write_seq_last;
+	}
+
 	/* copy extensions */
 	if (array_is_created(&map->ext_id_map)) {
 		count = array_count(&map->ext_id_map);