This especially improves dsync performance with mdbox.
struct mdbox_index_header hdr;
const void *data;
uint32_t uid, cur_map_uid_validity;
- bool expunged;
- mail_index_lookup_ext(view, seq, mbox->ext_id, &data, &expunged);
+ mail_index_lookup_ext(view, seq, mbox->ext_id, &data, NULL);
dbox_rec = data;
if (dbox_rec == NULL || dbox_rec->map_uid == 0) {
mail_index_lookup_uid(view, seq, &uid);
(struct mdbox_mailbox *)mail->transaction->box;
const struct mdbox_mail_index_record *dbox_rec;
const void *data;
- bool expunged;
mail_index_lookup_ext(mail->transaction->view, mail->seq,
- mbox->ext_id, &data, &expunged);
+ mbox->ext_id, &data, NULL);
dbox_rec = data;
if (dbox_rec == NULL || dbox_rec->map_uid == 0) {
/* lost for some reason, use fallback */
const struct mdbox_map_mail_index_record *rec;
const void *data;
uint32_t uid;
- bool expunged;
- mail_index_lookup_ext(map->view, seq, map->map_ext_id,
- &data, &expunged);
+ mail_index_lookup_ext(map->view, seq, map->map_ext_id, &data, NULL);
rec = data;
if (rec == NULL || rec->file_id == 0) {
const uint16_t *ref16_p;
const void *data;
uint32_t seq;
- bool expunged;
int ret;
if (mdbox_map_open_or_create(map) < 0)
return -1;
*rec_r = *rec;
- mail_index_lookup_ext(map->view, seq, map->ref_ext_id,
- &data, &expunged);
+ mail_index_lookup_ext(map->view, seq, map->ref_ext_id, &data, NULL);
if (data == NULL) {
mdbox_map_set_corrupted(map, "missing ref extension");
return -1;
{
const uint16_t *ref16_p;
const void *data;
- bool expunged;
memset(rec_r, 0, sizeof(*rec_r));
mail_index_lookup_uid(view, seq, &rec_r->map_uid);
- mail_index_lookup_ext(view, seq, map->map_ext_id, &data, &expunged);
+ mail_index_lookup_ext(view, seq, map->map_ext_id, &data, NULL);
if (data == NULL) {
mdbox_map_set_corrupted(map, "missing map extension");
return -1;
}
memcpy(&rec_r->rec, data, sizeof(rec_r->rec));
- mail_index_lookup_ext(view, seq, map->ref_ext_id, &data, &expunged);
+ mail_index_lookup_ext(view, seq, map->ref_ext_id, &data, NULL);
if (data == NULL) {
mdbox_map_set_corrupted(map, "missing ref extension");
return -1;
struct mdbox_map *map = ctx->atomic->map;
const void *data;
uint32_t seq;
- bool expunged;
int old_diff, new_diff;
if (unlikely(ctx->trans == NULL))
}
return -1;
}
- mail_index_lookup_ext(map->view, seq, map->ref_ext_id,
- &data, &expunged);
+ mail_index_lookup_ext(map->view, seq, map->ref_ext_id, &data, NULL);
old_diff = data == NULL ? 0 : *((const uint16_t *)data);
ctx->changed = TRUE;
new_diff = mail_index_atomic_inc_ext(ctx->trans, seq,
const struct mail_index_header *hdr;
const struct mdbox_map_mail_index_record *rec;
const void *data;
- bool expunged;
uint32_t seq;
int ret = 0;
hdr = mail_index_get_header(map->view);
for (seq = 1; seq <= hdr->messages_count; seq++) {
mail_index_lookup_ext(map->view, seq, map->map_ext_id,
- &data, &expunged);
+ &data, NULL);
if (data == NULL) {
mdbox_map_set_corrupted(map, "missing map extension");
ret = -1;
(struct mdbox_save_context *)t->save_ctx;
const struct mdbox_mail_index_record *rec;
const void *data;
- bool expunged;
uint32_t file_id;
- mail_index_lookup_ext(t->view, seq, ctx->mbox->ext_id,
- &data, &expunged);
+ mail_index_lookup_ext(t->view, seq, ctx->mbox->ext_id, &data, NULL);
rec = data;
if (mdbox_map_lookup(ctx->mbox->storage->map, rec->map_uid,
const struct dbox_save_mail *mails;
unsigned int i, count;
const void *data;
- bool expunged;
uint32_t next_map_uid = first_map_uid;
mdbox_update_header(mbox, ctx->ctx.trans, NULL);
mails = array_get(&ctx->mails, &count);
for (i = 0; i < count; i++) {
mail_index_lookup_ext(view, mails[i].seq, mbox->ext_id,
- &data, &expunged);
+ &data, NULL);
old_rec = data;
if (old_rec != NULL && old_rec->map_uid != 0) {
/* message was copied. keep the existing map uid */
struct mdbox_mail_index_record rec;
const void *guid_data;
guid_128_t wanted_guid;
- bool expunged;
ctx->ctx.finished = TRUE;
}
mail_index_lookup_ext(mail->transaction->view, mail->seq,
- src_mbox->guid_ext_id, &guid_data, &expunged);
+ src_mbox->guid_ext_id, &guid_data, NULL);
if (guid_data == NULL || guid_128_is_empty(guid_data)) {
/* missing GUID, something's broken. don't copy using
refcounting. */
struct mdbox_rebuild_msg *rec;
const void *data;
const uint8_t *guid_p;
- bool expunged;
uint32_t old_seq, new_seq, uid, map_uid;
/* Rebuild the mailbox's index. Note that index is reset at this point,
hdr = mail_index_get_header(view);
for (old_seq = 1; old_seq <= hdr->messages_count; old_seq++) {
mail_index_lookup_ext(view, old_seq, mbox->ext_id,
- &data, &expunged);
+ &data, NULL);
if (data == NULL) {
memset(&new_dbox_rec, 0, sizeof(new_dbox_rec));
map_uid = 0;
}
mail_index_lookup_ext(view, old_seq, mbox->guid_ext_id,
- &data, &expunged);
+ &data, NULL);
guid_p = data;
/* see if we can find this message based on
const void *data;
struct mdbox_rebuild_msg **msgs;
const uint16_t *ref16_p;
- bool expunged;
uint32_t seq, map_uid;
unsigned int i, count;
mail_index_lookup_ext(ctx->atomic->sync_view, seq,
ctx->storage->map->ref_ext_id,
- &data, &expunged);
+ &data, NULL);
ref16_p = data;
if (ref16_p == NULL || *ref16_p != msgs[i]->refcount) {
mail_index_update_ext(ctx->atomic->sync_trans, seq,
{
const void *data;
uint32_t uid;
- bool expunged;
mail_index_lookup_uid(ctx->sync_view, seq, &uid);
mail_index_lookup_ext(ctx->sync_view, seq,
- ctx->mbox->guid_ext_id, &data, &expunged);
+ ctx->mbox->guid_ext_id, &data, NULL);
if (guid_128_is_empty(guid_128) ||
memcmp(data, guid_128, GUID_128_SIZE) == 0)
return 0;
unsigned int n;
const void *data;
uint32_t seq, uid;
- bool expunged;
/* use a separate transaction here so that we can commit the changes
during map transaction */
while (seq_range_array_iter_nth(&iter, n++, &seq)) {
mail_index_lookup_uid(ctx->sync_view, seq, &uid);
mail_index_lookup_ext(ctx->sync_view, seq,
- ctx->mbox->guid_ext_id, &data, &expunged);
+ ctx->mbox->guid_ext_id, &data, NULL);
mail_index_expunge_guid(trans, seq, data);
}
if (mail_index_transaction_commit(&trans) < 0)
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
struct mbox_mailbox *mbox = (struct mbox_mailbox *)mail->mail.mail.box;
const void *ext_data;
- bool expunged;
if (mail->data.guid != NULL) {
*value_r = mail->data.guid;
mail_index_lookup_ext(mail->mail.mail.transaction->view,
mail->mail.mail.seq, mbox->md5hdr_ext_idx,
- &ext_data, &expunged);
+ &ext_data, NULL);
if (ext_data != NULL && memcmp(ext_data, empty_md5, 16) != 0) {
mail->data.guid = p_strdup(mail->mail.data_pool,
binary_to_hex(ext_data, 16));
const struct mail_index_record *rec = NULL;
uint32_t messages_count;
const void *data;
- bool expunged;
if (sync_ctx->index_reset) {
*rec_r = NULL;
mail_index_lookup_ext(sync_ctx->sync_view,
sync_ctx->idx_seq,
sync_ctx->mbox->md5hdr_ext_idx,
- &data, &expunged);
+ &data, NULL);
if (data != NULL && memcmp(data, hdr_md5_sum, 16) == 0)
break;
{
const void *data;
uint64_t offset;
- bool expunged;
if (!nocheck) {
/* see if from_offset needs updating */
mail_index_lookup_ext(sync_ctx->sync_view, sync_ctx->idx_seq,
sync_ctx->mbox->mbox_ext_idx,
- &data, &expunged);
+ &data, NULL);
if (data != NULL &&
*((const uint64_t *)data) == mail->from_offset)
return;
{
struct mbox_sync_context *sync_ctx = mail_ctx->sync_ctx;
const void *ext_data;
- bool expunged;
mail_index_lookup_ext(sync_ctx->sync_view, sync_ctx->idx_seq,
- sync_ctx->mbox->md5hdr_ext_idx,
- &ext_data, &expunged);
+ sync_ctx->mbox->md5hdr_ext_idx, &ext_data, NULL);
if (ext_data == NULL ||
memcmp(mail_ctx->hdr_md5_sum, ext_data, 16) != 0) {
mail_index_update_ext(sync_ctx->t, sync_ctx->idx_seq,
struct virtual_backend_box *bbox;
const struct virtual_mail_index_record *vrec;
const void *data;
- bool expunged;
i_assert(!saving);
mail_index_lookup_ext(mail->transaction->view, seq,
- mbox->virtual_ext_id, &data, &expunged);
+ mbox->virtual_ext_id, &data, NULL);
vrec = data;
bbox = virtual_backend_box_lookup(mbox, vrec->mailbox_id);
const struct virtual_mail_index_record *vrec;
struct virtual_search_record srec;
const void *data;
- bool expunged;
int result;
memset(&srec, 0, sizeof(srec));
/* possible match, save and check later */
mail_index_lookup_ext(mbox->box.view, ctx->seq,
mbox->virtual_ext_id,
- &data, &expunged);
+ &data, NULL);
vrec = data;
srec.mailbox_id = vrec->mailbox_id;
enum modify_type modify_type;
const char *kw_names[2];
uint32_t vseq, seq1, seq2;
- bool expunged;
switch (sync_rec->type) {
case MAIL_INDEX_SYNC_TYPE_EXPUNGE:
for (vseq = seq1; vseq <= seq2; vseq++) {
mail_index_lookup_ext(ctx->sync_view, vseq, virtual_ext_id,
- &data, &expunged);
+ &data, NULL);
vrec = data;
bbox = virtual_backend_box_lookup(ctx->mbox, vrec->mailbox_id);
struct virtual_backend_uidmap uidmap;
const void *data;
uint32_t seq, vseq, vuid, messages;
- bool expunged;
/* add the currently existing UIDs to uidmap. remember the messages
that were already expunged */
for (vseq = 1; vseq <= messages; vseq++) {
mail_index_lookup_uid(ctx->sync_view, vseq, &vuid);
mail_index_lookup_ext(ctx->sync_view, vseq,
- ctx->mbox->virtual_ext_id,
- &data, &expunged);
+ ctx->mbox->virtual_ext_id, &data, NULL);
vrec = data;
if (vrec->mailbox_id == bbox->mailbox_id) {
uidmap.real_uid = vrec->real_uid;
struct virtual_add_record add_rec;
const struct virtual_mail_index_record *vrec;
const void *data;
- bool expunged;
uint32_t i, vseq, vuid, messages;
unsigned int j = 0, uidmap_count = 0;
vmails = i_new(struct virtual_sync_mail, messages);
for (vseq = 1; vseq <= messages; vseq++) {
mail_index_lookup_ext(ctx->sync_view, vseq, virtual_ext_id,
- &data, &expunged);
+ &data, NULL);
vrec = data;
vmails[vseq-1].vseq = vseq;
vmails[vseq-1].vrec = *vrec;
const struct virtual_mail_index_record *vrec;
struct virtual_backend_uidmap uidmap;
const void *data;
- bool expunged;
uint32_t seq, seq2;
if (!ctx->mbox->uids_mapped)
memset(&uidmap, 0, sizeof(uidmap));
for (; seq <= seq2; seq++) {
mail_index_lookup_ext(ctx->sync_view, seq, virtual_ext_id,
- &data, &expunged);
+ &data, NULL);
vrec = data;
uidmap.real_uid = vrec->real_uid;
mail_index_lookup_uid(ctx->sync_view, seq, &uidmap.virtual_uid);
struct seq_range_iter iter;
const struct virtual_mail_index_record *vrec;
const void *data;
- bool expunged;
unsigned int n = 0;
uint32_t seq;
seq_range_array_iter_init(&iter, isync_ctx->expunges);
while (seq_range_array_iter_nth(&iter, n++, &seq)) {
mail_index_lookup_ext(mbox->box.view, seq,
- mbox->virtual_ext_id, &data, &expunged);
+ mbox->virtual_ext_id, &data, NULL);
vrec = data;
if (bbox == NULL || bbox->mailbox_id != vrec->mailbox_id) {