dovecot-2.0: lib-index: Fix to transaction log read optimization.

dovecot at dovecot.org dovecot at dovecot.org
Fri Nov 5 21:04:22 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/7f8f73bed7f9
changeset: 12394:7f8f73bed7f9
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Nov 05 18:58:56 2010 +0000
description:
lib-index: Fix to transaction log read optimization.
The log wasn't always refreshed while locked when it should have.

diffstat:

 src/lib-index/mail-transaction-log-file.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r 57477db05aff -r 7f8f73bed7f9 src/lib-index/mail-transaction-log-file.c
--- a/src/lib-index/mail-transaction-log-file.c	Fri Nov 05 12:24:01 2010 +0000
+++ b/src/lib-index/mail-transaction-log-file.c	Fri Nov 05 18:58:56 2010 +0000
@@ -1564,9 +1564,6 @@
 		end_offset = file->sync_offset;
 	}
 
-	if (file->locked)
-		file->locked_sync_offset_updated = TRUE;
-
 	if (file->buffer != NULL && file->buffer_offset <= start_offset) {
 		/* see if we already have it */
 		size = buffer_get_used_size(file->buffer);
@@ -1574,6 +1571,12 @@
 			return 1;
 	}
 
+	if (file->locked) {
+		/* set this only when we've synced to end of file while locked
+		   (either end_offset=(uoff_t)-1 or we had to read anyway) */
+		file->locked_sync_offset_updated = TRUE;
+	}
+
 	if (MAIL_TRANSACTION_LOG_FILE_IN_MEMORY(file)) {
 		if (start_offset < file->buffer_offset) {
 			/* we had moved the log to memory but failed to read


More information about the dovecot-cvs mailing list