[dovecot-cvs] dovecot/src/lib-index mail-index.c,1.230,1.230.2.1

cras at dovecot.org cras at dovecot.org
Wed May 10 18:11:40 EEST 2006


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

Modified Files:
      Tag: branch_1_0
	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.230
retrieving revision 1.230.2.1
diff -u -d -r1.230 -r1.230.2.1
--- mail-index.c	2 May 2006 11:04:30 -0000	1.230
+++ mail-index.c	10 May 2006 15:11:37 -0000	1.230.2.1
@@ -1181,6 +1181,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