dovecot: Don't clone a map when expunging if all messages were a...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jul 2 23:53:28 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/cff069467884
changeset: 5868:cff069467884
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jul 02 23:53:22 2007 +0300
description:
Don't clone a map when expunging if all messages were already expunged.

diffstat:

1 file changed, 1 insertion(+), 7 deletions(-)
src/lib-index/mail-index-sync-update.c |    8 +-------

diffs (25 lines):

diff -r 1b70ae186611 -r cff069467884 src/lib-index/mail-index-sync-update.c
--- a/src/lib-index/mail-index-sync-update.c	Mon Jul 02 23:46:22 2007 +0300
+++ b/src/lib-index/mail-index-sync-update.c	Mon Jul 02 23:53:22 2007 +0300
@@ -220,13 +220,6 @@ sync_expunge(const struct mail_transacti
 	uint32_t seq_count, seq, seq1, seq2;
 	unsigned int i;
 
-	/* we don't ever want to move around data inside a memory mapped file.
-	   it gets corrupted too easily if we crash in the middle. */
-	// FIXME: it's necessary for current view code that we get atomic
-	// map even if these messages are already expunged, because the
-	// view code doesn't check that and our index_int_offset goes wrong
-	map = mail_index_sync_get_atomic_map(ctx);
-
 	for (i = 0; i < count; i++, e++) {
 		if (mail_index_lookup_uid_range(ctx->view, e->uid1, e->uid2,
 						&seq1, &seq2) < 0)
@@ -236,6 +229,7 @@ sync_expunge(const struct mail_transacti
 			continue;
 		}
 
+		map = mail_index_sync_get_atomic_map(ctx);
 		for (seq = seq1; seq <= seq2; seq++) {
 			rec = MAIL_INDEX_MAP_IDX(map, seq-1);
 			mail_index_sync_header_update_counts(ctx,


More information about the dovecot-cvs mailing list