dovecot-1.3: dbox: Fix to auto-purging.

dovecot at dovecot.org dovecot at dovecot.org
Sat Apr 11 01:27:07 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.3/rev/b7142ab35480
changeset: 9068:b7142ab35480
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Apr 10 18:27:02 2009 -0400
description:
dbox: Fix to auto-purging.

diffstat:

3 files changed, 8 insertions(+), 3 deletions(-)
src/lib-storage/index/dbox/dbox-save.c |    3 ++-
src/lib-storage/index/dbox/dbox-sync.c |    4 +++-
src/lib-storage/index/dbox/dbox-sync.h |    4 +++-

diffs (55 lines):

diff -r 53885f710b0b -r b7142ab35480 src/lib-storage/index/dbox/dbox-save.c
--- a/src/lib-storage/index/dbox/dbox-save.c	Fri Apr 10 14:47:27 2009 -0400
+++ b/src/lib-storage/index/dbox/dbox-save.c	Fri Apr 10 18:27:02 2009 -0400
@@ -353,7 +353,8 @@ int dbox_transaction_save_commit_pre(str
 	i_assert(ctx->finished);
 
 	/* lock the mailbox before map to avoid deadlocks */
-	if (dbox_sync_begin(ctx->mbox, DBOX_SYNC_FLAG_FORCE |
+	if (dbox_sync_begin(ctx->mbox, DBOX_SYNC_FLAG_NO_PURGE |
+			    DBOX_SYNC_FLAG_FORCE |
 			    DBOX_SYNC_FLAG_FSYNC, &ctx->sync_ctx) < 0) {
 		dbox_transaction_save_rollback(ctx);
 		return -1;
diff -r 53885f710b0b -r b7142ab35480 src/lib-storage/index/dbox/dbox-sync.c
--- a/src/lib-storage/index/dbox/dbox-sync.c	Fri Apr 10 14:47:27 2009 -0400
+++ b/src/lib-storage/index/dbox/dbox-sync.c	Fri Apr 10 18:27:02 2009 -0400
@@ -169,7 +169,8 @@ static int dbox_sync_index(struct dbox_s
 			   that's why we do this calculation before current
 			   sync: the purging is triggered only after the
 			   second expunge. */
-			if (dbox_map_want_purge(ctx->mbox->storage->map))
+			if ((ctx->flags & DBOX_SYNC_FLAG_NO_PURGE) == 0 &&
+			    dbox_map_want_purge(ctx->mbox->storage->map))
 				ctx->purge = TRUE;
 		}
 
@@ -243,6 +244,7 @@ int dbox_sync_begin(struct dbox_mailbox 
 
 	ctx = i_new(struct dbox_sync_context, 1);
 	ctx->mbox = mbox;
+	ctx->flags = flags;
 
 	if (!mbox->ibox.keep_recent)
 		sync_flags |= MAIL_INDEX_SYNC_FLAG_DROP_RECENT;
diff -r 53885f710b0b -r b7142ab35480 src/lib-storage/index/dbox/dbox-sync.h
--- a/src/lib-storage/index/dbox/dbox-sync.h	Fri Apr 10 14:47:27 2009 -0400
+++ b/src/lib-storage/index/dbox/dbox-sync.h	Fri Apr 10 18:27:02 2009 -0400
@@ -7,7 +7,8 @@ enum dbox_sync_flags {
 enum dbox_sync_flags {
 	DBOX_SYNC_FLAG_FORCE		= 0x01,
 	DBOX_SYNC_FLAG_FSYNC		= 0x02,
-	DBOX_SYNC_FLAG_FORCE_REBUILD	= 0x04
+	DBOX_SYNC_FLAG_FORCE_REBUILD	= 0x04,
+	DBOX_SYNC_FLAG_NO_PURGE		= 0x08
 };
 
 struct dbox_sync_file_entry {
@@ -25,6 +26,7 @@ struct dbox_sync_context {
 	struct mail_index_view *sync_view;
 	struct mail_index_transaction *trans;
 	struct dbox_map_transaction_context *map_trans;
+	enum dbox_sync_flags flags;
 
 	string_t *path;
 	unsigned int path_dir_prefix_len;


More information about the dovecot-cvs mailing list