index-rebuild.c revision 8ae72ad7d0c69e972cfa65d1e2ce4e3e9a8b765c
/* Copyright (c) 2007-2013 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 "index-storage.h"
#include "index-rebuild.h"
static void
struct mail_index_view *view,
{
struct mail_index_map *map;
const void *data;
bool expunged;
return;
if (expunged)
return;
return;
if (!ctx->cache_used) {
/* set reset id */
}
}
}
static void
struct mail_index_view *view,
{
const struct mail_index_record *rec;
struct mail_keywords *kw;
/* 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
{
struct mail_index_modseq_header modseq_hdr;
struct mail_index_view *trans_view;
/* set uidvalidity */
if (hdr->uid_validity != 0)
else
/* set next-uid */
else
next_uid = 1;
}
/* set highest-modseq */
}
0, &modseq_hdr, sizeof(modseq_hdr));
}
struct index_rebuild_context *
struct mail_index_transaction *trans)
{
struct index_rebuild_context *ctx;
const char *index_dir, *backup_path;
/* open cache and read the caching decisions. we'll reset the cache in
case it contains any invalid data, but we want to preserve the
decisions. */
/* if backup index file exists, try to use it */
&index_dir) <= 0)
i_unreached();
#ifndef MMAP_CONFLICTS_WRITE
#endif
UINT_MAX);
else
return ctx;
}
{
/* initialize cache file with the old field decisions */
}
}