/* Copyright (c) 2007-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "mail-cache.h"
#include "mail-index-modseq.h"
#include "mailbox-list-private.h"
#include "mailbox-recent-flags.h"
#include "index-storage.h"
#include "index-rebuild.h"
static void
struct mail_index_view *view,
{
const void *data;
bool expunged;
}
}
static void
struct mail_index_view *view,
{
const void *data;
bool expunged;
return;
if (expunged)
return;
return;
if (!ctx->cache_used) {
/* set reset id */
}
}
}
static void
struct mail_index_view *view,
{
/* copy flags */
/* copy keywords */
/* copy modseq */
}
{
/* the message exists in the old index.
copy the metadata from it. */
/* copy the metadata from backup index. */
}
}
static void
{
/* set uidvalidity */
if (hdr->uid_validity != 0)
else
/* set next-uid */
else
next_uid = 1;
}
/* set first_recent_uid */
if (backup_hdr != NULL &&
/* set highest-modseq */
i_zero(&modseq_hdr);
}
0, &modseq_hdr, sizeof(modseq_hdr));
}
static void
{
const void *name_hdr;
&name_hdr, &name_hdr_size);
&name_hdr, &name_hdr_size);
}
if (name_hdr_size == 0)
return;
0, name_hdr, name_hdr_size);
}
struct index_rebuild_context *
struct mail_index_transaction *trans)
{
/* open cache and read the caching decisions. */
/* if backup index file exists, try to use it */
#ifndef MMAP_CONFLICTS_WRITE
#endif
UINT_MAX);
else
return ctx;
}
{
/* initialize cache file with the old field decisions */
/* FIXME: this is a bit too early. ideally we should return it
from this function and unlock only after the transaction is
committed, but it would be an API change and this rebuilding
isn't happening normally anyway. */
}
}
}