[dovecot-cvs] dovecot/src/lib-index mail-index.c,1.232,1.233

cras at dovecot.org cras at dovecot.org
Thu Jun 8 19:52:17 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv4702

Modified Files:
	mail-index.c 
Log Message:
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..



Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -d -r1.232 -r1.233
--- mail-index.c	30 May 2006 08:36:12 -0000	1.232
+++ mail-index.c	8 Jun 2006 16:52:15 -0000	1.233
@@ -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);



More information about the dovecot-cvs mailing list