mdbox-storage-rebuild.c revision 183aac2ac8fcd220ad4bf9809165237b1f6c7819
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen/* Copyright (c) 2009-2012 Dovecot authors, see the included COPYING file */
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen struct mdbox_map_mail_index_header orig_map_hdr;
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen ARRAY_DEFINE(msgs, struct mdbox_rebuild_msg *);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenmdbox_storage_rebuild_init(struct mdbox_storage *storage,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen ctx = i_new(struct mdbox_storage_rebuild_context, 1);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen ctx->pool = pool_alloconly_create("dbox map rebuild", 1024*256);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen ctx->guid_hash = hash_table_create(default_pool, ctx->pool, 0,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenmdbox_storage_rebuild_deinit(struct mdbox_storage_rebuild_context *ctx)
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstatic int mdbox_rebuild_msg_offset_cmp(const void *p1, const void *p2)
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen const struct mdbox_rebuild_msg *const *m1 = p1, *const *m2 = p2;
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenstatic int mdbox_rebuild_msg_uid_cmp(struct mdbox_rebuild_msg *const *m1,
const char *guid;
int ret;
prev_offset = 0;
if (ret > 0) {
if (ret == 0) {
if (prev_offset == 0) {
if (!first) {
if (ret <= 0)
ret = 0;
if (ret < 0)
bool deleted;
int ret = 0;
if (ret == 0)
unsigned int i, count;
for (i = 0; i < count; i++) {
unsigned int count;
static struct mdbox_rebuild_msg *
return TRUE;
return FALSE;
const void *data;
bool expunged;
map_uid = 0;
} T_END;
const void *data;
int ret;
if (ret <= 0) {
int ret = 0;
MAILBOX_NOSELECT)) == 0) {
T_BEGIN {
} T_END;
if (ret < 0) {
return ret;
int ret;
if (ret < 0)
if (ret <= 0) {
unsigned int i, count;
for (i = 0; i < count; i++) {
const void *data;
bool expunged;
unsigned int i, count;
struct dirent *d;
int ret = 0;
} T_END;
return ret;
const void *data;
FALSE) < 0)
int ret;
if (ret == 0) {
return ret;
int ret;
return ret;