From: Timo Sirainen Date: Mon, 13 Feb 2017 18:01:13 +0000 (+0200) Subject: LAYOUT=index: Rename mailbox_list_index_node.corrupted_parent to corrupted_ext X-Git-Tag: 2.3.0.rc1~2127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e9dc599a312e1bd55ce2cb256535914a8295344;p=thirdparty%2Fdovecot%2Fcore.git LAYOUT=index: Rename mailbox_list_index_node.corrupted_parent to corrupted_ext The code will be useful for other purposes also besides updating corrupted parents. --- diff --git a/src/lib-storage/list/mailbox-list-index-sync.c b/src/lib-storage/list/mailbox-list-index-sync.c index c30e242e7c..52a24b300e 100644 --- a/src/lib-storage/list/mailbox-list-index-sync.c +++ b/src/lib-storage/list/mailbox-list-index-sync.c @@ -376,17 +376,18 @@ mailbox_list_index_sync_update_corrupted_node(struct mailbox_list_index_sync_con if (!mail_index_lookup_seq(sync_ctx->view, node->uid, &seq)) return; - if (node->corrupted_parent) { + if (node->corrupted_ext) { mail_index_lookup_ext(sync_ctx->view, seq, sync_ctx->ilist->ext_id, &data, &expunged); i_assert(data != NULL); memcpy(&irec, data, sizeof(irec)); + irec.name_id = node->name_id; irec.parent_uid = node->parent == NULL ? 0 : node->parent->uid; mail_index_update_ext(sync_ctx->trans, seq, sync_ctx->ilist->ext_id, &irec, NULL); - node->corrupted_parent = FALSE; + node->corrupted_ext = FALSE; } if ((node->flags & MAILBOX_LIST_INDEX_FLAG_CORRUPTED_NAME) != 0) { /* rely on lib-index to drop unnecessary updates */ diff --git a/src/lib-storage/list/mailbox-list-index.c b/src/lib-storage/list/mailbox-list-index.c index 6a006a2bf1..84e658f02d 100644 --- a/src/lib-storage/list/mailbox-list-index.c +++ b/src/lib-storage/list/mailbox-list-index.c @@ -355,7 +355,7 @@ static int mailbox_list_index_parse_records(struct mailbox_list_index *ilist, if (ilist->has_backing_store) break; /* just place it under the root */ - node->corrupted_parent = TRUE; + node->corrupted_ext = TRUE; } else if (node_has_parent(parent, node)) { *error_r = t_strdup_printf( "parent_uid=%u loops to node itself (%s)", @@ -363,7 +363,7 @@ static int mailbox_list_index_parse_records(struct mailbox_list_index *ilist, if (ilist->has_backing_store) break; /* just place it under the root */ - node->corrupted_parent = TRUE; + node->corrupted_ext = TRUE; } else { node->parent = parent; node->next = parent->children; diff --git a/src/lib-storage/list/mailbox-list-index.h b/src/lib-storage/list/mailbox-list-index.h index a46436b4c2..1073a0d7de 100644 --- a/src/lib-storage/list/mailbox-list-index.h +++ b/src/lib-storage/list/mailbox-list-index.h @@ -80,8 +80,8 @@ struct mailbox_list_index_node { uint32_t name_id, uid; enum mailbox_list_index_flags flags; - /* parent_uid is corrupted on disk - need to update it */ - bool corrupted_parent; + /* extension data is corrupted on disk - need to update it */ + bool corrupted_ext; const char *name; };