index-rebuild.c revision 817d027593510c3ba70ad542ce0011f5f6916d1e
/* Copyright (c) 2007-2015 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. */
/* 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. */
}
}
}