[dovecot-cvs] dovecot/src/lib-index mail-cache-sync-update.c, 1.9,
1.9.2.1 mail-cache.c, 1.80, 1.80.2.1 mail-index-private.h,
1.69, 1.69.2.1 mail-index-sync-update.c, 1.96.2.1,
1.96.2.2 mail-index-sync.c, 1.72.2.1, 1.72.2.2 mail-index.c,
1.230.2.2, 1.230.2.3
cras at dovecot.org
cras at dovecot.org
Mon May 29 00:18:30 EEST 2006
Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv15505
Modified Files:
Tag: branch_1_0
mail-cache-sync-update.c mail-cache.c mail-index-private.h
mail-index-sync-update.c mail-index-sync.c mail-index.c
Log Message:
We were updating index->map also when syncing views.
Index: mail-cache-sync-update.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-sync-update.c,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -d -r1.9 -r1.9.2.1
--- mail-cache-sync-update.c 30 Sep 2005 18:46:30 -0000 1.9
+++ mail-cache-sync-update.c 28 May 2006 21:18:27 -0000 1.9.2.1
@@ -124,7 +124,7 @@
}
if (*old_cache_offset == 0 ||
- sync_ctx->type != MAIL_INDEX_SYNC_HANDLER_INDEX)
+ sync_ctx->type != MAIL_INDEX_SYNC_HANDLER_FILE)
return 1;
/* we'll need to link the old and new cache records */
Index: mail-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache.c,v
retrieving revision 1.80
retrieving revision 1.80.2.1
diff -u -d -r1.80 -r1.80.2.1
--- mail-cache.c 3 May 2006 20:07:13 -0000 1.80
+++ mail-cache.c 28 May 2006 21:18:27 -0000 1.80.2.1
@@ -304,7 +304,8 @@
mail_cache_expunge_handler);
mail_index_register_sync_handler(index, cache->ext_id,
mail_cache_sync_handler,
- MAIL_INDEX_SYNC_HANDLER_INDEX |
+ MAIL_INDEX_SYNC_HANDLER_FILE |
+ MAIL_INDEX_SYNC_HANDLER_HEAD |
(cache->file_cache == NULL ? 0 :
MAIL_INDEX_SYNC_HANDLER_VIEW));
Index: mail-index-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-private.h,v
retrieving revision 1.69
retrieving revision 1.69.2.1
diff -u -d -r1.69 -r1.69.2.1
--- mail-index-private.h 2 May 2006 22:06:32 -0000 1.69
+++ mail-index-private.h 28 May 2006 21:18:27 -0000 1.69.2.1
@@ -76,8 +76,9 @@
};
enum mail_index_sync_handler_type {
- MAIL_INDEX_SYNC_HANDLER_INDEX = 0x01,
- MAIL_INDEX_SYNC_HANDLER_VIEW = 0x02
+ MAIL_INDEX_SYNC_HANDLER_FILE = 0x01,
+ MAIL_INDEX_SYNC_HANDLER_HEAD = 0x02,
+ MAIL_INDEX_SYNC_HANDLER_VIEW = 0x04
};
struct mail_index_sync_handler {
Index: mail-index-sync-update.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync-update.c,v
retrieving revision 1.96.2.1
retrieving revision 1.96.2.2
diff -u -d -r1.96.2.1 -r1.96.2.2
--- mail-index-sync-update.c 18 May 2006 10:08:56 -0000 1.96.2.1
+++ mail-index-sync-update.c 28 May 2006 21:18:27 -0000 1.96.2.2
@@ -23,13 +23,17 @@
mail_index_unmap(view->index, &view->map);
view->map = map;
view->map->refcount++;
- mail_index_unmap(view->index, &view->index->map);
- view->index->map = map;
- view->index->hdr = &map->hdr;
- if (ctx->type == MAIL_INDEX_SYNC_HANDLER_INDEX) {
- map->write_to_disk = TRUE;
- map->write_atomic = TRUE;
+ if ((ctx->type & (MAIL_INDEX_SYNC_HANDLER_FILE |
+ MAIL_INDEX_SYNC_HANDLER_HEAD)) != 0) {
+ mail_index_unmap(view->index, &view->index->map);
+ view->index->map = map;
+ view->index->hdr = &map->hdr;
+
+ if (ctx->type == MAIL_INDEX_SYNC_HANDLER_FILE) {
+ map->write_to_disk = TRUE;
+ map->write_atomic = TRUE;
+ }
}
i_assert(view->hdr.messages_count == map->hdr.messages_count);
@@ -158,12 +162,12 @@
if (seq1 == 0)
return 1;
- /* don't call expunge handlers if we're syncing view */
- if (ctx->type != MAIL_INDEX_SYNC_HANDLER_VIEW &&
+ /* call expunge handlers only when syncing index file */
+ if (ctx->type == MAIL_INDEX_SYNC_HANDLER_FILE &&
!ctx->expunge_handlers_set)
mail_index_sync_init_expunge_handlers(ctx);
- if (ctx->type != MAIL_INDEX_SYNC_HANDLER_VIEW &&
+ if (ctx->type == MAIL_INDEX_SYNC_HANDLER_FILE &&
array_is_created(&ctx->expunge_handlers)) {
expunge_handlers = array_get(&ctx->expunge_handlers,
&expunge_handlers_count);
@@ -655,7 +659,7 @@
bool had_dirty, skipped, check_ext_offsets;
mail_index_sync_map_init(&sync_map_ctx, view,
- MAIL_INDEX_SYNC_HANDLER_INDEX);
+ MAIL_INDEX_SYNC_HANDLER_FILE);
/* we'll have to update view->lock_id to avoid mail_index_view_lock()
trying to update the file later. */
Index: mail-index-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync.c,v
retrieving revision 1.72.2.1
retrieving revision 1.72.2.2
diff -u -d -r1.72.2.1 -r1.72.2.2
--- mail-index-sync.c 18 May 2006 10:08:56 -0000 1.72.2.1
+++ mail-index-sync.c 28 May 2006 21:18:27 -0000 1.72.2.2
@@ -745,7 +745,7 @@
va_start(va, fmt);
t_push();
error = t_strdup_vprintf(fmt, va);
- if (ctx->type == MAIL_INDEX_SYNC_HANDLER_INDEX) {
+ if (ctx->type == MAIL_INDEX_SYNC_HANDLER_FILE) {
mail_transaction_log_view_set_corrupted(ctx->view->log_view,
"%s", error);
} else {
Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.230.2.2
retrieving revision 1.230.2.3
diff -u -d -r1.230.2.2 -r1.230.2.3
--- mail-index.c 18 May 2006 09:57:18 -0000 1.230.2.2
+++ mail-index.c 28 May 2006 21:18:27 -0000 1.230.2.3
@@ -863,7 +863,7 @@
view = mail_index_view_open(index);
mail_index_sync_map_init(&sync_map_ctx, view,
- MAIL_INDEX_SYNC_HANDLER_VIEW);
+ MAIL_INDEX_SYNC_HANDLER_HEAD);
check_ext_offsets = TRUE; broken = FALSE;
while ((ret = mail_transaction_log_view_next(log_view, &thdr, &tdata,
More information about the dovecot-cvs
mailing list