struct mail_index_view *view;
struct mail_transaction_log_view *log_view;
struct mail_index_map_modseq *mmap;
-
- uint64_t highest_modseq;
};
void mail_index_modseq_init(struct mail_index *index)
&ext_map_idx))
return;
- if (modseq > ctx->highest_modseq)
- ctx->highest_modseq = modseq;
-
ext = array_idx(&ctx->view->map->extensions, ext_map_idx);
for (; seq1 <= seq2; seq1++) {
rec = MAIL_INDEX_REC_AT_SEQ(ctx->view->map, seq1);
buffer_t uid_buf;
unsigned int i, count;
uint32_t seq1, seq2;
- uint64_t modseq;
switch (thdr->type & MAIL_TRANSACTION_TYPE_MASK) {
case MAIL_TRANSACTION_APPEND: {
return;
}
- /* update highestmodseq regardless of whether any mails were updated */
- modseq = mail_transaction_log_view_get_prev_modseq(ctx->log_view);
- if (modseq > ctx->highest_modseq)
- ctx->highest_modseq = modseq;
-
/* update modseqs */
count = array_is_created(&uids) ? array_count(&uids) : 0;
for (i = 0; i < count; i++) {
/* get the current highest_modseq. don't change any modseq below it. */
hdr = CONST_PTR_OFFSET(map->hdr_base, ext->hdr_offset);
- ctx->highest_modseq = hdr->highest_modseq;
/* Scan logs for updates between ext_hdr.log_* .. view position.
There are two reasons why there could be any:
uint32_t seq1, uint32_t seq2)
{
struct metadata_modseqs *metadata;
- uint64_t modseq;
if (ctx->mmap == NULL)
return;
if (array_is_created(&metadata->modseqs))
array_delete(&metadata->modseqs, seq1, seq2-seq1);
}
-
- modseq = mail_transaction_log_view_get_prev_modseq(ctx->log_view);
- if (ctx->highest_modseq < modseq)
- ctx->highest_modseq = modseq;
}
static void
modseqs_idx_update(ctx, i, seq1, seq2);
}
-void mail_index_modseq_update_highest(struct mail_index_modseq_sync *ctx,
- uint64_t highest_modseq)
-{
- if (ctx->highest_modseq < highest_modseq)
- ctx->highest_modseq = highest_modseq;
-}
-
struct mail_index_map_modseq *
mail_index_map_modseq_clone(const struct mail_index_map_modseq *mmap)
{
uint32_t seq1, uint32_t seq2);
void mail_index_modseq_reset_keywords(struct mail_index_modseq_sync *ctx,
uint32_t seq1, uint32_t seq2);
-void mail_index_modseq_update_highest(struct mail_index_modseq_sync *ctx,
- uint64_t highest_modseq);
struct mail_index_map_modseq *
mail_index_map_modseq_clone(const struct mail_index_map_modseq *mmap);
struct mail_index_view *view = ctx->view;
const struct mail_transaction_modseq_update *end;
uint32_t seq;
- uint64_t min_modseq, highest_modseq = 0;
+ uint64_t min_modseq;
int ret;
end = CONST_PTR_OFFSET(u, size);
min_modseq = ((uint64_t)u->modseq_high32 << 32) |
u->modseq_low32;
- if (highest_modseq < min_modseq)
- highest_modseq = min_modseq;
ret = seq == 0 ? 1 :
mail_index_modseq_set(view, seq, min_modseq);
if (ret == 0 && sync_update_ignored_change(ctx))
view->index->sync_commit_result->ignored_modseq_changes++;
}
-
- mail_index_modseq_update_highest(ctx->modseq_ctx, highest_modseq);
return 1;
}
const struct mail_transaction_header *hdr,
const void *data)
{
- uint64_t modseq;
int ret = 0;
switch (hdr->type & MAIL_TRANSACTION_TYPE_MASK) {
case MAIL_TRANSACTION_BOUNDARY:
break;
case MAIL_TRANSACTION_ATTRIBUTE_UPDATE:
- modseq = mail_transaction_log_view_get_prev_modseq(ctx->view->log_view);
- mail_index_modseq_update_highest(ctx->modseq_ctx, modseq);
break;
default:
mail_index_sync_set_corrupted(ctx,